Inline the pre-commit action in the code quality jobs - #6886
Open
albertvillanova wants to merge 3 commits into
Open
Inline the pre-commit action in the code quality jobs#6886albertvillanova wants to merge 3 commits into
albertvillanova wants to merge 3 commits into
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the third party
pre-commit/actionwith the four steps it is made of, so that the code quality jobs stop emitting a Node.js deprecation warning and no longer depend on an action that is no longer developed.Motivation
Every run of the code quality job produces this warning:
It is the only annotation on the job. The cause is not one of our pins:
pre-commit/actioninternally usesactions/cache@v4, which declaresusing: 'node20', whileactions/cachev6 declaresusing: 'node24'.That reference is out of our reach. It lives inside the third party action, so Dependabot cannot bump it, and pinning
pre-commit/actionto a newer SHA would not help either, because upstream has not updated it. Upstream is explicit that it will not:So as long as we consume the action, the warning stays, and the runners are being forced onto Node.js 24 anyway. The only way to control that reference is to stop going through the action.
There is little to lose by doing so, because the action is a thin wrapper. This is its entire definition:
Four steps, one of which is a
pip freezedebug call. Inlining it removes a dependency rather than adding one, and it lets us pinactions/cacheby SHA like every other action in the repository. As a nested reference,actions/cache@v4was in fact the only mutable action ref we were still resolving in these jobs.Solution
Inline the steps that matter, cache, install and run, and drop the
pip freezedebug step, keeping the same one step per action granularity as the rest of our workflows. Behaviour is otherwise unchanged: samepre-commit run --all-files --show-diff-on-failure --color=alwaysinvocation, and the cache key is kept identical so existing cache entries stay valid.Changes
pre-commit/actionwith a cache step, an install step and a run step in the code quality job of the tests and experimental tests workflowsactions/cacheto v6.1.0, which targets Node.js 24Note
Low Risk
CI-only workflow change with equivalent pre-commit behavior; no application or security logic is affected.
Overview
Replaces the unmaintained
pre-commit/actionin the code quality jobs oftests.ymlandtests-experimental.ymlwith explicit cache, install, and run steps.Pins
actions/cacheto v6.1.0 (Node 24) so the jobs no longer inherit the action’s nestedactions/cache@v4Node 20 deprecation. Pre-commit invocation and cache key stay the same.Reviewed by Cursor Bugbot for commit 83566d1. Bugbot is set up for automated code reviews on this repo. Configure here.