Skip to content

Force dry-run for staging branches (never release from *-staging)#2100

Closed
cipolleschi wants to merge 3 commits into
260318099.0.0-stagingfrom
staging-no-release-like-static_h
Closed

Force dry-run for staging branches (never release from *-staging)#2100
cipolleschi wants to merge 3 commits into
260318099.0.0-stagingfrom
staging-no-release-like-static_h

Conversation

@cipolleschi

@cipolleschi cipolleschi commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

We must never release Hermes from a staging branch. This mirrors the static_h non-releasing setup in rn-build-hermes.yml, and generalizes it to all staging branches.

  1. Force dry-run guard (generalized). set_release_type now forces RELEASE_TYPE=dry-run for static_h and any branch whose name ends in -staging, regardless of event type. Previously only static_h was guarded, so a manual workflow_dispatch with release-type: release on a staging branch would have produced a real release. The glob (refs/heads/*-staging) means future staging branches are covered automatically — important because workflow_dispatch has no branch filter and can be run on any branch.

    if [[ $REF == "refs/heads/static_h" || $REF == refs/heads/*-staging ]]; then
      # forced dry-run
  2. Run CI on the branch. Added 260318099.0.0-staging to the push and pull_request allowlists so the RN build runs on the branch and its PRs (matching how static_h runs on itself).

Behavior after this change

Ref Guarded → dry-run?
refs/heads/static_h yes
refs/heads/260318099.0.0-staging yes
refs/heads/<anything>-staging yes
refs/heads/260318099.0.0-stable no (release branches can still release)
refs/pull/*/merge (PRs) dry-run via existing else branch

Test Plan

  • Verified the glob matches static_h + *-staging and does not match *-stable.
  • CI on this PR triggers "RN Build Static Hermes" with set_release_type reporting dry-run.

Note

The push/pull_request branch allowlists still list the staging branch explicitly. Converting those to globs ('*-staging') is a possible follow-up; left out here to keep the diff focused on the release-safety guard.

We must never release from the staging branch. Mirror the static_h setup:

- Add the staging branch to the force-dry-run guard in set_release_type so
  RELEASE_TYPE is always dry-run, even for a manual workflow_dispatch that
  requests 'release'. Previously only static_h was guarded, so a dispatch on
  staging could have produced a real release.
- Add the staging branch to the push and pull_request triggers so the RN
  build actually runs (and is verified) on the branch and its PRs.
@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 7, 2026
Generalize the release guard so any *-staging branch (not just
260318099.0.0-staging) is always built in dry-run mode, including via
workflow_dispatch. Release branches (*-stable) are unaffected.
@cipolleschi cipolleschi changed the title Treat 260318099.0.0-staging as a non-releasing branch like static_h Force dry-run for staging branches (never release from *-staging) Jul 7, 2026
meta-codesync Bot pushed a commit that referenced this pull request Jul 7, 2026
…o 260318099.0.0 (#2101)

Summary:
Makes `static_h` the source of truth for the RN build's branch handling, so branches cut for **future release trains** (e.g. `26xxxx.*`, `27xxxx.*`) inherit the correct behavior automatically — no per-branch edits to `rn-build-hermes.yml`. Also advances the package version to the next train.

This is the generic form of what #2100 did for `260318099.0.0-staging`.

### 1. Triggers → globs
`push` and `pull_request` now match `static_h`, `'*-stable'`, and `'*-staging'` instead of listing individual branches. Any future stable/staging branch runs the RN build (and is verified on its PRs) out of the box. `250829098.0.0-stable` is now covered by `'*-stable'`.

### 2. Dry-run guard → generalized
`set_release_type` forces `RELEASE_TYPE=dry-run` for `static_h` **and any branch whose name ends in `-staging`**, regardless of event — including `workflow_dispatch`, which has no branch filter and could otherwise be used to cut a real release from a staging branch.

```bash
if [[ $REF == "refs/heads/static_h" || $REF == refs/heads/*-staging ]]; then
  # forced dry-run
```

### 3. Bump version
`npm/hermes-compiler/package.json` bumped from `250829098.0.0` to `260318099.0.0` (the next release train's version).

## Behavior

| Ref | Runs RN build | Release allowed? |
|---|---|---|
| `static_h` | yes | no (forced dry-run) |
| `*-staging` (any) | yes | no (forced dry-run, even via dispatch) |
| `*-stable` (any) | yes | yes, via `workflow_dispatch` with `release` |
| PRs targeting the above | yes | dry-run |

Note: pushing to a `*-stable` branch is dry-run (falls through to the `else`); an actual release still only happens via a manual `workflow_dispatch` selecting `release` on a stable branch — unchanged from today.

Pull Request resolved: #2101

Test Plan:
- Verified the guard forces dry-run for `static_h` + `*-staging` and leaves `*-stable` releasable.
- Verified the trigger globs parse to `[static_h, *-stable, *-staging]` for both `push` and `pull_request`.
- Verified `package.json` is valid and version is `260318099.0.0`.
- CI on this PR should trigger "RN Build Static Hermes" in dry-run.

Reviewed By: cortinico, praneethy9

Differential Revision: D110871622

Pulled By: cipolleschi

fbshipit-source-id: 5cbe89164b9f4e17e36d2bfef542ad084a52e275
@cipolleschi cipolleschi closed this Jul 7, 2026
@cipolleschi cipolleschi reopened this Jul 7, 2026
@cipolleschi cipolleschi closed this Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant