Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: GH Actions: safeguard compatibility with Composer 1.x #210

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Dec 25, 2021

Description

Safeguard compatibility with Composer 1.x by running both the expect tests as well as the integration test against both Composer 1.x as well as 2.x.

Related to #209.

Note: this is just a general test run to allow for discovering further incompatibilities. Depending what is decided about those, this PR will most likely need further adjustments.

Motivation and context

  • Composer 2 has only been out a year.
  • As this tool is used in CI and projects may want to explicitly support Composer 1.x as well as 2.x in their code, so they will also want to test against both Composer majors.
  • Not all Composer plugins have a Composer 2.x compatible version yet.

With that in mind, I believe it would be prudent to continue support for Composer 1.x (for the time being).

@jrfnl jrfnl requested a review from ramsey as a code owner December 25, 2021 20:02
@jrfnl jrfnl marked this pull request as draft December 25, 2021 20:02
... by running both the `expect` tests as well as the integration test against both Composer 1.x as well as 2.x.
@jrfnl jrfnl force-pushed the feature/ghactions-test-against-multiple-composer-versions branch from 267b433 to 998a29b Compare December 25, 2021 20:04
I'm removing the development tooling because this causes problems in CI
when running tests against Composer v1.
In Composer v2, this option exists to suppress the warning emitted if
composer.json contains a "version" property. The option does not exist
in v1 and causes problems in CI, as a result.
@ramsey ramsey marked this pull request as ready for review December 28, 2021 00:28
@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

I took the liberty of making some changes to your branch to get things passing for Composer v1 and v2.

Notably, I removed some of the tooling I had in the root composer.json. It's not necessarily important to maintaining this repository, so it's not a big deal to me to remove it, especially since it makes testing easier.

I also removed --no-check-version from the validate command. While version is command to find in package.json, I've never seen anyone put version in their composer.json file, so I think the warning will be rare. If someone sees failures due to these warnings, I hope they'll open an issue here, and we can address it then.

@ramsey ramsey merged commit 88dd51d into ramsey:v2 Dec 28, 2021
@jrfnl jrfnl deleted the feature/ghactions-test-against-multiple-composer-versions branch December 28, 2021 00:51
@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

I took the liberty of making some changes to your branch to get things passing for Composer v1 and v2.

Thanks for that!

Notably, I removed some of the tooling I had in the root composer.json. It's not necessarily important to maintaining this repository, so it's not a big deal to me to remove it, especially since it makes testing easier.

If you like, you could add a GHA job to at least run composer-normalize by requesting it as a tool from setup-php. Happy to set that up for you if you'd like that.

I also removed --no-check-version from the validate command. While version is command to find in package.json, I've never seen anyone put version in their composer.json file, so I think the warning will be rare. If someone sees failures due to these warnings, I hope they'll open an issue here, and we can address it then.

I agree that will probably be rare, though I also have to admit that I ran into it again only the other week... (and removed it from that project: php-parallel-lint/PHP-Code-Style@f1a82cb)

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

Heads up for other contributors: the removal of Captain Hook doesn't automatically "clean up" the hooks which were put in place in the .git/hooks folder. Those need to be manually removed as otherwise most every git operation will break on the now missing captainhook.json configuration.

@ramsey
Copy link
Owner

ramsey commented Dec 28, 2021

If you like, you could add a GHA job to at least run composer-normalize by requesting it as a tool from setup-php. Happy to set that up for you if you'd like that.

Sounds good to me. Feel free to set it up, and thanks!

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 28, 2021

If you like, you could add a GHA job to at least run composer-normalize by requesting it as a tool from setup-php. Happy to set that up for you if you'd like that.

Sounds good to me. Feel free to set it up, and thanks!

While looking at the workflow, I saw some more tweaks which could (should) be made, so I've done a more extensive update. PR upcoming.

@jrfnl jrfnl mentioned this pull request Dec 28, 2021
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants