Repository navigation
Conversation
There was a problem hiding this comment.
🟡 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
#5101 (comment) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
PavelSafronov
left a comment
There was a problem hiding this comment.
Changes look good! I've got a few notes, but nothing major.
| 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. |
There was a problem hiding this comment.
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 tomainto the target branch, and change thetag=latestargument of the npm-publish dispatch to a dist-tag for the backport line (convention:<major>x, e.g.6x). Never publish a backport aslatest, or it becomes the defaultnpm installversion. The tag must not be a valid semver range (6.xand7.1.xare rejected by npm).
| 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
Order of operations: I think the CodeQL change should be moved to step 1, since that step is the "CI fixes".
| 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. |
There was a problem hiding this comment.
Let's be explicit here: the below PRs should be opened, reviewed, and merged in this specific order.
| - [Packages](#packages) | ||
|
|
||
| > [!NOTE] | ||
| > _Last updated: Oct 1, 2025_ |

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
npm run check:lint)type(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript