Skip to content

Prepare repeatable CLI v1 releases from the maintenance branch - #828

Merged
roncohen merged 2 commits into
maintenance/cli-v1from
ci/cli-v1-branch-publishing
Nov 27, 2026
Merged

roncohen merged 2 commits into
maintenance/cli-v1from
ci/cli-v1-branch-publishing

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

What changes

Give stable CLI users a way to receive follow-up v1 patches without moving to CLI v2. The release workflow builds from maintenance/cli-v1, not a copy of the package on main. It does not change the Changesets workflow or the next tag.

  • Backport the final CLI 1.0.5 fixes from Release the stable CLI v1 patch from main #827. Generated declarations escape unusual keys, preserve optional fields in nested payloads, and avoid duplicate payload type names while keeping the v1 config.payload shape.
  • Use releases/cli-v1.json to name the version in a release PR. The workflow installs from the locked dependencies, tests and packs only @reflag/cli, and validates the tarball against npm latest. Pull requests never publish or receive npm publishing credentials.
  • The live job needs a changed request with publish: true merged to protected maintenance/cli-v1. It rechecks the branch head and that the tarball is exactly the next stable v1 patch before using the cli-v1-release environment and npm trusted publishing. It can only publish to latest.

First release and rollout

This PR requests 1.0.5 in dry-run mode. Merging it will build and validate the package without publishing. Before merging, make sure the branch has the required PR review, test, and security checks. Before enabling live publication:

  1. Verify the dry run on the merged branch and retire the temporary v1 publisher on main.
  2. Restrict the GitHub cli-v1-release environment to maintenance/cli-v1. Configure npm trusted publishing for publish-cli-v1.yml with that environment, leaving the existing v2 publisher in place.
  3. Merge a separate release PR setting publish: true. Verify latest becomes 1.0.5 and next is unchanged. If needed, an npm maintainer can restore latest to 1.0.4 without changing next.

For later patches, update the CLI version and changelog, refresh the lockfile with Yarn, and update the release request in a reviewed PR.

Verification

  • Confirmed the CLI source matches the reviewed 1.0.5 snapshot in Release the stable CLI v1 patch from main #827. Ran all 48 CLI tests, 7 release guard tests, the CLI build, lint, formatting, and actionlint.
  • Tested that the workflow guards reject an unprotected branch, unchanged release request, and stale branch head. npm dry-run accepted the packed @reflag/[email protected]; nothing was published.

@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

@roncohen
roncohen merged commit e5de826 into maintenance/cli-v1 Nov 27, 2026
6 checks passed
@roncohen
roncohen deleted the ci/cli-v1-branch-publishing branch November 27, 2026 08:10
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