ramsey / composer-install

:gift: A GitHub Action to streamline installation of PHP dependencies with Composer.
MIT License
227 stars 32 forks source link

Update cache action runner #252

Closed jrfnl closed 7 months ago

jrfnl commented 8 months ago

Description

The actions/cache package has released version 4.0 which updates the action runner to use Node 20.

Applying this fix gets rid of the following warning which is currently showing in the "Annotations" of workflows using the ramsey/composer-install action:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Note: most action runners have published these types of update in a new major, so that seems to be the best practice. Not sure if this update warrants a new major for ramsey/composer-install ?

Update: From what I've read, I believe this should be released in a new major as otherwise people using this action in self-hosted runners will run into trouble with this change.

Refs:

Motivation and context

People don't like to see warnings in their workflows ;-)

How has this been tested?

Pre-existing automated tests cover this change and the tests pass.

If you look in your own workflows, you can see that without this change, the following annotations (and a dozen more) display:

Run unclean (ubuntu-latest, v2)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Run action (ubuntu-latest, highest, v2, tests/fixtures/out-of-sync-lock)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

With this change, the annotations change to:

Run unclean (ubuntu-latest, v2)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Run action (ubuntu-latest, highest, v2, tests/fixtures/out-of-sync-lock)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

For this last warning regarding actions/checkout@v3, PR #248 is already open, so this is not addressed here.

Types of changes

Not sure what to put here, could be seen as just plain maintenance, could also be seen as a breaking change ?

PR checklist

Fixes #253 Closes #254

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (c49029a) 84.23% compared to head (9fc1be9) 84.23%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/ramsey/composer-install/pull/252/graphs/tree.svg?width=650&height=150&src=pr&token=ZP54XdHMGI&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey)](https://app.codecov.io/gh/ramsey/composer-install/pull/252?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Ben+Ramsey) ```diff @@ Coverage Diff @@ ## v2 #252 +/- ## ======================================= Coverage 84.23% 84.23% ======================================= Files 7 7 Lines 203 203 ======================================= Hits 171 171 Misses 32 32 ```
Levdbas commented 8 months ago

@ramsey , would you like to take a look at this? We are getting a lot of deprecation notices at @timber that would be solved with this update.

jrfnl commented 7 months ago

@ramsey Any chance of movement on this PR ? πŸ™πŸ»

ruudk commented 7 months ago

@ramsey Thanks for the merge, could you please tag it as well? We like to pin it to a specific version.

jrfnl commented 7 months ago

@ramsey Just saw the new tag - but shouldn't this have been a major release as per my comment above ?

Note: most action runners have published these types of update in a new major, so that seems to be the best practice. Not sure if this update warrants a new major for ramsey/composer-install ?

Update: From what I've read, I believe this should be released in a new major as otherwise people using this action in self-hosted runners will run into trouble with this change.

ramsey commented 7 months ago

Since the action is stand-alone, I didn't think it would cause BC issues. How will this affect users with self-hosted runners in a backwards incompatible way?

jrfnl commented 7 months ago

@ramsey self-hosted runners have their own self-hosted Node version(s) and the cache action now requiring Node 20 instead of Node 16 can break their build processes. Does that make it clearer ?

ramsey commented 7 months ago

Doh! Yes. That is clear. πŸ€¦β€β™‚οΈ

I'll take care of this later today. Sorry.

jrfnl commented 7 months ago

@ramsey No worries, I'm not on self-hosted myself ;-) Just thought I'd try and prevent you having to deal with lots of support issues.

You may want to pull the 2.3.0 release (or release a 2.3.1 without this particular change) to prevent people on self-hosted running into trouble .

ramsey commented 7 months ago

I'll release a 2.3.1 that removes that change and tag a 3.0.0 release with the change.

jrfnl commented 7 months ago

@ramsey Only just realized it's your birthday today... bit embarrassed I didn't start my earlier message with congratulations πŸ™ˆ Hope you had a great day and wishing you a lovely new year!

ramsey commented 7 months ago

Thanks! 😊

Levdbas commented 7 months ago

Hope you had a good day sir and thank you for your work! πŸŽ‰

ramsey commented 7 months ago

Due to BC issues, I have reverted the actions/cache upgrade in version 2.3.1 and have released 3.0.0, which includes the actions/cache upgrade. Please update your pinned versions to 3.0.0. See discussion on above, for more info.