Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflow-templates/fe/fe-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Replaces the old two-file release (this file as tagger + fe-tag-pushed.yml / on_tag_pushed.yaml / tag_pushed.yml).
# Delete BOTH old caller files in the same commit that adds this one: the release flow still pushes
# the tag with the PAT, so a tag-push workflow left in the tree would publish that tag again (and
# release manually pushed tags). The release flow's guard job fails while an old caller exists.
# PFM-ISSUE-34282 (pushing the tag with GITHUB_TOKEN) removes the tag-push trigger for good.
# Delete BOTH old caller files in the same commit that adds this one: a tag-push workflow left in the tree
# would release manually pushed version/* tags, and an old fe-tag.yml caller would tag in parallel. The
# release flow's guard job fails while an old caller exists. The flow pushes its tag with GITHUB_TOKEN,
# which starts no workflow.
name: 'Frontend Release CI'
on:
push:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/fe-release-flow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ on:
required: true
DOT_NPMRC:
required: true
GIT_USER_TOKEN:
required: true
GIT_USER:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about GIT_USER and GIT_USER_EMAIL? Can we use GITHUB_TOKEN there as well? Or this is separate issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That is a separate issue, to clean up those secrets.

required: true
GIT_USER_EMAIL:
Expand Down Expand Up @@ -56,9 +54,9 @@ jobs:
sparse-checkout: .github/workflows
persist-credentials: false

# an old tag-push caller would publish manually pushed tags and fail on the tags of this flow;
# an old fe-tag.yml caller (branch push) would tag in parallel. Any trigger counts, comment
# lines do not (a commented-out caller is not active).
# an old tag-push caller would publish manually pushed version/* tags; an old fe-tag.yml caller
# (branch push) would tag in parallel with the PAT. Any trigger counts, comment lines do not
# (a commented-out caller is not active).
- name: Check for old release callers
run: |
old=$(grep -lE '^[^#]*github-actions/\.github/workflows/(fe-release|fe-tag)\.yml@' .github/workflows/*.y*ml 2> /dev/null || true)
Expand Down Expand Up @@ -108,7 +106,7 @@ jobs:
&& (github.event_name == 'push' || inputs.FORCE)
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
outputs:
tag: ${{ steps.release.outputs.tag }}
previous_tag: ${{ steps.release.outputs.previous_tag }}
Expand All @@ -118,7 +116,6 @@ jobs:
with:
ref: ''
fetch-depth: 0
token: ${{ secrets.GIT_USER_TOKEN }}

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
Expand Down
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ Migrate a branch of a consumer repo in **one commit**:
- Set `RUN_E2E: false` only for repos that do not run e2e before a release.
2. **Delete the old release callers**: `fe-release.yml` as tagger, plus `fe-tag-pushed.yml` /
`on_tag_pushed.yaml` / `tag_pushed.yml`.
- The release flow still pushes the tag with the PAT, so a tag-push workflow left in the tree
would try to publish that tag again, and would release manually pushed tags.
- The release flow pushes its tag with `GITHUB_TOKEN`, which starts no workflow. A tag-push
workflow left in the tree would still release manually pushed `version/*` tags, and an old
`fe-tag.yml` caller would tag in parallel.
- The `guard` job fails while any workflow of the branch still calls `workflows/fe-release.yml` or
`workflows/fe-tag.yml`.
- PFM-ISSUE-34282 (pushing the tag with `GITHUB_TOKEN`, which triggers no workflows) removes the
tag-push trigger for good.
3. **Update the PR and main callers.** `fe-install-deps.yml` no longer cancels superseded runs;
each caller decides that itself now (see Concurrency).
- `fe-pr.yml`: add the `concurrency` block of the template, so a new push to the PR cancels the
Expand Down Expand Up @@ -84,8 +83,19 @@ run ends green with the warning "FORCE is ignored".
### Required secrets

Passed with `secrets: inherit`: `JFROG_BASE64_TOKEN`, `JFROG_URL`, `JFROG_USER`, `DOT_NPMRC`,
`GIT_USER_TOKEN`, `GIT_USER`, `GIT_USER_EMAIL`, and optionally `PERCY_TOKEN`. The caller needs
`permissions: contents: write`.
`GIT_USER`, `GIT_USER_EMAIL`, and optionally `PERCY_TOKEN`. The caller needs
`permissions: contents: write`; the flow grants it only to the `release` and `github-release` jobs.

The tag is pushed with `GITHUB_TOKEN`; the flow does not use `GIT_USER_TOKEN`. The deprecated
`fe-tag.yml` and `workflows/fe-release.yml` still need it: remove it from a repo only once none of
its branches calls them.

### Tag rulesets

The tag is pushed as GitHub Actions (`GITHUB_TOKEN`), after publish and promote. A ruleset that
restricts `version/*` tags must list GitHub Actions as a bypass actor. Otherwise the push is
rejected, the cleanup unpublishes the version, and the promoted packages lose `release-X.Y` (see
"Promote or tag push failed" under Recovery).

### Recovery

Expand Down Expand Up @@ -143,5 +153,5 @@ publish distinct snapshot versions; the `snapshot` dist-tag ends up on the run t

### GitHub release

Created with `GITHUB_TOKEN`. The generated notes start at the previous tag of the same release line,
Created with `GITHUB_TOKEN`, like the tag. The generated notes start at the previous tag of the same release line,
and "Latest" is set only for the highest `version/*` tag.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ Major trade-offs we're accepting:
6. Normalizing caller filenames means the Actions run history starts fresh in repos that don't use template names (cplace-fe, office-reports, workflow-fe, loomeo, legacy-fe-assets, frontend-applications).

What we're NOT doing (out of scope):
- A `version/*` tag ruleset or a tag-triggered recovery path (Q10, deferred).
- A `version/*` tag ruleset or a tag-triggered recovery path (Q10, deferred). Since PFM-ISSUE-34282 the
tag is pushed with `GITHUB_TOKEN`: such a ruleset must list GitHub Actions as a bypass actor, otherwise
the push is rejected after publish and promote.
- Fixing the branch-off-day `.1` collision (Q9, deferred).
- Skip-if-exists / resumable publish (rejected in research Q4).
- Pushing the tag with `GITHUB_TOKEN` (PFM-ISSUE-34282) or enabling immutable releases (PFM-ISSUE-34284).
Expand Down
Loading