Skip to content

Release the SDKs that depend on the ones selected - #181

Open
brionmario wants to merge 1 commit into
thunder-id:mainfrom
brionmario:release-dependents
Open

brionmario wants to merge 1 commit into
thunder-id:mainfrom
brionmario:release-dependents

Conversation

@brionmario

Copy link
Copy Markdown
Member

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 browser also needs react, vue, nuxt, nextjs, react-router and tanstack-router released, and forgetting one leaves a published SDK behind. The graph was also written out by hand as level jobs with needs: chains in release.yml, so it could drift from the real package.json dependencies.

With this change you tick only the SDKs you changed, and the workflow adds the SDKs that depend on them.

Approach

  • scripts/release-plan.js reads the graph from the published packages' package.json files (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:

    SDK Bump Why
    @thunderid/browser minor selected
    @thunderid/react patch depends on @thunderid/browser
    @thunderid/nuxt patch depends on @thunderid/browser, @thunderid/vue
    …

    Selected 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 one plan job (which also guards against an unconfirmed major, as validate did) and one release job, which:

    1. Bumps every SDK in the plan before building, so workspace:^ ranges resolve to the versions released together. I checked this locally: after the bump, the packed react@1.22.2 depends on @thunderid/browser ^1.21.0. Each bump passes --no-git-checks, because pnpm 11 refuses pnpm version once the first bump has dirtied the tree.
    2. Makes one release commit, keeps the rebase-retry push, and tags each SDK as before (sdk/<sdk>/v<version>).
    3. Publishes in dependency order with --provenance, as before.
    4. Creates a GitHub release per SDK with the same titles. For an SDK that the plan added, the release notes say which released SDK pulled it in.
  • The inputs are unchanged, apart from the bump_type description. The E2E gate, OIDC permissions, tag format and release-maintenance.yml are untouched.

  • release.yml goes from 852 lines to about 260.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified: ran the plan script for several selections (browser, javascript + better-auth, node, react-router, an unknown SDK, no selection), dry-ran the job's jq and shell steps against a generated plan, and packed a bumped react to check the published dependency range.
  • Documentation provided: the workflow header and the script explain the behaviour.
  • Tests provided.
  • Breaking changes.
  • Cross-SDK parity: release tooling only, so no SDK change to port (parity/prs-not-needed).

Security checks

  • Followed secure coding standards. Workflow inputs reach the scripts through env, not inline ${{ }} interpolation.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

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>
@brionmario brionmario added the parity/prs-not-needed Nothing here reaches another SDK label Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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

Labels

parity/prs-not-needed Nothing here reaches another SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant