Repository navigation
Release the SDKs that depend on the ones selected - #181
Open
brionmario wants to merge 1 commit into
Open
brionmario wants to merge 1 commit into
brionmario wants to merge 1 commit into
Conversation
Releasing meant ticking every SDK that needed to go out, which meant knowing the dependency graph: a change to browser also has to release react, vue, nuxt, nextjs and the routers. The graph was also written out by hand as level jobs in the workflow. Now the person releasing ticks only the SDKs they changed. A plan job reads the graph from the packages' package.json files (scripts/release-plan.js), adds every SDK that depends on a selected one, orders them so dependencies come first, and writes the plan to the job summary. Selected SDKs take the requested bump; added dependents take a patch. A single job then bumps every SDK in the plan before building, so workspace ranges resolve to the versions released together, makes one release commit, tags each SDK as before (sdk/<sdk>/v<version>), publishes in dependency order and creates the GitHub releases. A dependent's release notes say which released SDK pulled it in. Signed-off-by: Brion <info@brionmario.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Releasing the SDKs meant ticking every SDK that had to go out, so whoever released had to know the dependency graph. A change to
browseralso needsreact,vue,nuxt,nextjs,react-routerandtanstack-routerreleased, and forgetting one leaves a published SDK behind. The graph was also written out by hand as level jobs withneeds:chains inrelease.yml, so it could drift from the realpackage.jsondependencies.With this change you tick only the SDKs you changed, and the workflow adds the SDKs that depend on them.
Approach
scripts/release-plan.jsreads the graph from the published packages'package.jsonfiles (all dependency fields). It adds every SDK that depends on a selected one, directly or transitively, and orders the list so dependencies come first. It writes the plan to the job summary, for example:@thunderid/browser@thunderid/react@thunderid/browser@thunderid/nuxt@thunderid/browser,@thunderid/vueSelected SDKs take
bump_type; the dependents it adds take a patch. Selecting nothing or an unknown SDK fails the plan.release.yml: the per-SDK level jobs are replaced by oneplanjob (which also guards against an unconfirmed major, asvalidatedid) and onereleasejob, which:workspace:^ranges resolve to the versions released together. I checked this locally: after the bump, the packedreact@1.22.2depends on@thunderid/browser ^1.21.0. Each bump passes--no-git-checks, because pnpm 11 refusespnpm versiononce the first bump has dirtied the tree.sdk/<sdk>/v<version>).--provenance, as before.The inputs are unchanged, apart from the
bump_typedescription. The E2E gate, OIDC permissions, tag format andrelease-maintenance.ymlare untouched.release.ymlgoes from 852 lines to about 260.Related Issues
Related PRs
Checklist
browser,javascript+better-auth,node,react-router, an unknown SDK, no selection), dry-ran the job'sjqand shell steps against a generated plan, and packed a bumpedreactto check the published dependency range.parity/prs-not-needed).Security checks
env, not inline${{ }}interpolation.