-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix(presets): fix helpers:pinGitHubActionDigestsToSemver
#36338
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
base: main
Are you sure you want to change the base?
fix(presets): fix helpers:pinGitHubActionDigestsToSemver
#36338
Conversation
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.
This changes the meaning/behavior of this preset. Originally created in #23663
Are there any behavior changes that I didn't list under "Context"? Because I tested the original
The original Example of the original preset adding a digest: https://github.com/amezin/renovate-pin-actions-digest-semver-codeql/pull/4/files
Does this both before (unless the original preset fails with
Does this both before (unless the original preset fails with Example after: amezin/create-or-update-git-ref-action#17 So what am I missing? |
@travi @TWiStErRob @suzuki-shunsuke @MPV you were all involved in the original #23663. Can you take a look at the proposed changes here? |
i'll admit that i dont have this all in my head at the moment, but i'm happy to be pulled deeper if specific details need additional consideration. overall, i've been quite happy with how this preset behaves. there certainly may be some cases where it is not behaving as expected, so i'm glad to see some attention given.
this detail confuses me. i can understand that a missing tag would result in a failure to pin to that version, but i guess it maybe exposes a potential improvement in the pinning behavior. when pinning naively , i would expect the pinning to pin the latest version in that major, but i guess the ideal behavior would be to pin the hash of the commit that that
this may be why i havent noticed this scenario. i think this is in line with the outcome that i desire, even if the order of operations and the description could be improved. as described above, after pinning the currently used version, my end goal is to get upgraded to the latest and be pinned there, so this step hasnt felt wrong. maybe it just isnt the ideal path to get there? |
versioning: | ||
'regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$', | ||
rangeStrategy: 'pin', | ||
versioning: 'npm', |
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.
it feels risky to use npm
versioning here because there can be variation to how folks define tags for actions that might not align to the npm standards. i imagine this works in many cases, but would this set us up to miss some scenarios?
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 thing that's currently in main
versioning:
'regex:^v?(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$'
rejects all dependencies for which currentValue
doesn't match the regex (and yes, it again causes Renovate to completely stop processing these non-matching dependencies, completely silently). versioning: 'npm'
is actually less restrictive - it accepts v1.x
, for example.
And extractVersion
filters out everything that isn't exactly 3 numbers - more restrictive than npm
/semver
too.
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.
i agree that this is a step in the right direction. just calling out that there is nothing about actions versioning that relates it to npm versioning specifically. mainly wondering if it warrants its own "versioning" classification. others are probably more informed than me here, so just trying to call it out
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.
just calling out that there is nothing about actions versioning that relates it to npm versioning specifically
Both are semver "with ranges". For actions it's not enforced, but the recommended versioning matches - https://docs.github.com/en/actions/sharing-automations/creating-actions/releasing-and-maintaining-actions#example-developer-process
Also, the same page has a link directly to https://docs.npmjs.com/about-semantic-versioning
mainly wondering if it warrants its own "versioning" classification
Maybe, but right now it does not exist.
Changes
Fix
helpers:pinGitHubActionDigestsToSemver
to really do pinning.Context
The preset with regex versioning failed in some cases - for example, with codeql-action: `helpers:pinGitHubActionDigestsToSemver` causes some actions to be skipped with `"skipReason": "invalid-value"` #36322 (because there's no
v3.0.0
tag in the repository).When it didn't fail, it created "update" pull requests, not "pin" - Update actions/checkout action to v4.2.2 amezin/renovate-pin-actions-digest-semver-codeql#5
Also, the description was misleading. It didn't convert from digest pinning to version. It just changed the version in the comment.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: