-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NEW Start with lowest installer version for --prefer-lowest #97
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -132,10 +132,24 @@ public function getInstallerVersion( | |||||
|
||||||
public function createJob(int $phpIndex, array $opts): array | ||||||
{ | ||||||
$isInstallerModule = in_array($this->repoName, INSTALLER_MODULES); | ||||||
$isPreferLoweset = strpos($opts['composer_args'] ?? '', '--prefer-lowest') !== false; | ||||||
$installerVersion = $this->installerVersion; | ||||||
$cmsMajor = BranchLogic::getCmsMajor($this->repoData, $this->branch, $this->getComposerJsonContent()); | ||||||
if ($cmsMajor >= 5 && !$isInstallerModule && $isPreferLoweset && $installerVersion) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There's no reason to exclude CMS 4 here - those should all have compatible dependencies already (and if they don't, that's a problem) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason it's excluded is because in the corresponding gha-ci PR each major will have the following minor releases: The way this solution works it needs to start at If CMS 4 does suffer from a --prefer-lowest incompatibility, it's not worth fixing at this point in its lifecycle. There's a simple work around of simply upgrade something else to get things to install. |
||||||
// --prefer-lowest jobs should use the lowest installer version for non-installer modules | ||||||
// gha-ci will increment the installer version higher if composer is unable to install | ||||||
// and try installing again | ||||||
Comment on lines
+141
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For prefer-lowest it probably shouldn't increment the installer version - that goes against the entire point of using prefer-lowest. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incrementing installer is the entire point of this solution It always starts off trying to using installer 5.0. If that fails to installs, then it attempts installer 5.1 This would have caught out the original issue that started all of this. That version of elemental has a framework dep of ^5, instead of ^5.1. What happened before is the --prefer-lowest builds were installing using a recent version of installer that included a version of framework that DID have the eagerLoad API (added in 5.1). With this new solution it would have instead installed with installer 5.0, and this would have lead to the CI build going red because of the missing API called in the unit test and we'd see the issue. With this solution, which the framework dep correctly being ^5.1 instead, it will fail to install with installer 5.0, then it will successfully install with installer 5.1. Which is what we want to test --prefer-lowest with because that's what the specified minimum version of framework/installer is. |
||||||
// | ||||||
// Was going to use something like 5.2.x-dev, install 5.0.x-dev instead | ||||||
$installerVersion = preg_replace('#^([0-9])\.[0-9]\.x-dev$#', '$1.0.x-dev', $installerVersion); | ||||||
// Was going to use something like 5.x-dev, install 5.0.x-dev instaed | ||||||
$installerVersion = preg_replace('#^([0-9])\.x-dev$#', '$1.0.x-dev', $installerVersion); | ||||||
Comment on lines
+144
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should detect the lowest supported version based on the composer dependencies! That's what this is all about. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The detection is done gha-ci rather than gha-generate-matrix Makes far more sense to use composer to work out what's installable and what's not rather than trying to work out what's installable and what's not by looking at composer.json files in gha-generate-matrix |
||||||
} | ||||||
$default = [ | ||||||
# ensure there's a default value for all possible return keys | ||||||
# this allows us to use `if [[ "${{ matrix.key }}" == "true" ]]; then` in gha-ci/ci.yml | ||||||
'installer_version' => $this->installerVersion, | ||||||
'installer_version' => $installerVersion, | ||||||
'php' => $this->getPhpVersion($phpIndex), | ||||||
'parent_branch' => $this->parentBranch, | ||||||
'db' => DB_MYSQL_57, | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
<?php | ||
$autoloadPath = __DIR__ . '/../vendor/autoload.php'; | ||
if (!file_exists($autoloadPath)) { | ||
throw new RuntimeException('Run composer install first'); | ||
} | ||
require_once $autoloadPath; | ||
|
||
// working directory will be root | ||
include 'consts.php'; | ||
include 'job_creator.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be all of the modules which have
isCore
= true in repositories.json - no need to have a duplicate list here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The list isn't quite the same:
repositories.json - isCore:
Things in repositories.json not in INSTALLER_MODULES (this doesn't really matter):
Things in INSTALLER_MODULES not in repositories.json (this matters):