Skip to content
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

[#660] Fixed required Composer version constraint and added a CI job. #662

Merged
merged 1 commit into from
May 17, 2024

Conversation

AlexSkrypnyk
Copy link
Collaborator

@AlexSkrypnyk AlexSkrypnyk commented May 16, 2024

#660

  • A job was added to CI to check for negative test
__660__Fixed_required_Composer_version_constraint_and_added_a_CI_job__·_drupal-composer_drupal-project_cb50f44
  • Positive tests are all our existing CI jobs that are using stable Composer channel

Once this is approved - I will create a PR for 11.x

@AlexSkrypnyk AlexSkrypnyk marked this pull request as draft May 16, 2024 22:45
@AlexSkrypnyk AlexSkrypnyk marked this pull request as ready for review May 16, 2024 22:47
@AlexSkrypnyk AlexSkrypnyk self-assigned this May 16, 2024
@AlexSkrypnyk AlexSkrypnyk added D10 PR: Needs review Pull request needs a review from assigned developers labels May 16, 2024
@@ -85,3 +85,26 @@ jobs:

- name: Run a single unit test to verify the testing setup
run: ./vendor/bin/phpunit -c ./web/core ./web/core/modules/user/tests/src/Unit/UserAccessControlHandlerTest.php

# Using outdated Composer version to test the Composer version constraint.
test-composer:
Copy link
Collaborator Author

@AlexSkrypnyk AlexSkrypnyk May 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no simple way to use existing jobs without adding a lot of if to every step as this check happens early in the run.

instead, having a standalone (fast) job is easier to maintain.


I called this test-composer rather than test-composer-fail etc. in case we want to add more composer-related tests in the future.

But happy to change the name to anything else.

@@ -92,8 +92,8 @@ public static function checkComposerVersion(Event $event) {
if ($version === '@package_version@' || $version === '@package_branch_alias_version@') {
$io->writeError('<warning>You are running a development version of Composer. If you experience problems, please update Composer to the latest stable version.</warning>');
}
elseif (Comparator::lessThan($version, '1.0.0')) {
$io->writeError('<error>Drupal-project requires Composer version 1.0.0 or higher. Please update your Composer before continuing</error>.');
elseif (Comparator::lessThan($version, '2.3.6')) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@leymannx leymannx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 🤩

@AlexSkrypnyk AlexSkrypnyk merged commit 0404d8a into 10.x May 17, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D10 PR: Needs review Pull request needs a review from assigned developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants