Repository navigation
ci(release): Adopt release-please - #5263
thomas-lebeau wants to merge 13 commits into
Conversation
Bundles Sizes Evolution
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 7eae34e | Docs | View more details | Give us feedback! |
776453c to
ecc212c
Compare
55721bc to
c7242cb
Compare
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit 7bd3bd2
7bd3bd2 to
88b7df9
Compare
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit 88b7df9
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>
88b7df9 to
1b86a9d
Compare
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.
1b86a9d to
1cd0f8e
Compare
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit 1cd0f8e
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.
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit b812d36
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.
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit f85432d
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.
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit 5ebdfa6
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit 188f023
There was a problem hiding this comment.
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.
🤖 Bits Code Review · Commit e1b4aea
Motivation
This PR is the third step of the release-please adoption (RFC). It replaces the local
yarn releasescript 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.jsonpinsrelease-please17.11.2 as a devDependency.release-please-config.jsoncontains the configuration..release-please-manifest.jsoncontains the released versions.last-release-shais the v7.19.0 release commit on main.chore(release): vX.Y.Z, contains all the packages. js-core is a separate component with 0.x versions.force-tag-creationmakes it create the tags.extra-fileslists everypackage.jsonthat 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.jsonname,browser-sdk. ThusbuildReleasereturns nothing (strategies/base.js). Theautorelease: pendinglabel 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:
browser-sdkrelease type (see "How release-please calculates the next version").self.gitlab.release-please).usingrevokes the token at the end, also when an error occurs.ManifestAPI of release-please.buildReleases()gives the releases that release-please will tag.createReleases()tags the merged release PR.createPullRequests()opens or updates the next release PR. These are the same steps as the CLI commandsgithub-releaseandrelease-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 yourghtoken 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:
buildReleases(). These are the merged release PRs that still have theautorelease: pendinglabel: 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.vX.Y.Ztag on main. Before the first release-please release, it islast-release-sha.feat,fix, the "Internal Changes" types). It ignores hidden types, for examplestaging.GitLab
release-pleasejobnode scripts/release/release-please.ts..main). It also runs on release commits, which.mainskips.resource_group. Thus, only one release job runs at a time.allow_failure: true. Thus, a failure (for example, of the pending-release check) does not stop the canary deploy.GIT_DEPTH: 0, because the pending-release check needs the full history.Other changes
!on package scopes, also onfeat(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(ci): ….stagingis 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 rejectstaging..prettierignorenow contains**/CHANGELOG.md, because release-please writes*bullets.How release-please calculates the next version
The release PR has two components:
.) contains all the SDK packages and the extension. It gets every commit.packages/js-coregets 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.
fix(rum): …feat(rum): …featgives a minor version.feat(js-core): …bump-patch-for-minor-pre-majorapplies.feat(js-core)!: …bump-minor-pre-majorapplies. The root ignores the break.feat(core,js-core)!: …chore(deps): …staging(ci): …stagingis 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 overridespostProcessCommits. This function supplies the commits to the version calculation and to the changelog.!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 acceptsfeat( js-core )!.release-asin the configuration.Release-As: x.y.zin 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
dd-evp-origin-versionwhen 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.BrowserSdkStrategyimports the Node strategy from inside release-please. This strategy is not public API, and no public procedure extends a built-in release type.package.jsonpins release-please. If an upgrade breaks the import, the specs fail.Test instructions
Run
yarn test:script. These specs apply to this PR:release-please-config.spec.tsmakes sure thatextra-filescontains everypackage.jsonwith the SDK version, and the manifest. It makes sure that the changelog sections are the same as inconventionalCommits.ts. It also tests a release that contains only the Browser SDK. This test fails withoutpackage-name: "".release-please.spec.tscompares the version and the changelog of a js-core breaking change with the output of release-please.checkReleaseNotes.spec.tstests 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 examplev1.12.2), and a tag afterlast-release-sha.Do a dry run on this branch. The dry run uses your
ghtoken and changes nothing:Make sure that the output shows these items:
browser-sdktype (❯ .: browser-sdk).chore(release): v7.19.1.package.jsonfiles 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:
The fork rehearsal and the first release will test them.
Checklist