Skip to content

Commit

Permalink
Merge branch 'hotfix/1.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
TravisCarden committed Mar 16, 2020
2 parents fdfc09c + 86d6607 commit 3521ff6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.3.0
v1.3.1
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ORCA (Official Representative Customer Application) is a tool for testing a comp
| --- | --- |
| Adds all company packages to a BLT project via Composer, installs them and their subextensions, and runs their automated tests. | Ensures that all company packages can be added to the same codebase via Composer (prevents dependency conflicts), that there are no adverse install time or functional interactions between them, and that they have no undeclared dependencies, and prevents regressions. |
| Adds only the package under test to a BLT project via Composer, installs it and its subextensions, and runs its automated tests. | Ensures that the package under test has no undeclared dependencies on other company packages and functions correctly on its own. |
| Performs the above tests with the recommended, stable versions of company packages and Drush. | Ensures that the package under test still works with the versions of other software already released and in use and prevents releases of the package from disrupting the ecosystem. |
| Performs the above tests using the latest development versions of company packages and Drush. | Ensures that the package under test will continue to work when new versions of other software are released and prevents changes in the ecosystem from breaking the package. Forces early awareness and collaboration between project teams and prevents rework and release day emergency support situations. |
| Performs the above tests with the recommended, stable versions of company packages, Drush, and Drupal Console. | Ensures that the package under test still works with the versions of other software already released and in use and prevents releases of the package from disrupting the ecosystem. |
| Performs the above tests using the latest development versions of company packages, Drush, and Drupal Console. | Ensures that the package under test will continue to work when new versions of other software are released and prevents changes in the ecosystem from breaking the package. Forces early awareness and collaboration between project teams and prevents rework and release day emergency support situations. |
| Performs the above tests using a threefold spread of Drupal core versions: the previous minor release, the current supported release, and the next minor dev version. | Ensures that the package under test still works with both supported releases of Drupal and will continue to work when the next one drops. |
| Performs static analysis of the package under test. | Ensures low level construction quality. (Prevents PHP warnings and errors, version incompatibility, etc.) |

Expand Down
41 changes: 38 additions & 3 deletions src/Fixture/FixtureCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,15 @@ private function fixDefaultDependencies(): void {
$additions[] = 'drush/drush:dev-master || 10.x-dev || 9.x-dev || 9.5.x-dev';
}

if ($this->shouldRequireDrupalConsole()) {
// Add Drupal Console as a soft dependency akin to Drush.
$drupal_console_version = '~1.0';
if ($this->isDev) {
$drupal_console_version = 'dev-master';
}
$additions[] = "drupal/console:{$drupal_console_version}";
}

// Install a specific version of Drupal core.
if ($this->drupalCoreVersion) {
$additions[] = "drupal/core:{$this->drupalCoreVersion}";
Expand Down Expand Up @@ -465,6 +474,20 @@ private function fixDefaultDependencies(): void {
$this->processRunner->runOrcaVendorBin($command, $fixture_path);
}

/**
* Determines whether or not to require drupal/console.
*
* Only require it for Drupal 8. It's not compatible with Drupal 9 at the time
* of this writing.
*
* @return bool
* Returns TRUE if it should be required, or FALSE if not.
*/
private function shouldRequireDrupalConsole(): bool {
$version = $this->getResolvedDrupalCoreVersion();
return Comparator::lessThan($version, '9');
}

/**
* Determines whether or not to require drupal/core-dev.
*
Expand All @@ -475,16 +498,28 @@ private function fixDefaultDependencies(): void {
* Returns TRUE if it should be required, or FALSE if not.
*/
private function shouldRequireDrupalCoreDev(): bool {
$version = $this->getResolvedDrupalCoreVersion();
return Comparator::greaterThanOrEqualTo($version, '8.8');
}

/**
* Gets the concrete version of Drupal core that will be installed.
*
* @return string
* The best match for the requested version of Drupal core, accounting for
* ranges.
*/
private function getResolvedDrupalCoreVersion(): string {
try {
// Get the version if it's concrete as opposed to a range.
$version = $this->versionParser->normalize($this->drupalCoreVersion);
}
catch (\UnexpectedValueException $e) {
// The requested Drupal core version is a range. Get the best match.
$minimum_stability = $this->isDev ? 'dev' : 'stable';
$version = $this->coreVersionFinder->find($this->drupalCoreVersion, $minimum_stability);
$stability = $this->isDev ? 'dev' : 'stable';
$version = $this->coreVersionFinder->find($this->drupalCoreVersion, $stability, $stability);
}
return Comparator::greaterThanOrEqualTo($version, '8.8');
return $version;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/Fixture/FixtureInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ public function getOverview(): array {
'Drush version',
$this->getInstalledPackageVersionPretty('drush/drush'),
];
$overview[] = [
'Drupal Console version',
$this->getInstalledPackageVersionPretty('drupal/console'),
];

$overview = array_merge($overview, $this->getInstalledPackages());

Expand Down

0 comments on commit 3521ff6

Please sign in to comment.