Skip to content

jenkins: fetch refs before test commit rebase#4346

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:git-fetch-before-rebase
Open

jenkins: fetch refs before test commit rebase#4346
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:git-fetch-before-rebase

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 25, 2026

Fixes: #4345

Refresh the PR ref and REBASE_ONTO in node-test-commit-pre.sh before
checking out _jenkins_local_branch and running git rebase.

When Jenkins has a shallow copy where REBASE_ONTO exists locally without
its parents, git rebase can treat nearly the entire Node.js history as
commits to replay. That caused failures like:

Rebasing (1/46550)
Auto-merging Makefile
CONFLICT (add/add): Merge conflict in Makefile

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.sh
  • git diff --check
  • Reproduced the bad shallow range locally: before=46899
  • Confirmed the added fetch behavior reduces it to the expected range: after=1

Assisted-by: openai:gpt-5.5

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[2026-05-24] Tests on debian12-x64 have been failing with error "Merge conflict in Makefile"

1 participant