Skip to content

ci: publish v1 packages under legacy - #836

Open
roncohen wants to merge 1 commit into
maintenance/v1from
ci/v1-legacy-channel
Open

roncohen wants to merge 1 commit into
maintenance/v1from
ci/v1-legacy-channel

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Summary

Move future releases from maintenance/v1 to npm's legacy tag so v1 patches cannot replace the v2 latest channel. Keep the Git branch name and existing versioned-release approvals.

  • Publish Changesets releases with --tag legacy.
  • Validate patches against legacy, falling back to latest only when no legacy baseline exists. A v2 latest cannot authorize a v1 patch.
  • Add a manual, tag-only workflow for the six coordinated SDK/CLI packages. It accepts only already-published pre-v2 workspace versions, leaves latest alone, and refuses to replace a different existing legacy tag.
  • Keep the protected/current-commit check, npm-v1-release environment, V1_PUBLISH_ENABLED gate, and OIDC authentication.

The tag-only workflow needs workflow_dispatch registered on the default branch and Allow npm dist-tag enabled for the matching npm trusted publishers. It runs with:

gh workflow run publish.yml --repo reflagcom/javascript --ref maintenance/v1

Seed the legacy tags before publishing SDK v2 to latest. This PR does not publish packages or change tags when merged; the tag migration is manual.

Validation

  • All 12 release safeguard tests passed, including v2 latest isolation, patch sequencing, tag idempotency, invalid/unpublished targets, and existing-tag preservation.
  • Read-only npm checks confirmed the six tag targets exist and there are no unpublished approved v1 packages.
  • Immutable install, workflow YAML parsing, scoped lint, formatting, whitespace checks, and normal commit hooks passed.
  • No npm publish or tag mutation was performed. Package runtime code is unchanged.

@roncohen
roncohen enabled auto-merge (squash) November 27, 2026 14:01
@roncohen
roncohen disabled auto-merge November 27, 2026 14:01
@roncohen
roncohen enabled auto-merge (squash) November 27, 2026 14:02

@reflag-review reflag-review 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.

Risk: medium

1 actionable finding.

head=$(git ls-remote --exit-code origin refs/heads/maintenance/v1 | cut -f1)
test "$GITHUB_REF_PROTECTED" = true && test "$head" = "$GITHUB_SHA"
- name: Add legacy tags without changing latest
run: node scripts/v1-release.mjs tag-legacy

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P2] Provide npm authentication for legacy dist-tag updates

When any legacy tag is missing, this step invokes npm dist-tag add, but the job supplies no npm credential. id-token: write enables trusted publishing for npm publish; it does not authenticate standalone dist-tag mutations, and setup-node only configures the registry/token reference rather than supplying a token. Consequently, the manual seeding job fails on its first required update instead of preserving the v1 tags. Supply an appropriately scoped npm write token through NODE_AUTH_TOKEN for this protected step, or use another supported authenticated mechanism for dist-tag updates.

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.

1 participant