jenkins: fetch refs before test commit rebase#4346
Conversation
Refresh the PR ref and rebase target before checking out the Jenkins local branch. When REBASE_ONTO exists locally without its parents, git can replay almost the entire Node.js history instead of only the PR commits. Fixes: nodejs#4345 Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
|
This is probably ok but it's so hot in the room I'm working I don't trust myself to do a formal review at the moment ... |
|
This probably works, but I don't think it's ok. We have never had these failures before so I don't think we should hide them by changing a script that has been working for years. |
|
Intriguingly it's shown up on a second debian12-x64 system overnight too 🤔 I sort of agree with targos but it's notable that it has happened on a second machine of the same OS in the same week. I'll keep an eye on it and do some investigation outside this issue, regardless of what happens with this PR in case there's an underlying cause that needs to be addressed. |
Fixes: #4345
Refresh the PR ref and
REBASE_ONTOinnode-test-commit-pre.shbeforechecking out
_jenkins_local_branchand runninggit rebase.When Jenkins has a shallow copy where
REBASE_ONTOexists locally withoutits parents,
git rebasecan treat nearly the entire Node.js history ascommits to replay. That caused failures like:
The script now fetches the refs it is about to use and unshallows the repository when needed.
Validation
bash -n jenkins/scripts/node-test-commit-pre.shgit diff --checkbefore=46899after=1Assisted-by: openai:gpt-5.5