Skip to content

chore: backport docs update - #5101

Open
johnmtll wants to merge 4 commits into
mainfrom
johnmtll/backport-docs
Open

johnmtll wants to merge 4 commits into
mainfrom
johnmtll/backport-docs

Conversation

@johnmtll

@johnmtll johnmtll commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Summary of Changes

Updates the backport docs to make the steps to achieve a backport a little more-clear, and includes context for handling CI failures.

Notes for Reviewers

What is the motivation for this change?

For bug fixes

Current (incorrect) behavior:

Expected behavior:

How to reproduce:

Affected versions:

Release Highlight

Release notes highlight

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

@johnmtll
johnmtll marked this pull request as ready for review November 4, 2026 16:20
@johnmtll
johnmtll requested a review from a team as a code owner November 4, 2026 16:20
Copilot AI balanced review requested due to automatic review settings November 4, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The release sync instructions name nonexistent publish.yml instead of the required npm-publish.yml, so following them would miss the publishing workflow.

1 open issue
What changed in this PR

This documentation-only PR clarifies the MongoDB Node.js driver’s backport process, including how to handle CI failures on release branches.

Changes:

  • Splits backport work into separate CI-fix, code-backport, and release-tooling PRs.
  • Adds guidance on reusing CI fixes and synchronizing release workflows from main.
File Description
etc/​notes/​releasing.md Reorganizes backport instructions and expands CI and release-tooling guidance.

Review effort: Balanced

Comment thread etc/notes/releasing.md Resolved
#5101 (comment)

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@PavelSafronov PavelSafronov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look good! I've got a few notes, but nothing major.

Comment thread etc/notes/releasing.md
First, create a copy of our current release action (release.yml). Then, change any references to `main` to the target branch. Also, add the branch to the list of CodeQL target branches (codeql.yml). Double check that there isn't any release tooling on `main` that doesn't exist on the target branch. If there is, make sure this is backported too. After opening the PR, check the CI to make sure everything works as expected: add backports of CI fixes as needed.
1. **CI fix PR(s).** Apply the CI fixes needed for CI to go green on the release branch (for example changes to `.evergreen/`, lint and test configs, dependency pins). Some of these can be taken from `main`. Open further PRs as needed until CI is green.
2. **Backport PR(s).** The code changes being backported. You can replay a cherry picked commit from step 1 onto this PR branch so your code can be tested against a sane base.
3. **Release tooling sync PR.** Copy the release workflows from `main` (`npm-publish.yml`, `release.yml`, etc.). In `release.yml`, change any references to `main` to the target branch. Also add the branch to the list of CodeQL target branches (`codeql.yml`). Backport any other release tooling from `main` that the target branch is missing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another thing to include in these steps is to update the tag value in release.yml on the release branch.

The change is around line 107 and goes from

          node ./.github/scripts/dispatch-and-wait.mjs npm-publish.yml \
            tag=latest \                  # <--- here
            version="$(node -p "require('./package.json').version")" \
            ref="${{ github.sha }}"

to

          node ./.github/scripts/dispatch-and-wait.mjs npm-publish.yml \
            tag=6x \                  # <--- here
            version="$(node -p "require('./package.json').version")" \
            ref="${{ github.sha }}"

This way we won't publish a latest version from that branch.

Here's one attempt at this wording:

In release.yml, change any references to main to the target branch, and change the tag=latest argument of the npm-publish dispatch to a dist-tag for the backport line (convention: <major>x, e.g. 6x). Never publish a backport as latest, or it becomes the default npm install version. The tag must not be a valid semver range (6.x and 7.1.x are rejected by npm).

Comment thread etc/notes/releasing.md
First, create a copy of our current release action (release.yml). Then, change any references to `main` to the target branch. Also, add the branch to the list of CodeQL target branches (codeql.yml). Double check that there isn't any release tooling on `main` that doesn't exist on the target branch. If there is, make sure this is backported too. After opening the PR, check the CI to make sure everything works as expected: add backports of CI fixes as needed.
1. **CI fix PR(s).** Apply the CI fixes needed for CI to go green on the release branch (for example changes to `.evergreen/`, lint and test configs, dependency pins). Some of these can be taken from `main`. Open further PRs as needed until CI is green.
2. **Backport PR(s).** The code changes being backported. You can replay a cherry picked commit from step 1 onto this PR branch so your code can be tested against a sane base.
3. **Release tooling sync PR.** Copy the release workflows from `main` (`npm-publish.yml`, `release.yml`, etc.). In `release.yml`, change any references to `main` to the target branch. Also add the branch to the list of CodeQL target branches (`codeql.yml`). Backport any other release tooling from `main` that the target branch is missing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should remove the etc. here, it doesn't help. We can list out the impacted files: .github/workflows/release.yml, .github/workflows/build.yml, and .github/scripts/dispatch-and-wait.mjs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The release flow may be dependent on multiple scripts/workflows. The sync should be a main-favoured clobber of existing files and import of missing files. The 'missing files' is what 'etc.' accounts for.

Comment thread etc/notes/releasing.md
First, create a copy of our current release action (release.yml). Then, change any references to `main` to the target branch. Also, add the branch to the list of CodeQL target branches (codeql.yml). Double check that there isn't any release tooling on `main` that doesn't exist on the target branch. If there is, make sure this is backported too. After opening the PR, check the CI to make sure everything works as expected: add backports of CI fixes as needed.
1. **CI fix PR(s).** Apply the CI fixes needed for CI to go green on the release branch (for example changes to `.evergreen/`, lint and test configs, dependency pins). Some of these can be taken from `main`. Open further PRs as needed until CI is green.
2. **Backport PR(s).** The code changes being backported. You can replay a cherry picked commit from step 1 onto this PR branch so your code can be tested against a sane base.
3. **Release tooling sync PR.** Copy the release workflows from `main` (`npm-publish.yml`, `release.yml`, etc.). In `release.yml`, change any references to `main` to the target branch. Also add the branch to the list of CodeQL target branches (`codeql.yml`). Backport any other release tooling from `main` that the target branch is missing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Order of operations: I think the CodeQL change should be moved to step 1, since that step is the "CI fixes".

Comment thread etc/notes/releasing.md
release-please automatically tags release commits with a tag in the format v<major>.<minor>.<patch>. When backporting, first determine the target minor version and create a release branch for it by branching off of the release tag. The release branch should follow the format `v<major>.<minor>.x`. For example, to create a backport of bson's 6.5 release, create a release branch from the v6.5.0 tag with the name v6.5.x.

Then, backport the release action to the target release branch. This should be done as the first PR on the release branch. Use the following instructions to create it.
A backport is split across several PRs, each opened against the `v<major>.<minor>.x` release branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's be explicit here: the below PRs should be opened, reviewed, and merged in this specific order.

Comment thread etc/notes/releasing.md
- [Packages](#packages)

> [!NOTE]
> _Last updated: Oct 1, 2025_

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Update this text.

@PavelSafronov PavelSafronov self-assigned this Nov 10, 2026
@PavelSafronov PavelSafronov added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants