Skip to content

feat(npm): opt-in publishing of chosen scopes to npm.platforma.bio - #253

Merged
mike-ainsel merged 6 commits into
v4-betafrom
draft/own-registry-scope
Nov 20, 2026
Merged

mike-ainsel merged 6 commits into
v4-betafrom
draft/own-registry-scope

Conversation

@mike-ainsel

@mike-ainsel mike-ainsel commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Draft: do not merge yet. The registry side is live (infrastructure#669, image 1.2.3). An end-to-end test with this branch passed on prod on 2026-11-20: a test repository published existing and new @platforma-open packages to npm.platforma.bio, and a package owned by another repository was refused with a readable reason. Merging waits for the rollout decision.

What it does

Lets a repo publish packages of chosen npm scopes to npm.platforma.bio instead of npmjs, with no token in the repo. The upload authenticates with the job's GitHub OIDC token.

Opt-in per repo. Nothing changes unless a repo sets the new input:

uses: milaboratory/github-ci/.github/workflows/node-simple-pnpm.yaml@v4
with:
  npm-own-registry-scopes: '@platforma-open'

Decisions

  • Fully gated on the opt-in input: no change for any repository that does not set it.

    • The npm-publish environment step runs only when the input is set.
    • environment: '' means "no environment"; verified on GitHub: no environment is created and no deployment is recorded.
    • The OIDC upload path runs only for packages that resolve to npm.platforma.bio.
    • E409 counts as "already published" only on our registry. On npmjs a 409 still fails the release, as before.
    • The SDK monorepo uses pack-unpublished and publish-tarballs directly. For it, the only change is in publish.ts, and that change is inert for npmjs uploads (tested).
  • Input npm-own-registry-scopes (default empty). It is passed to prepare-pnpm (own-registry-scopes), which writes @<scope>:registry=https://npm.platforma.bio/ into the job's .npmrc. Installs and publishes of that scope go to our registry; everything else (the SDK included) stays on npmjs. The action own-registry-scopes has no default scope, so a missing value fails loudly.

  • One OIDC token per upload (audience https://npm.platforma.bio). It is minted right before each npm publish and put only into that upload's environment, because tokens live only minutes and a release can upload many tarballs.

  • The npm-publish environment is used only when something goes to our registry. That is where the registry's allow rules look (environment:npm-publish in the OIDC subject). Repos that publish only to npmjs behave as before.

  • No retry for new packages. The registry decides the owner at publish time (first publish, npm provenance, admin pins; verdaccio-oidc-auth#9), so there is nothing to wait for.

  • npm does not see GitHub's OIDC variables on uploads to our registry. npm 11 otherwise tries its own trusted-publishing exchange first, and the registry logs a refused token before every upload (seen in the end-to-end test). Unit-tested; not yet run on prod.

  • Scopes are accepted with or without @ ('@platforma-open' or 'platforma-open').

  • E409 (version already there) counts as published. This makes a re-run of a half-finished release safe.

  • The existing step that maps @milaboratories-poc to npm.platforma.bio is kept unchanged.

Key files to review

  1. actions/node/npm-split-publish/src/publish.ts: per-upload token.
  2. .github/workflows/node-simple-pnpm.yaml: the new input, the 3 prepare-pnpm call sites, and the conditional environment.
  3. actions/node/prepare-pnpm/action.yaml, actions/node/own-registry-scopes/action.yaml: the scope mapping.
  4. actions/node/npm-split-publish/test/publish.test.ts: 119 tests pass.

Related drafts: infrastructure#669 (registry rules, owner pins) and verdaccio-oidc-auth#9 (owner check).

…ub OIDC (draft)

- publish-tarballs: npm.platforma.bio is a supported registry; each upload
  there gets a fresh GitHub OIDC token (audience https://npm.platforma.bio)
  through its own env; Verdaccio's E409 duplicate counts as published.
- own-registry-scopes: maps our own-registry scopes to npm.platforma.bio in
  the workspace .npmrc (prepare, prepare-pnpm), so no repo lists it.
- node-simple-pnpm: the upload job runs in the npm-publish environment only
  when something goes to npm.platforma.bio.

The scope name is a placeholder (scope-tbd) until it is decided.
@mike-ainsel
mike-ainsel force-pushed the draft/own-registry-scope branch from 2b9a2a9 to 9731da6 Compare November 20, 2026 12:08
@mike-ainsel mike-ainsel changed the title feat(npm): publish own-registry scopes to npm.platforma.bio with GitHub OIDC (draft) feat(npm): opt-in publishing of chosen scopes to npm.platforma.bio (draft) Nov 20, 2026
@mike-ainsel
mike-ainsel marked this pull request as ready for review November 20, 2026 14:42
@mike-ainsel mike-ainsel changed the title feat(npm): opt-in publishing of chosen scopes to npm.platforma.bio (draft) feat(npm): opt-in publishing of chosen scopes to npm.platforma.bio Nov 20, 2026
@greptile-apps

greptile-apps Bot commented Nov 20, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

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.

1 participant