Skip to content

ci(release): Adopt release-please - #5263

Open
thomas-lebeau wants to merge 13 commits into
mainfrom
thomas-lebeau/RUM-19882-adopt-release-please
Open

thomas-lebeau wants to merge 13 commits into
mainfrom
thomas-lebeau/RUM-19882-adopt-release-please

Conversation

@thomas-lebeau

@thomas-lebeau thomas-lebeau commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

This PR is the third step of the release-please adoption (RFC). It replaces the local yarn release script with a release PR that is always open.

The PR title convention is in main since #5260. The prerequisites are confirmed: dd-octo-sts can create tags, and tags start GitLab pipelines.

Refs: RUM-19882

Changes

Configuration

  • package.json pins release-please 17.11.2 as a devDependency.
  • release-please-config.json contains the configuration. .release-please-manifest.json contains the released versions.
  • The baseline is v7.19.0 for the Browser SDK and 0.0.23 for js-core. last-release-sha is the v7.19.0 release commit on main.
  • One release PR, chore(release): vX.Y.Z, contains all the packages. js-core is a separate component with 0.x versions.
  • When you merge the release PR, release-please creates draft GitHub releases. force-tag-creation makes it create the tags.
  • extra-files lists every package.json that contains the SDK version.

Root package-name: "" (the RFC does not mention this setting)

The problem: in release-please 17.11.2, a release PR that contains only the Browser SDK never gets a release. Its branch name has no component, but the root component uses the package.json name, browser-sdk. Thus buildRelease returns nothing (strategies/base.js). The autorelease: pending label then stays on the PR and blocks all the subsequent release PRs.

What it does: with an empty package name, the root component matches the branch. A spec shows the problem without this setting.

Release job (scripts/release/release-please.ts)

What it does:

  1. It registers our browser-sdk release type (see "How release-please calculates the next version").
  2. It gets a dd-octo-sts token (self.gitlab.release-please). using revokes the token at the end, also when an error occurs.
  3. It loads the public Manifest API of release-please. buildReleases() gives the releases that release-please will tag.
  4. It checks these releases (see "Pending-release check"). If a check fails, the job stops and creates no tag.
  5. createReleases() tags the merged release PR. createPullRequests() opens or updates the next release PR. These are the same steps as the CLI commands github-release and release-pr.

To preview the release PR on your computer, add --dry-run --target-branch <branch>. The dry run also does the pending-release check. It uses your gh token and changes nothing.

Pending-release check (scripts/lib/checkReleaseNotes.ts)

The problem: the job updates the release PR after each push to main. Someone can merge a feature, then merge the release PR before the job updates it. release-please then tags the merge commit. The release contains the feature, but its changelog and its GitHub release do not mention it.

What it does, before the job creates a tag:

  1. It gets the releases from buildReleases(). These are the merged release PRs that still have the autorelease: pending label: release-please removes this label when it tags a release. The check examines all of them, not only the latest. A release that fails the check keeps its label, and the next pipeline would tag it. buildReleases() also reads the release notes that release-please moves to a file when they are too long for the PR description.
  2. For each release, it gets the merge commit. If the pipeline checkout is older than this commit, it fetches the commit.
  3. It lists the commits between the previous release and the merge commit. The previous release is the nearest vX.Y.Z tag on main. Before the first release-please release, it is last-release-sha.
  4. It keeps only the commits with a type that the changelog shows (feat, fix, the "Internal Changes" types). It ignores hidden types, for example staging.
  5. For each of these commits, it makes sure that the release PR notes link to the commit SHA. release-please adds a commit link to each entry. A missing link shows that someone merged the release PR before the job added the commit.
  6. If commits are missing, the job fails. The error lists the commits and gives the fix: cancel the release (revert the release PR, remove its label, merge the revert). release-please then opens a new release PR with all the changes and the correct version.

GitLab release-please job

  • The job has one command: node scripts/release/release-please.ts.
  • It runs on every main pipeline, except scheduled pipelines (the same as .main). It also runs on release commits, which .main skips.
  • It is not interruptible and uses a resource_group. Thus, only one release job runs at a time.
  • It has allow_failure: true. Thus, a failure (for example, of the pending-release check) does not stop the canary deploy.
  • It sets GIT_DEPTH: 0, because the pending-release check needs the full history.

Other changes

  • PR title lint: the lint accepts ! on package scopes, also on feat(js-core)! (see "How release-please calculates the next version"). It rejects ! on internal scopes (ci, deps, …), because these changes do not break users.
  • Staging bump: the weekly commit is now staging(ci): …. staging is a hidden type. Thus, the commit does not show in the changelog and does not open a release PR. The PR title lint continues to reject staging.
  • CHANGELOG.md: it has a new header, with a note about the older gitmoji entries. .prettierignore now contains **/CHANGELOG.md, because release-please writes * bullets.

How release-please calculates the next version

The release PR has two components:

  • The root (.) contains all the SDK packages and the extension. It gets every commit.
  • packages/js-core gets only the commits that change its files.

The two components use the same changelog sections. Thus, a commit that releases js-core also releases the SDK, with the same tag commit.

PR title Browser SDK (7.19.0) js-core (0.0.23) Reason
fix(rum): … 7.19.1 — The commit changes no js-core file.
feat(rum): … 7.20.0 — feat gives a minor version.
feat(js-core): … 7.20.0 0.0.24 Before 1.0, bump-patch-for-minor-pre-major applies.
feat(js-core)!: … 7.20.0 0.1.0 Before 1.0, bump-minor-pre-major applies. The root ignores the break.
feat(core,js-core)!: … 8.0.0 0.1.0 A breaking change on an SDK package gives a major SDK version.
chore(deps): … 7.19.1 — The changelog shows internal types ("Internal Changes"). Thus they release.
staging(ci): … — — staging is a hidden type. Only the weekly staging bump uses it.

A breaking change in js-core alone must not give a major SDK version. Thus, the root uses a custom release type, BrowserSdkStrategy. It extends the Node strategy of release-please and overrides postProcessCommits. This function supplies the commits to the version calculation and to the changelog.

BrowserSdkStrategy: a js-core-only breaking change keeps the break for js-core (0.0.23 → 0.1.0) but is a regular feature for the Browser SDK (7.19.0 → 7.20.0)

  • The strategy also removes the ! from the header, because the changelog writer adds a breaking change note when it finds a !. It removes the spaces around the scope first, because the lint accepts feat( js-core )!.
  • To set a specific version (for example, a planned major version), use one of these procedures:
    • Set release-as in the configuration.
    • Put Release-As: x.y.z in a commit override block in the description of the source PR. A footer alone does not work, because squash commits have an empty body.

Known gaps

  • js-core puts the SDK version in dd-evp-origin-version when it builds (packages/js-core/src/transport/endpointBuilder.ts). After an SDK release without a js-core change, npm users send the previous SDK version. We accept this gap for now. A follow-up gives the version at runtime (RUM-20408), before the first release.
  • BrowserSdkStrategy imports the Node strategy from inside release-please. This strategy is not public API, and no public procedure extends a built-in release type. package.json pins release-please. If an upgrade breaks the import, the specs fail.

Test instructions

  1. Run yarn test:script. These specs apply to this PR:

    • release-please-config.spec.ts makes sure that extra-files contains every package.json with the SDK version, and the manifest. It makes sure that the changelog sections are the same as in conventionalCommits.ts. It also tests a release that contains only the Browser SDK. This test fails without package-name: "".
    • release-please.spec.ts compares the version and the changelog of a js-core breaking change with the output of release-please.
    • checkReleaseNotes.spec.ts tests the pending-release check with notes that release-please makes. With mocked git commands, it also tests how the check finds the previous release: no tag, an older tag (for example v1.12.2), and a tag after last-release-sha.
  2. Do a dry run on this branch. The dry run uses your gh token and changes nothing:

    node scripts/release/release-please.ts --dry-run --target-branch thomas-lebeau/RUM-19882-adopt-release-please
    
  3. Make sure that the output shows these items:

    • The root uses the browser-sdk type (❯ .: browser-sdk).
    • The proposed release PR is chore(release): v7.19.1.
    • The PR updates the package.json files with the SDK version, CHANGELOG.md and the manifest.

    The output shows no "commit could not be parsed" errors.

You cannot test these items before the merge:

  • Tag creation with the organization ruleset.
  • The GitLab tag pipeline for tags that the API creates.
  • The "Verified" status of the release PR commit.

The fork rehearsal and the first release will test them.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum Salesforce 194.06 KiB 194.06 KiB 0 B 0.00% ✅
Rum 194.04 KiB 194.04 KiB 0 B 0.00% ✅
Rum Salesforce Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Profiler 8.01 KiB 8.01 KiB 0 B 0.00% ✅
Rum Salesforce Recorder 32.80 KiB 32.80 KiB 0 B 0.00% ✅
Rum Recorder 32.80 KiB 32.80 KiB 0 B 0.00% ✅
Logs 60.25 KiB 60.25 KiB 0 B 0.00% ✅
Rum Slim 149.86 KiB 149.86 KiB 0 B 0.00% ✅
Worker 24.23 KiB 24.23 KiB 0 B 0.00% ✅
Rum Shopify 225.58 KiB 225.58 KiB 0 B 0.00% ✅
Rum Shopify Profiler 8.00 KiB 8.00 KiB 0 B 0.00% ✅
Rum Shopify Recorder 4.85 KiB 4.85 KiB 0 B 0.00% ✅

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 77.89% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 7eae34e | Docs | View more details | Give us feedback!

@thomas-lebeau
thomas-lebeau force-pushed the thomas-lebeau/RUM-19882-adopt-release-please branch from 776453c to ecc212c Compare November 19, 2026 14:54
@thomas-lebeau
thomas-lebeau force-pushed the thomas-lebeau/RUM-19882-adopt-release-please branch 2 times, most recently from 55721bc to c7242cb Compare November 20, 2026 19:08
@thomas-lebeau
thomas-lebeau marked this pull request as ready for review November 23, 2026 15:01
@thomas-lebeau
thomas-lebeau requested a review from a team as a code owner November 23, 2026 15:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T16:09:28.960118Z 7eae34e New commits
🔒 Security Review ✅ Completed 2026-11-26T16:11:19.582089Z 7eae34e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

A release merged during job startup can appear in GitHub’s live results before its commit exists in the pipeline checkout, causing the release check to fail an otherwise valid main pipeline.

Open Bits AI session

🤖 Bits Code Review · Commit 7bd3bd2

Comment thread scripts/release/release-please.ts Resolved
Base automatically changed from thomas-lebeau/RUM-19880-conventional-commits-pr-titles to main November 24, 2026 08:02
@thomas-lebeau
thomas-lebeau force-pushed the thomas-lebeau/RUM-19882-adopt-release-please branch from 7bd3bd2 to 88b7df9 Compare November 24, 2026 08:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 88b7df93a4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/checkReleaseNotes.ts Resolved

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

A later main pipeline can tag a release that the pre-tag guard previously rejected. SDK-only releases can also reuse a published js-core artifact containing an older SDK version in intake request metadata.

Open Bits AI session

🤖 Bits Code Review · Commit 88b7df9

Comment thread scripts/lib/checkReleaseNotes.ts Resolved
Comment thread release-please-config.json Resolved
Replace the local release script with release-please. A release PR
(`chore(release): vX.Y.Z`) is kept up to date on every push to main;
merging it tags main (`vX.Y.Z`, `js-core-vX.Y.Z`) and creates draft
GitHub releases, which step-8 publishes after the rollout.

- release-please 17.11.2 (pinned), `release-please-config.json` and
  `.release-please-manifest.json` (baseline v7.17.1 / js-core 0.0.21).
- Root `package-name: ""`: without it, release-please never releases a
  grouped release PR that only contains the Browser SDK (its branch
  component is compared with the root package.json name).
- GitLab `release-please` job running the release-please CLI
  (`github-release`, then `release-pr`) with a dd-octo-sts token. Before
  tagging, `scripts/release/check-release-notes.ts` checks that every
  commit since the previous release is in the merged release PR's notes
  (stale release PR guard).
- The weekly staging bump uses a hidden `staging` type, so it stays out
  of the changelog and doesn't open a release PR on its own.
- CHANGELOG.md header rewritten for release-please; changelogs are
  excluded from prettier (release-please writes `*` bullets).
- Specs: config consistency (extra-files, manifest, changelog sections,
  root-only release) and the pre-tag check.

Refs: RUM-19882

Environment: Datadog workspace

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thomas-lebeau
thomas-lebeau force-pushed the thomas-lebeau/RUM-19882-adopt-release-please branch from 88b7df9 to 1b86a9d Compare November 24, 2026 08:21
Rebasing onto main brought in v7.19.0 (package.json 7.19.0, js-core 0.0.23), but the manifest still had an older baseline, so the "manifest matching the package versions" spec failed in script-tests.

Also point `last-release-sha` at the v7.19.0 release commit (#5315), so
release-please and the pre-tag check start from the last release.
@thomas-lebeau
thomas-lebeau force-pushed the thomas-lebeau/RUM-19882-adopt-release-please branch from 1b86a9d to 1cd0f8e Compare November 24, 2026 08:22

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

A subsequent main pipeline can tag a release rejected by the stale-notes guard. SDK releases without js-core changes also reuse npm artifacts containing an outdated intake version.

Open Bits AI session

🤖 Bits Code Review · Commit 1cd0f8e

Comment thread scripts/lib/checkReleaseNotes.ts Resolved
Comment thread release-please-config.json Resolved
Allow `feat(js-core)!` in PR titles. A custom release type for the root component ignores
breaking changes scoped to js-core alone, so they only bump @datadog/js-core (a minor while
pre-1.0) and don't add a breaking change section to the Browser SDK changelog.

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The PR automates releases with release-please and now isolates js-core-only breaking changes, except padded scopes can trigger an unintended SDK major bump. Neither earlier finding is fixed: later pipelines can bypass rejected release checks, and unchanged js-core npm artifacts retain stale SDK version metadata.

Open Bits AI session

🤖 Bits Code Review · Commit b812d36

Comment thread scripts/release/release-please.ts Resolved
Move the release notes check, the dd-octo-sts token and both release-please commands from the
GitLab job into scripts/release/release-please.ts. Add a --dry-run mode for local checks.

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The PR automates releases with release-please; this commit consolidates CI execution, token cleanup, and dry-run support. None of the three findings is fixed: later pipelines can bypass rejected release checks, unchanged js-core npm artifacts retain stale SDK metadata, and padded js-core scopes can trigger an unintended SDK major bump.

Open Bits AI session

🤖 Bits Code Review · Commit f85432d

Comment thread scripts/release/release-please.ts Resolved
github-release tags every merged release pull request still labeled `autorelease: pending`,
not only the one merged by the current commit. Check all of them, fetching merge commits newer
than the checkout. Also trim the scope before ignoring js-core breaking changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ebdfa619e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/gitUtils.ts Resolved

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The PR automates releases with release-please; pending-release validation and padded-scope handling are now fixed. Two issues remain: the new lookup can revoke its token before PR reads finish, blocking releases, and SDK releases without js-core changes still retain stale intake version metadata.

Open Bits AI session

🤖 Bits Code Review · Commit 5ebdfa6

Comment thread scripts/lib/gitUtils.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0ff3c8a1ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/checkReleaseNotes.ts Resolved
Comment thread .gitlab-ci.yml Resolved
Comment thread scripts/check-pr-title.ts Resolved
Comment thread scripts/lib/checkReleaseNotes.ts Resolved
Comment thread docs/DEVELOPMENT.md Resolved
Comment thread scripts/lib/gitUtils.ts Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 188f0239ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/release/release-please.ts Resolved

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: FAIL

The PR automates releases, with padded-scope and token-lifetime issues fixed; stale js-core metadata is accepted for follow-up RUM-20408 before the first release. A validation race remains: tagging re-queries candidates and can include a release that never passed the notes check.

Open Bits AI session

🤖 Bits Code Review · Commit 188f023

Comment thread scripts/release/release-please.ts Resolved

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bits Code Review: PASS

More details

The PR automates release PRs and tagging with release-please. Release creation now validates the exact candidates it tags, closing the race; padded-scope and token-lifetime fixes hold, while stale js-core metadata remains explicitly deferred to RUM-20408 before the first release.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e1b4aea

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants