Skip to content

build(Felt): migrate promote to Nx and remove Lerna - #12708

Merged
gabipodolnikova merged 4 commits into
patternfly:felt-v1from
gabipodolnikova:FELT-144-nx-promote
Nov 4, 2026
Merged

gabipodolnikova merged 4 commits into
patternfly:felt-v1from
gabipodolnikova:FELT-144-nx-promote

Conversation

@gabipodolnikova

Copy link
Copy Markdown
Contributor

What: Migrates the Promote workflow from Lerna to Nx, prepares stable graduation, and removes Lerna entirely, completing the release migration for FELT-144.

Implementation

  • Add --ci-promote to scripts/nx-release.mjs: starts the next prerelease cycle for every public package using Nx's native preminor specifier with the prerelease preid — Lerna-compatible 0.0.1-prerelease.7 → 0.1.0-prerelease.0. It commits, tags, and pushes, but never packs or publishes.
  • Disable Nx's default 0.x bump adjustment (adjustSemverBumpsForZeroMajorVersion: false) so preminor follows raw semver, matching Lerna. The prerelease counter flow is unaffected.
  • Add --ci-graduate --version=X.Y.Z: applies one explicitly chosen stable version to every public package, commits and pushes, and packs a release bundle recorded with npm's latest dist-tag. The version is always chosen by the promoter; prerelease suffixes are never auto-stripped.
  • Restructure promote.yml with the same least-privilege split as the release workflow: a prepare job (contents: write, no OIDC token) and a publish job (id-token: write, contents: read) that publishes the prepared bundle through existing OIDC trusted publishing. --publish-only reads the dist-tag from the bundle, so prereleases and graduations share one publishing code path.
  • Support manual publication recovery through publish-only-run-id, mirroring the release workflow, including stale-release rejection.
  • Remove all npm-token authentication; publishing happens only through OIDC.
  • Remove Lerna: delete lerna.json, drop the dependency (removing its bundled Nx 22 and ~3,200 lockfile lines), rename the root workspace to @rh-felt/react-root, and update contribution docs.

How to promote

Promote is manual (workflow_dispatch) and replaces Lerna's process of hand-editing promote.sh to switch between stable publication and cycle preparation.

  • Start the next prerelease cycle: run Promote with mode: cycle (the default). Every public package bumps to the next minor's first prerelease (0.1.0-prerelease.0); the release commit and tags are pushed. Nothing is published — subsequent merges publish the cycle's versions through the normal release workflow.
  • Cut a stable release: run Promote with mode: graduate and version: X.Y.Z (for example 0.1.0). All public packages are versioned, tagged, and published under npm's latest dist-tag through OIDC trusted publishing, with a 30-day recovery artifact retained. Afterwards, run Promote with mode: cycle to start the next prerelease cycle.
  • Recover a failed graduation: re-run Promote with publish-only-run-id set to the failed run's ID. It republishes the exact original bundle after the recorded source commit and refuses releases older than the latest recorded release.
  • An accidental dispatch can only start a cycle: mode defaults to cycle, and publishing requires deliberately selecting graduate and entering a version.

Before the first graduation: npm trusted publishers must additionally authorize promote.yml for each public package (organization patternfly, repository patternfly-react, workflow promote.yml), configured close to the release date — npm removes new trusted-publisher entries that do not publish within two days. The existing release.yml entries do not cover this workflow.

Testing

  • 35 release tests, covering cycle selection and version options, graduation version application and latest dist-tag packing, dry-run behavior for both modes, publish dist-tag routing, and recovery validation.
  • Real Nx dry runs: cycle resolves all ten packages to 0.1.0-prerelease.0; graduate resolves all ten to the chosen 0.1.0; neither writes, commits, tags, pushes, or publishes.
  • Immutable installation, unit-test suite entry, Prettier, ESLint, shell syntax, and actionlint checks passed.
  • The prerelease counter flow is unchanged: a normal release dry run after these changes still selects and increments correctly.

The graduate path's first real OIDC publication can only be verified at the first actual stable cut; it is prepared and mock/dry-run verified here.

Additional issues: Configure the promote.yml npm trusted-publisher entries before the first stable release. The optional patternfly-version dependency-update step remains commented out, as under Lerna.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd5df9e3-9a0e-4e9b-bcfe-5d5e9bf4d836

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@gabipodolnikova
gabipodolnikova merged commit 92dbcde into patternfly:felt-v1 Nov 4, 2026
15 checks passed
@patternfly-build

Copy link
Copy Markdown
Collaborator

Your changes have been released in: a617036

@rh-felt/react-charts@0.0.1-prerelease.8, @rh-felt/react-code-editor@0.0.1-prerelease.8, @rh-felt/react-core@0.0.1-prerelease.8, @rh-felt/react-docs@0.0.1-prerelease.6, @rh-felt/react-drag-drop@0.0.1-prerelease.8, @rh-felt/react-icons@0.0.1-prerelease.6, @rh-felt/react-styles@0.0.1-prerelease.6, @rh-felt/react-table@0.0.1-prerelease.8, @rh-felt/react-templates@0.0.1-prerelease.8, @rh-felt/react-tokens@0.0.1-prerelease.6

Thanks for your contribution! 🎉

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.

3 participants