Skip to content

test(NODE-7574): use mapping refspec when fetching tag in switch source#4938

Merged
PavelSafronov merged 1 commit intomainfrom
NODE-7574
May 6, 2026
Merged

test(NODE-7574): use mapping refspec when fetching tag in switch source#4938
PavelSafronov merged 1 commit intomainfrom
NODE-7574

Conversation

@tadjik1
Copy link
Copy Markdown
Member

@tadjik1 tadjik1 commented May 6, 2026

Description

Summary of Changes

The switch source Evergreen function was broken for tag-based SOURCE_REV values (e.g. refs/tags/v7.0.0), causing all four test-bson-latest-driver-7.0.0-* tasks to fail:

git fetch origin refs/tags/v7.0.0
* tag  v7.0.0 -> FETCH_HEAD
git checkout refs/tags/v7.0.0
error: pathspec 'refs/tags/v7.0.0' did not match any file(s) known to git

Root cause: git fetch origin <refspec> without a destination stores the result in FETCH_HEAD only - it does not create a local ref at refs/tags/v7.0.0. The subsequent git checkout refs/tags/v7.0.0 then fails because that local ref doesn't exist.

This previously worked because the Evergreen initial clone included all remote tags, so refs/tags/v7.0.0 already existed locally before the fetch ran. A change in the runner/agent setup (shallower clone without --tags) removed that implicit dependency.

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@tadjik1 tadjik1 marked this pull request as ready for review May 6, 2026 12:13
Copilot AI review requested due to automatic review settings May 6, 2026 12:13
@tadjik1 tadjik1 requested a review from a team as a code owner May 6, 2026 12:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes Evergreen’s switch source function so tag-based SOURCE_REV values (e.g., refs/tags/v7.0.0) can be checked out reliably in shallow clones by fetching the ref into a local ref (instead of leaving it only in FETCH_HEAD).

Changes:

  • Update git fetch in switch source to use a mapping refspec (<src>:<dst>) so the fetched tag ref exists locally for git checkout.
  • Apply the same change to both the source (config.in.yml) and generated (config.yml) Evergreen configs.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.evergreen/config.yml Updates switch source to fetch SOURCE_REV using a mapping refspec so tag checkouts succeed.
.evergreen/config.in.yml Mirrors the same switch source fetch refspec fix in the input Evergreen configuration.

Copy link
Copy Markdown
Contributor

@PavelSafronov PavelSafronov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, thanks!

@PavelSafronov PavelSafronov self-assigned this May 6, 2026
@PavelSafronov PavelSafronov merged commit e3610cb into main May 6, 2026
36 checks passed
@PavelSafronov PavelSafronov deleted the NODE-7574 branch May 6, 2026 15:17
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.

3 participants