Skip to content

Release the stable CLI v1 patch from main - #827

Merged
roncohen merged 3 commits into
mainfrom
ci/release-cli-v1-from-main
Nov 26, 2026
Merged

roncohen merged 3 commits into
mainfrom
ci/release-cli-v1-from-main

Conversation

@roncohen

@roncohen roncohen commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Give stable CLI users the multi-organization fix without moving them to CLI v2. Normal Changesets releases stay in prerelease mode; no changes to the v2 workspace, its lockfile, or its next tag are needed.

  • Keep the @reflag/cli 1.0.5 source in releases/cli-v1/, outside the workspace Changesets publishes. The v1 type generator keeps the existing config.payload shape and valid, non-colliding alias names. It escapes keys, disambiguates colliding aliases, and preserves optional properties when inferring nested arrays. CI builds it with the immutable lockfile from its original main ancestor. It never reads a maintenance branch when preparing the release.
  • Use a repository_dispatch event in the existing trusted publish.yml workflow. The event runs on main and the request must name that exact commit, so a changed branch head fails rather than publishing a different revision. Merging the PR does not trigger a stable publish.
  • The default is build and validation only. An explicit boolean publish: true requires a repository administrator, including on reruns. The publish job rechecks that the artifact is the requested CLI version and is the next stable v1 patch after npm latest. It publishes only that tarball to latest.

This replaces the branch-selectable workflow proposed in #824. #826 has already removed the old publisher from the maintenance branch.

Release and rollback

After both PRs are merged, wait for required checks on the reviewed main revision. Start with a dry run, supplying the full commit SHA from main:

gh api --method POST repos/reflagcom/javascript/dispatches --input - <<'JSON'
{"event_type":"release-cli-v1","client_payload":{"sha":"<reviewed-main-sha>","version":"1.0.5","publish":false}}
JSON

Record the successful dry-run link and approval before an authorized administrator requests publish: true for the same reviewed SHA. Confirm an authorized operator can restore latest to 1.0.4 before publishing. Verify latest is 1.0.5 afterward and next has not changed. If rollback is needed, restore the previous latest tag without touching next; users already pinned to 1.0.5 need the follow-up patch or an explicit pin to 1.0.4.

Verification

  • Built, tested (48 CLI tests), and packed the v1 source with the pinned lockfile. A mock-API CLI smoke test covered v1 type generation and missing app/environment errors.
  • Passed all 23 release tests, lint and format checks, plus workflow checks for SHA mismatch and non-admin dispatch/rerun rejection.
  • The local npm publish dry run accepted the exact 1.0.5 tarball and latest tag. No GitHub release was dispatched; live publishing authorization has not been exercised.

@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: high

1 actionable finding; 2 optional refactor suggestions.

Comment thread releases/cli-v1/utils/json.ts Resolved
Comment thread releases/cli-v1/utils/json.ts Resolved
Comment thread releases/cli-v1/utils/json.ts Resolved
@roncohen
roncohen enabled auto-merge November 26, 2026 09:07

@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: high

2 actionable findings; 1 optional refactor suggestion.

Comment thread releases/cli-v1/utils/gen.ts Resolved
Comment thread releases/cli-v1/utils/json.ts Resolved
Comment thread releases/cli-v1/commands/flags.ts Resolved

@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: high

no actionable findings

1 optional refactor suggestion.

Comment thread releases/cli-v1/stores/auth.ts Resolved
@roncohen
roncohen added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit bf9de7f Nov 26, 2026
9 checks passed
@roncohen
roncohen deleted the ci/release-cli-v1-from-main branch November 26, 2026 10:18
@roncohen

roncohen commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

The CLI v1 CI dry run passed on main at bf9de7f83fe0a29e2f876d828b23cb252cc51f75. CI ran all 48 CLI tests, built and packed @reflag/[email protected], and verified it is the next v1 patch after latest (1.0.4). The publish job was skipped; next is still 2.0.0-next.1.

The live run is pending independent release approval. The person approving the release does not need GitHub admin access; an administrator can dispatch the approved run afterward. If a rollback is needed, an npm maintainer can restore latest to the existing 1.0.4 release without touching next.

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