From a51b65c955208bac5b357dea87aa6fabc2e3d693 Mon Sep 17 00:00:00 2001 From: Vladimir Arsov Date: Fri, 27 Nov 2026 16:26:54 +0100 Subject: [PATCH 1/2] PFM-ISSUE-33676 - Use the github-actions bot identity in FE upmerge and release flows - fe-check-upmerge.yml / fe-release-flow.yml: set a fixed github-actions[bot] git identity; GIT_USER / GIT_USER_EMAIL become optional and unused. - fe-check-upmerge.yml: drop the undeclared inputs.GHA_REF checkout ref. - upmerge.ts: no longer runs git config from GIT_USER*; new unit test. - Caller template and README no longer require GIT_USER*. - Specs under specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/. Co-Authored-By: Claude Opus 5.5 --- .../fe/fe-check-upmerge.yml | 2 - .github/workflows/fe-check-upmerge.yml | 16 +- .github/workflows/fe-release-flow.yml | 13 +- README.md | 9 +- .../design.md | 288 ++++++++ .../plan.md | 649 ++++++++++++++++++ .../research.md | 216 ++++++ tools/scripts/upmerge/upmerge.test.ts | 24 + tools/scripts/upmerge/upmerge.ts | 10 - 9 files changed, 1201 insertions(+), 26 deletions(-) create mode 100644 specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/design.md create mode 100644 specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md create mode 100644 specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md diff --git a/.github/workflow-templates/fe/fe-check-upmerge.yml b/.github/workflow-templates/fe/fe-check-upmerge.yml index c4e87559..5a594fa5 100644 --- a/.github/workflow-templates/fe/fe-check-upmerge.yml +++ b/.github/workflow-templates/fe/fe-check-upmerge.yml @@ -15,5 +15,3 @@ jobs: uses: collaborationFactory/github-actions/.github/workflows/fe-check-upmerge.yml@master secrets: SLACK_TOKEN_UPMERGE: ${{ secrets.SLACK_TOKEN_UPMERGE }} - GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} - GIT_USER: ${{ secrets.GIT_USER }} diff --git a/.github/workflows/fe-check-upmerge.yml b/.github/workflows/fe-check-upmerge.yml index 94601c6b..e35497a5 100644 --- a/.github/workflows/fe-check-upmerge.yml +++ b/.github/workflows/fe-check-upmerge.yml @@ -5,10 +5,12 @@ on: secrets: SLACK_TOKEN_UPMERGE: required: true + # Unused since PFM-ISSUE-33676 (the git identity is the github-actions bot). Kept optional so + # callers that still pass them keep working; removed by the FE migration/cleanup ticket. GIT_USER_EMAIL: - required: true + required: false GIT_USER: - required: true + required: false jobs: check-upmerge: @@ -17,9 +19,15 @@ jobs: steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: - ref: ${{ inputs.GHA_REF }} fetch-depth: 0 + # cplace-cli makes local merge commits (--no-push), which need an author. --global, as before, + # in case the CLI merges outside the checkout. + - name: Configure git identity + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: node-version: 24.22.1 @@ -35,5 +43,3 @@ jobs: uses: collaborationFactory/github-actions/.github/actions/upmerge@master env: SLACK_TOKEN_UPMERGE: ${{ secrets.SLACK_TOKEN_UPMERGE }} - GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} - GIT_USER: ${{ secrets.GIT_USER }} diff --git a/.github/workflows/fe-release-flow.yml b/.github/workflows/fe-release-flow.yml index a0874870..902630b8 100644 --- a/.github/workflows/fe-release-flow.yml +++ b/.github/workflows/fe-release-flow.yml @@ -21,10 +21,12 @@ on: required: true DOT_NPMRC: required: true + # Unused since PFM-ISSUE-33676 (the git identity is the github-actions bot). Kept optional so + # callers that still pass them keep working; removed by the FE migration/cleanup ticket. GIT_USER: - required: true + required: false GIT_USER_EMAIL: - required: true + required: false PERCY_TOKEN: required: false @@ -138,12 +140,9 @@ jobs: run: npm ci - name: Configure git user - env: - GIT_USER: ${{ secrets.GIT_USER }} - GIT_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }} run: | - git config user.name "$GIT_USER" - git config user.email "$GIT_USER_EMAIL" + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' - name: Publish to Jfrog NPM Registry and Tag id: release diff --git a/README.md b/README.md index 671c78db..15b1dff7 100644 --- a/README.md +++ b/README.md @@ -83,13 +83,18 @@ 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`, `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. +and optionally `PERCY_TOKEN`. The caller needs `permissions: contents: write`; the flow grants it +only to the `release` and `github-release` jobs. The flow sets the `github-actions[bot]` git +identity itself; `GIT_USER` and `GIT_USER_EMAIL` are still accepted but unused. The upmerge check +(`fe-check-upmerge.yml`) needs only `SLACK_TOKEN_UPMERGE`. 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. +A repo can delete `GIT_USER` and `GIT_USER_EMAIL` once no caller passes them explicitly, and +`GIT_USER_TOKEN` once none of its branches calls `fe-tag.yml` or `workflows/fe-release.yml`. + ### Tag rulesets The tag is pushed as GitHub Actions (`GITHUB_TOKEN`), after publish and promote. A ruleset that diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/design.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/design.md new file mode 100644 index 00000000..1e0a059a --- /dev/null +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/design.md @@ -0,0 +1,288 @@ +# Replace shared GitHub user account in frontend workflows (PFM-ISSUE-33676) - Design Approach + +## Overview + +Remove the last places where the shared GitHub user account (`GIT_USER_TOKEN`, `GIT_USER`, `GIT_USER_EMAIL`, actor `squad-fe`) authenticates or identifies FE workflow activity: + +- **In this repo:** the remaining uses are git identity only. They move to a fixed `github-actions[bot]` identity set in the workflow, and the secret declarations become optional. +- **In cplace-fe:** the one remaining real PAT use, the visual-baseline heal push to protected branches, moves to the existing `sva-actions-upmerge` GitHub App. +- **Verification:** the result is checked in `clone-cplace-fe` with the shared-account secrets deleted. + +## Problem Statement + +The FE workflows still depend on a shared GitHub user account. That is a shared credential with rotation, audit and blast-radius risk. PFM-ISSUE-34282, -34283 and -34285 already moved tag creation, GitHub release creation and snapshot checkout to `GITHUB_TOKEN`. What is left: + +- U5: the release-flow git identity +- U6: the upmerge-check git identity +- U9: the README +- uses in consumer repos that the research did not cover + +See [Research](./research.md) for the full inventory. + +### Requirements +- Map every current use of the shared account to its replacement: `GITHUB_TOKEN` with permissions, or a GitHub App (AC1). +- Implement the replacement and verify it in a reference FE repository (AC2). +- Stop using the shared account in that reference repository, including its `GIT_USER*` repo secrets (AC3). + +### Constraints +- **The caller's permissions are a ceiling.** Reusable workflows may only narrow them. +- **Explicit secret passing is strict.** Callers that pass secrets one by one fail when they pass a secret the reusable workflow no longer declares. Four consumer repos pass `GIT_USER*` to `fe-check-upmerge.yml`, and 14 pass them to `fe-tag.yml`. +- **The old and new release flows run side by side.** `fe-tag.yml` needs its PAT so that the tag push triggers the legacy `fe-release.yml`. +- **Neighbouring tickets own adjacent work:** + - Least-privilege caller templates: PFM-ISSUE-35504. + - Consumer migration and deleting `fe-tag.yml`/`fe-release.yml`: the migration/cleanup ticket. + +## Design Decisions Summary + +1. **Bot identity set in the workflow (U5, U6)**: `fe-check-upmerge.yml` and `fe-release-flow.yml` each set `github-actions[bot]` / `41898828+github-actions[bot]@users.noreply.github.com` in a workflow step, with quoted values. + - `upmerge.ts` no longer sets a git identity. Its unquoted `git config --global` calls go away with it. + - U5 belongs to this ticket. It is not related to PFM-ISSUE-34286. +2. **Secret declarations stay, but optional**: `GIT_USER` and `GIT_USER_EMAIL` remain in `workflow_call.secrets` of both workflows. They become `required: false`, are no longer read, and carry a comment marking them for removal in the migration/cleanup ticket. + - The upmerge caller template stops passing `GIT_USER*`. Its `permissions:` stay as they are (PFM-ISSUE-35504). + - README "Required secrets" drops `GIT_USER*`. `GIT_USER_TOKEN` stays documented only as long as a repo still has callers of `fe-tag.yml`/`fe-release.yml`. +3. **Heal-visual-baselines push uses `sva-actions-upmerge` (cplace-fe)**: `heal-visual-baselines.yml` mints a short-lived token with `actions/create-github-app-token`. The token is limited to `cplace-fe` with `contents: write`. It is used for the checkout and the push that today uses `GIT_USER_TOKEN`. + - The App is already a bypass actor on the `product-fe` ruleset (default branch and `release/*`), and its org secrets `SVA_ACTIONS_UPMERGE_ID`/`_KEY` are already visible to cplace-fe. No new App or ruleset is needed. + - The heal commit is authored as `sva-actions-upmerge[bot]` / `278916743+sva-actions-upmerge[bot]@users.noreply.github.com`. The `BOT_EMAIL` env line is dropped, because upmerge commits are written by people and the gate already treats an empty value as "no bot". +4. **Storybook identity (cplace-fe)**: `deploy_storybook.yaml` replaces the hard-coded `git config user.name squad-fe` with the `github-actions[bot]` identity. Its push already uses `GITHUB_TOKEN`. + - The cplace-fe changes (3, 4) are a separate PR on `main` only. Release lines are not changed, following the 34281 decision of 2026-10-22. +5. **Cross-repo checkout (U8) is already done**: the only cross-repo checkout across the 15 FE repos is cplace-fe's devkit e2e (`devkit-test-template.yaml` and its 6 callers). PFM-ISSUE-34281 already moved it to `sva-actions-read-product-fe`. No other repo needs the read App. +6. **Side fixes in the upmerge files**: delete the undeclared `ref: ${{ inputs.GHA_REF }}` from `fe-check-upmerge.yml`. The behavior stays the same: the default branch is checked out. + - `printenv` in `.github/actions/upmerge/action.yml` stays. + - The hard-coded `--release 5.17` stays (out of scope). +7. **Verification in `clone-cplace-fe`**: + - Migrate it to the current caller templates and audit its own workflows for shared-account use. + - Delete its `GIT_USER_TOKEN`, `GIT_USER` and `GIT_USER_EMAIL` repo secrets. + - Run a release (the R6 that 34282 skipped), an upmerge check and a labelled snapshot PR with its comment. All must pass. + - Add the extended U1–U9 usage mapping, including the 15-repo audit, to the spec as the AC1 deliverable. + +This means: +- No reusable workflow in this repo reads a shared-account secret any more. Only the deprecated `fe-tag.yml` still accepts `GIT_USER_TOKEN`. +- Consumers need no change on rollout. Explicit `GIT_USER*` passes keep working, and repos using `secrets: inherit` can delete the secrets at any time. +- In cplace-fe, only the legacy tagger (`push_to_release.yaml` → `fe-tag.yml`) and its `squad-fe` pusher guard still depend on the shared account. Both go away with the migration ticket. +- Every remaining GitHub credential in FE CI is either `GITHUB_TOKEN` or a short-lived token for an App that is scoped to one repo. + +Major trade-offs we're accepting: +1. **Optional but dead secret declarations**: `GIT_USER`/`GIT_USER_EMAIL` stay declared until the cleanup ticket. This avoids breaking callers that pass secrets one by one, at the cost of a leftover interface that looks meaningful but isn't. +2. **The legacy PAT stays in `fe-tag.yml`**: the shared account stays in use org-wide until every repo and release line has migrated. 33676 only proves removal in one reference repo. +3. **Heal commits run under the backend upmerge App's name**: this reuses an App that already has bypass and secrets, so no FE-named App or org-admin change is needed. The cost is less precise attribution in the audit trail. +4. **cplace-fe fixes on `main` only**: older release lines (25.4–26.4) keep the PAT in `heal-visual-baselines.yml` until they reach end of life or are migrated. + +What we're NOT doing (out of scope): +- Deleting `fe-tag.yml` or `workflows/fe-release.yml`, or switching them away from the PAT (migration/cleanup ticket). +- Removing the `GIT_USER*` declarations from `workflow_call.secrets` (migration/cleanup ticket). +- Migrating the 14 consumer repos off `fe-tag.yml`, or removing cplace-fe's `squad-fe` pusher guard (migration/cleanup ticket). +- Narrowing `permissions:` in caller templates, including the upmerge template (PFM-ISSUE-35504). +- Removing `printenv` from the upmerge composite action, or changing `--release 5.17` in `upmerge.ts`. +- Changing cplace-fe release lines, or the JFrog/`.npmrc` service users. +- Setting up any new GitHub App. + +Success criteria: +- `grep` for `GIT_USER` in this repo's `.github/` and `tools/` finds only the optional, unused declarations in `fe-check-upmerge.yml`/`fe-release-flow.yml` and the deprecated `fe-tag.yml`. +- In `clone-cplace-fe`, with `GIT_USER_TOKEN`/`GIT_USER`/`GIT_USER_EMAIL` deleted, all three checks pass: a release (tag + GitHub release), an upmerge check and a snapshot PR comment. +- A cplace-fe heal run pushes a baseline commit to a protected branch as `sva-actions-upmerge[bot]`. A storybook run commits as `github-actions[bot]`. +- The usage mapping lists every use of the shared account across this repo and the 15 FE repos, each with its replacement and owner. + +## Design Decisions - Details + +### Scope split with related tickets + +**Chosen Approach:** 33676 owns U5 (release-flow identity), U6 (upmerge identity), U9 (docs), the two cplace-fe findings, and verification. Template permissions go to 35504. `fe-tag.yml`, its consumers and the removal of the optional declarations go to the migration/cleanup ticket. + +**Rationale:** +- The research had attributed U5 to PFM-ISSUE-34286, but 34286 has no relation to U5. U5 is the same identity-only pattern as U6, so it belongs here. +- Retiring `fe-tag.yml` depends on consumer migration, not on authentication work. + +**Alternatives Considered:** +- **Leave U5 to 34286**: rejected, because 34286 does not cover it. +- **Narrow the upmerge template to `contents: read` here**: rejected, to keep all least-privilege template work together in 35504. +- **Retire `fe-tag.yml` here**: rejected, because 14 repos still call it from their default branch. + +**Implications:** +- The migration/cleanup ticket inherits: + - removing the optional declarations + - deleting `fe-tag.yml`/`fe-release.yml` + - the `squad-fe` pusher guard + - deleting `GIT_USER*` secrets per repo + +--- + +### Git identity for upmerge and release flow + +**Chosen Approach:** each workflow sets a fixed `github-actions[bot]` identity in a step. `upmerge.ts` no longer configures git. + +**Rationale:** +- The release flow creates only a lightweight tag, so its identity is never recorded. +- The upmerge check only makes local merge commits, which are discarded (`--no-push`). +- A fixed identity keeps git working whether or not cplace-cli needs one. That has not been checked in `@cplace/cli`, and it no longer matters for this design. +- Setting the identity in the workflow keeps it in one place, visible in YAML. + +**Alternatives Considered:** +- **Set the identity in `upmerge.ts`**: rejected, because the identity would then live in two different layers (TS for upmerge, YAML for the release flow). +- **Drop the identity entirely**: rejected. Whether the upmerge CLI makes commits is unverified, and a missing identity would make git fail. + +**Implications:** +- The quoting issue in `upmerge.ts` disappears, because the lines are removed. +- The release flow's existing "Configure git user" step is rewritten to fixed values, with no secret env. + +--- + +### Secret declaration phase-out + +**Chosen Approach:** `required: false`, unused, with a comment pointing to the cleanup ticket. The upmerge caller template stops passing `GIT_USER*`. The README drops them from the required secrets. + +**Rationale:** +- cplace-fe, cplace-paw-fe, cplace-office-reports-fe and cplace-workflow-fe pass `GIT_USER*` to `fe-check-upmerge.yml` one by one. Removing the declarations would break their scheduled runs. +- Optional declarations let the reusable workflows change now and leave the consumer updates for later. + +**Alternatives Considered:** +- **Remove the declarations now**: rejected, because it breaks the callers that pass the secrets explicitly. +- **Keep them `required: true` but unused**: rejected. Repos could not delete the secrets, which defeats AC3. + +**Implications:** +- `clone-cplace-fe` can delete its `GIT_USER*` secrets once its callers stop passing them. + +--- + +### Heal-visual-baselines credential (cplace-fe) + +**Chosen Approach:** Option A. Mint a token from the existing `sva-actions-upmerge` App (app id 3487076, `contents: write`, `metadata: read`), limited to `cplace-fe`. Use it for the checkout and push in the `heal` job. Author the commit as the App's bot user. Drop `BOT_EMAIL`. + +**Rationale:** +- The heal job pushes a commit to protected `main`/`release/**`, which requires ruleset bypass. `GITHUB_TOKEN` cannot do that without opening a bypass for every workflow in the repo. +- The App is already a bypass actor on the `product-fe` ruleset, and its secrets are already visible to cplace-fe. +- It follows the backend pattern: an App, not the PAT, for bypass pushes (`SVA_ACTIONS_UPMERGE_*`). +- An App push, like the PAT push, triggers workflows. The `[skip visual-heal]` marker still breaks the loop. +- Recent upmerge commits on `release/26.4` were all written by people. The `byBot` hint in `heal-gate.mjs` therefore never matched, and dropping `BOT_EMAIL` changes nothing. + +**Alternatives Considered:** +- **Extend `sva-actions-write-product-fe` with `contents: write` and bypass**: rejected. It broadens an App that 34281 deliberately kept to Issues, needs org-admin changes, and departs from the backend pattern. +- **`GITHUB_TOKEN` plus GitHub Actions as bypass actor**: rejected. It grants bypass to every workflow, and the healed commit would not trigger CI. +- **Hand the heal and storybook findings to a follow-up ticket (option c)**: recommended, then overturned on user override. The assumption that turned out wrong was that a new bypass-capable App and new ruleset work were needed. The existing `sva-actions-upmerge` App already has bypass and visible secrets. + +**Implications:** +- The cplace-fe PR adds a `create-github-app-token` step pinned to a SHA (v3.3.0, as in the devkit template), with `app-id: SVA_ACTIONS_UPMERGE_ID`. +- Verification needs one real heal run on a protected branch of cplace-fe `main`, or a `workflow_dispatch` with an app selected. + +--- + +### Storybook identity (cplace-fe) + +**Chosen Approach:** replace `git config user.name squad-fe` with `github-actions[bot]` in `deploy_storybook.yaml`. The email is already `github-actions@github.com`; align it to the bot noreply address. + +**Rationale:** the step is identity only, and the push to `gh-pages` already uses `GITHUB_TOKEN`. + +**Alternatives Considered:** +- **Leave it**: rejected, because it is a literal `squad-fe` reference and would fail AC3-style audits. + +**Implications:** none beyond the authorship of `gh-pages` merge commits. + +--- + +### Cross-repo checkout for e2e (U8) + +**Chosen Approach:** no change. Record U8 as done by PFM-ISSUE-34281. + +**Rationale:** the default branches of all 15 FE repos (14 `-fe` repos plus `cplace-e2e`) were audited for `repository:` checkouts, `git clone`, `gh repo clone` and App-token use. The only cross-repo checkout is cplace-fe's devkit e2e, and it already uses `sva-actions-read-product-fe` (Contents/Metadata read, secrets visible only to cplace-fe). + +**Alternatives Considered:** +- **Roll the read App out to more repos**: rejected, because no other repo checks out a second repo. + +**Implications:** the read App's org-secret visibility stays limited to cplace-fe. + +--- + +### Side fixes in the upmerge files + +**Chosen Approach:** +- Delete the undeclared `ref: ${{ inputs.GHA_REF }}`. +- The unquoted `git config` calls are removed along with the identity code. +- Keep `printenv`. +- Keep `--release 5.17`. + +**Rationale:** +- The `ref:` line always resolved to empty, so deleting it changes no behavior and removes a misleading reference. +- `--release 5.17` controls which release lines cplace-cli checks, which has nothing to do with authentication. + +**Alternatives Considered:** +- **Declare a `GHA_REF` input**: rejected, because no caller would use it. +- **Remove `printenv`**: recommended, then overturned on user override. The assumption that turned out wrong was that it is a leftover debug step nobody relies on. The user keeps it. +- **Change `--release 5.17`**: rejected for this ticket, because changing the upmerge scope is out of scope. + +**Implications:** none beyond the identity change. + +--- + +### Reference repository and verification + +**Chosen Approach:** `collaborationFactory/clone-cplace-fe`, the test fork used for 34282 and 34283. + +**Rationale:** +- It is the established test fork with a known live-test protocol (`specs/2026-10-12_PFM-ISSUE-34283_consolidate-fe-release-workflow/clone-cplace-fe-live-tests.md`). +- Deleting its secrets puts no production repo at risk. + +**Alternatives Considered:** +- **`cplace-remote-filesystem-fe` (34287 pilot)**: rejected. It is a production repo and belongs to the rollout ticket. +- **`cplace-fe`**: rejected. Its release lines still need the PAT for `fe-tag.yml`, so the secrets cannot be deleted. + +**Implications:** +- `clone-cplace-fe` must be on the current caller templates (`fe-release.yml` → `fe-release-flow.yml`, `fe-check-upmerge.yml` without `GIT_USER*`) before its secrets are deleted. +- This covers the R6 test that 34282 skipped. + +## Overall Architecture + +No new components. Every GitHub credential in FE CI falls into one of three classes: + +- **`GITHUB_TOKEN` with job-scoped permissions** for same-repo work: checkout, tag push, GitHub release, PR comment, storybook `gh-pages` push. +- **Short-lived App tokens** for what `GITHUB_TOKEN` can't do: + - `sva-actions-read-product-fe` for cross-repo clone (devkit e2e) + - `sva-actions-write-product-fe` for milestones (devkit) + - `sva-actions-upmerge` for bypass pushes to protected branches (heal) +- **A fixed bot identity** (`github-actions[bot]`, or the App's bot user when the App pushes) wherever git needs an author. + +The shared-account secrets remain only as optional, unused declarations and in the deprecated `fe-tag.yml`, until the migration/cleanup ticket. + +### Key Components +1. **`.github/workflows/fe-check-upmerge.yml`**: bot identity step, optional `GIT_USER*`, no `ref:` line. +2. **`tools/scripts/upmerge/upmerge.ts`**: identity configuration removed. +3. **`.github/workflows/fe-release-flow.yml`**: "Configure git user" sets the bot identity, optional `GIT_USER*`. +4. **`.github/workflow-templates/fe/fe-check-upmerge.yml`**: stops passing `GIT_USER*`. +5. **`README.md`**: required-secrets section updated. +6. **cplace-fe `heal-visual-baselines.yml` / `deploy_storybook.yaml`**: App token and bot identity (separate PR). +7. **`specs/.../research.md` mapping**: extended with the 15-repo audit (AC1). + +### Data Flow +- **Upmerge:** checkout (default branch, `GITHUB_TOKEN`) → bot identity → `cplace-cli flow --upmerge --no-push` makes local merges → Slack notification. Nothing is pushed. +- **Release:** unchanged, except that the identity comes from fixed values. +- **Heal:** mint the App token → checkout with it → render, update baselines, commit as the App bot → pull --rebase and push to the protected branch through the ruleset bypass. + +### Integration Points +- Consumer callers that pass `GIT_USER*` explicitly keep working through the optional declarations. +- `product-fe` ruleset bypass list (Integration 3487076) and the org secrets `SVA_ACTIONS_UPMERGE_ID`/`_KEY`. +- `heal-gate.mjs` loop-break (`[skip visual-heal]`) and the subject-based upmerge detection. + +## Known Risks + +1. **`cplace-cli` upmerge behavior with a different identity**: the upmerge check was never live-tested on node24. + - Mitigation: run the upmerge check in `clone-cplace-fe` with the secrets deleted, as part of verification. +2. **The App's bypass entry or secret visibility changes under us**: the `sva-actions-upmerge` setup is owned by the backend, and cplace-fe also has a repo ruleset named "experimental". + - Mitigation: rely on the org `product-fe` ruleset bypass, not the experimental one. Note the dependency in a workflow comment. Verify with a real heal run. +3. **App-token push triggers a cascade of workflows on protected branches**: the PAT push did the same, so nothing new. The heal loop is broken by `[skip visual-heal]`. + - Mitigation: confirm in the heal verification run that the gate skips the heal commit. +4. **Optional declarations are forgotten**: dead interface stays around. + - Mitigation: a comment on each declaration naming the cleanup ticket, and an entry in that ticket's scope. +5. **A cross-repo use on non-default branches was missed**: the audit covered default branches only. + - Mitigation: release lines are frozen and covered by the migration ticket. The 34281 decision already excludes release lines. + +## Next Steps + +1. Review this design document +2. Refine if needed based on feedback +3. Proceed to implementation planning: `/spec-driven-development:create_plan specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/design.md` + +## References + +- Original ticket: [PFM-ISSUE-33676](https://base.cplace.io/pages/w64364g0a1qsl6z6vb11ngevs/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend-workflows) +- Related research: [Research](./research.md) +- GitHub App for cross-repo cloning: [PFM-ISSUE-34281](https://base.cplace.io/pages/m47pvua9sb9od1xl9f7360kon/PFM-ISSUE-34281-Set-up-GitHub-App-for-cross-repository-cloning-in-FE-2.0-workflows), PFM-TASK-8604, cplace-fe PR #2982 +- Prior specs: `specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/`, `specs/2026-10-12_PFM-ISSUE-34283_consolidate-fe-release-workflow/` +- Similar patterns: cplace-fe `.github/workflows/devkit-test-template.yaml` (App-token minting), backend `SVA_ACTIONS_UPMERGE_*` usage in `cplace-gh-workflows` diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md new file mode 100644 index 00000000..c6763416 --- /dev/null +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md @@ -0,0 +1,649 @@ +# Replace shared GitHub user account in frontend workflows (PFM-ISSUE-33676) Implementation Plan + +## Overview + +Remove the last places where the shared GitHub user account (`GIT_USER_TOKEN`, `GIT_USER`, `GIT_USER_EMAIL`, actor +`squad-fe`) authenticates or identifies FE workflow activity: + +- In this repo, the upmerge check and the release flow get a fixed `github-actions[bot]` identity. Their `GIT_USER*` + declarations become optional and unused. +- In cplace-fe, the visual-baseline heal pushes with a short-lived `sva-actions-upmerge` App token, and storybook + commits as `github-actions[bot]`. +- Everything is proven live in `collaborationFactory/clone-cplace-fe`, with its `GIT_USER*` secrets deleted. That + includes a real App-token heal push through a branch ruleset. +- Finally, the AC1 usage mapping is extended with a 15-repo audit. + +## Current State Analysis + +- `.github/workflows/fe-check-upmerge.yml:5-11` declares `SLACK_TOKEN_UPMERGE`, `GIT_USER_EMAIL` and `GIT_USER`, all + `required: true`. + - `:20` passes the undeclared `inputs.GHA_REF` as `ref:`. It always resolves to empty. + - `:36-39` passes the three secrets as env to the upmerge composite action `@master`. +- `tools/scripts/upmerge/upmerge.ts:12-21` runs `git config --global user.email/user.name` from `GIT_USER*`, + unquoted. `upmerge.test.ts` covers only `isUpmergeNeeded()`. +- `.github/workflows/fe-release-flow.yml:24-27` declares `GIT_USER`/`GIT_USER_EMAIL` as `required: true`. + - `:140-146`, the "Configure git user" step, sets the identity from these secrets through env. +- `.github/workflow-templates/fe/fe-check-upmerge.yml:16-19` passes `GIT_USER*` explicitly. +- `README.md:83-91` ("Required secrets") lists `GIT_USER`/`GIT_USER_EMAIL`. +- cplace-fe `origin/main` `.github/workflows/heal-visual-baselines.yml`: + - `:60-62` has a comment that names the PAT. + - `:79` sets `BOT_EMAIL: secrets.GIT_USER_EMAIL`. + - `:93-100` checks out with `token: secrets.GIT_USER_TOKEN`. + - `:153-162` sets the identity from `GIT_USER*`. +- cplace-fe `deploy_storybook.yaml:42-43` sets `git config user.name squad-fe` / `user.email github-actions@github.com`. +- clone-cplace-fe, as of 2026-11-27: + - Branches are `main` (default), `release/26.4` and `release/26.3`. + - Repo secrets include `GIT_USER`, `GIT_USER_EMAIL` and `GIT_USER_TOKEN`. There is **no** `SLACK_TOKEN_UPMERGE`. + - Last tag: `version/26.4.12`. `default_workflow_permissions: read`. + - It has no rulesets and no branch protection, and no `type` custom property, so `product-fe` does not apply to it. + - It has no `heal-visual-baselines.yml`. It does have `.github/scripts/heal-gate.mjs` and the three visual apps. + - `main`'s snapshot/PR callers are on the `test/PFM-ISSUE-34293-jfrog-token` interface (`JFROG_TOKEN`). 34293 is + not on `master`, so those callers must **not** be repointed to a master-based test branch. + - Shared-account references: `cron_check_upmerge.yaml:17-18` (`GIT_USER*`) on all three branches. + `deploy_storybook.yaml:42` (`squad-fe`) on all three. `push_main.yaml:45` (`GIT_USER_TOKEN`) on `release/26.4` + and `release/26.3`. +- `sva-actions-upmerge` (App 3487076, installation `126667289`, `contents: write` + `metadata: read`): + - The installation is on selected repos: `cplace-fe` and `cplace-2lforge-messages`. + - Org secrets `SVA_ACTIONS_UPMERGE_ID`/`_KEY` have `selected` visibility and do not include clone-cplace-fe. + - The App is a bypass actor on org ruleset `product-fe` (id 23989082). That ruleset targets repos with property + `type=frontend-product`, on the default branch and `release/*`. + +## Desired End State + +- **This repo:** `GIT_USER*` appears only as optional, unused declarations in `fe-check-upmerge.yml` and + `fe-release-flow.yml`, plus the deprecated `fe-tag.yml`. No reusable workflow or tool reads a shared-account + secret. +- **clone-cplace-fe:** + - It has no `GIT_USER`, `GIT_USER_EMAIL` or `GIT_USER_TOKEN` repo secret. + - None of its branches references them or `squad-fe` as an identity. + - A release, an upmerge check and a snapshot-PR comment have passed live without them. + - An App-token heal push has landed on a ruleset-protected `main`, authored as `sva-actions-upmerge[bot]`, and + the heal gate skipped that commit. +- **cplace-fe:** a PR on `main` carries the heal and storybook changes that were tested in the clone. +- **`research.md`:** it has an AC1 addendum mapping every shared-account use across this repo and the 15 FE repos to + its replacement and owner. + +### Key Discoveries: +- **Correct bot email:** the `github-actions[bot]` user id is **41898282** (`gh api users/github-actions%5Bbot%5D`). + The noreply address is `41898282+github-actions[bot]@users.noreply.github.com`. The design's `41898828` is a typo. + The plan uses the correct id. +- **`sva-actions-upmerge[bot]`** has user id 278916743, so its address is + `278916743+sva-actions-upmerge[bot]@users.noreply.github.com`. This matches the design. +- **Token input:** the backend mints this App's token with `create-github-app-token` v3.2.0 and `app-id:` + (`cplace-gh-workflows` `prepare-git-environment/action.yml:37-44`). `app-id` works on the v3.3.0 pin from the + devkit template: `64ab729a6294000f5aa4a4bc0b73d1f32bc45510`. +- **Token lifetime:** heal jobs have run for up to 54 minutes (cplace-fe runs 38876743753 and 38412506316), and App + tokens expire after 1 hour. So the token is minted **immediately before the push** and only when a heal is needed. + Checkout uses the default token with `persist-credentials: false`. This is an implementation detail inside the + design's decision 3: same App, same scope, same push. +- **Central upmerge:** `cplace-gh-workflows` `auto-pr-upmerge.yml`, which the clone calls with `secrets: inherit`, + reads no `GIT_USER*`. It uses `SVA_ACTIONS_UPMERGE_*` and Slack secrets. +- **Composite ref:** `fe-check-upmerge.yml` calls the upmerge action `@master`. A live test needs the established + test-branch pattern: rewrite internal `@master` refs to the test branch + (`specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/live-test-plan.md` §2.3 T1). +- **15 FE repos:** the 14 repos with `type=frontend-product`, plus `cplace-e2e`. The 14 are `cplace-2lforge-toolbar-fe`, + `cplace-2lforge-trees-fe`, `cplace-citizen-ai-fe`, `cplace-dataciders-portfolio-management-fe`, `cplace-fe`, + `cplace-loomeo-fe`, `cplace-lowcode-widget-builder-fe`, `cplace-office-reports-fe`, `cplace-paw-fe`, + `cplace-project-planning-fe`, `cplace-remote-filesystem-fe`, `cplace-resource-management-fe`, + `cplace-time-bounded-values-fe` and `cplace-workflow-fe`. +- **Heal gate:** + - On `workflow_dispatch`, `heal-gate.mjs` `decideDispatch()` proceeds for the chosen app unless HEAD carries + `[skip visual-heal]`. It does not use `BOT_EMAIL`. + - On push, it skips the heal's own commit through the loop-break. +- **Existing test pattern:** `tools/scripts/upmerge/upmerge.test.ts` uses `jest.spyOn(child_process, 'execSync')`. +- **`squad-fe` in npm metadata:** `tools/scripts/artifacts/nx-project.ts:324,336` uses `squad-fe` only as the npm + `package.json` `author`. It is not a credential or a git identity, so it is out of scope. + +## What We're NOT Doing + +- Deleting `fe-tag.yml` or `workflows/fe-release.yml`, or switching them away from the PAT (migration/cleanup ticket). +- Removing the `GIT_USER*` declarations from `workflow_call.secrets` (migration/cleanup ticket). +- Migrating consumer repos off `fe-tag.yml`, removing cplace-fe's `squad-fe` pusher guard, or deleting `GIT_USER*` + secrets in any repo other than clone-cplace-fe. +- Narrowing `permissions:` in caller templates, including the upmerge template (PFM-ISSUE-35504). +- Removing `printenv` from the upmerge composite action, or changing `--release 5.17`. +- Changing cplace-fe release lines, `.npmrc`/JFrog service users, or `nx-project.ts`'s npm `author`. +- Setting up a new GitHub App, or **permanently** changing `sva-actions-upmerge`'s installation or secret + visibility. Phase 3's changes are temporary and are reverted. +- Moving clone-cplace-fe's `main` snapshot/PR callers off the 34293 test branch. + +## Implementation Approach + +Four phases, each ending in a human checkpoint: + +1. **Code changes in this repo**, unit-tested and linted. +2. **Live integration in clone-cplace-fe.** Phase 1 runs end to end there, through a test branch, with the secrets + deleted. +3. **The cplace-fe heal and storybook changes.** They are written on a cplace-fe branch, copied into the clone, and + proven with a real ruleset-bypass push. Then the cplace-fe PR is opened. +4. **The AC1 audit and mapping.** + +Integration comes in phase 2, right after the code changes, so nothing is deferred to the end. + +**Placeholders** + +| Name | Value | +|---|---| +| `FB` | `improvement/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend` (both this repo and cplace-fe) | +| `TEST_BRANCH` | `test/PFM-ISSUE-33676-bot-identity` (this repo) | +| `R` | `collaborationFactory/clone-cplace-fe` | +| `GA` | `C:/cplace-dev/repos-gradle/github-actions` | +| `CL` | `C:/cplace-dev/repos-gradle/clone-cplace-fe` | +| `CFE` | `C:/cplace-dev/repos-gradle/cplace-fe` | +| `BOT_NAME` / `BOT_EMAIL_GA` | `github-actions[bot]` / `41898282+github-actions[bot]@users.noreply.github.com` | +| `APP_BOT_NAME` / `APP_BOT_EMAIL` | `sva-actions-upmerge[bot]` / `278916743+sva-actions-upmerge[bot]@users.noreply.github.com` | +| `CLONE_REPO_ID` | `1430984878` | +| `UPMERGE_INSTALLATION` | `126667289` | + +**Stop rules** + +- Ask the user before every push to `github-actions` or `cplace-fe`, before deleting secrets, and before every + org-level change (App installation, org-secret visibility). +- Pushes to clone-cplace-fe are allowed. It is the test fork. +- In Git Bash, set `MSYS_NO_PATHCONV=1` for `git show :` and `gh api` paths. + +--- + +## Phase 1: Bot identity and optional secrets in github-actions + +### Overview +Implement design decisions 1, 2 and 6 on `FB`, which is branched from `master`. Nothing is pushed in this phase. + +### Changes Required: + +#### 1. Upmerge reusable workflow +**File**: `.github/workflows/fe-check-upmerge.yml` +**Changes**: +- `GIT_USER*` become `required: false`, with a removal comment. +- Delete the `ref:` line. +- Add an identity step. +- Stop passing `GIT_USER*` to the action. + +```yaml +on: + workflow_call: + secrets: + SLACK_TOKEN_UPMERGE: + required: true + # Unused since PFM-ISSUE-33676 (the git identity is the github-actions bot). Kept optional so + # callers that still pass them keep working; removed by the FE migration/cleanup ticket. + GIT_USER_EMAIL: + required: false + GIT_USER: + required: false + +jobs: + check-upmerge: + name: Run Upmerge Flow + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 + with: + fetch-depth: 0 + + # cplace-cli makes local merge commits (--no-push), which need an author. --global, as before, + # in case the CLI merges outside the checkout. + - name: Configure git identity + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + + # setup-node and the node_modules cache are unchanged + + - name: check if upmerge is necessary and post to slack + uses: collaborationFactory/github-actions/.github/actions/upmerge@master + env: + SLACK_TOKEN_UPMERGE: ${{ secrets.SLACK_TOKEN_UPMERGE }} +``` + +#### 2. Upmerge script +**File**: `tools/scripts/upmerge/upmerge.ts` +**Changes**: delete the two `execSync('git config --global …')` calls (`:12-21`). +`checkUpmergeAndNotifiy()` becomes: + +```ts + public async checkUpmergeAndNotifiy() { + const slackMessage = this.isUpmergeNeeded(); + await this.postToSlack(slackMessage); + } +``` + +#### 3. Upmerge unit test (existing file, existing pattern) +**File**: `tools/scripts/upmerge/upmerge.test.ts` +**Changes**: append one test proving that the script no longer configures git. It follows the file's +`jest.spyOn(child_process, 'execSync')` pattern. + +```ts +test('does not configure a git identity', async () => { + const execSpy = jest + .spyOn(child_process, 'execSync') + // cast: execSync is overloaded; ts-jest type-checks the test + .mockImplementation(((cmd: string) => + cmd.startsWith('git config --get remote.origin.url') + ? 'https://github.com/collaborationFactory/cplace-fe.git' + : 'Merging upmerge-x/release/24.1 into origin/main\n') as any); + const handler = new UpmergeHandler(); + const slackSpy = jest + .spyOn(handler, 'postToSlack') + .mockResolvedValue(undefined); + + await handler.checkUpmergeAndNotifiy(); + + const commands = execSpy.mock.calls.map(([cmd]) => String(cmd)); + expect(commands.some((c) => c.includes('user.name') || c.includes('user.email'))).toBe(false); + expect(slackSpy).toHaveBeenCalledWith({ message: '' }); + execSpy.mockRestore(); + slackSpy.mockRestore(); +}); +``` + +#### 4. Release flow +**File**: `.github/workflows/fe-release-flow.yml` +**Changes**: +- `:24-27`: `GIT_USER`/`GIT_USER_EMAIL` become `required: false`, with the same removal comment as in change 1. +- `:140-146`: the step gets fixed values and no secret env. + +```yaml + - name: Configure git user + run: | + git config user.name 'github-actions[bot]' + git config user.email '41898282+github-actions[bot]@users.noreply.github.com' +``` + +#### 5. Upmerge caller template +**File**: `.github/workflow-templates/fe/fe-check-upmerge.yml` +**Changes**: delete lines 18-19 (`GIT_USER_EMAIL`, `GIT_USER`). The `permissions:` block stays as it is (35504). + +#### 6. README +**File**: `README.md` +**Changes**: in "Required secrets" (`:83-91`): +- Drop `GIT_USER`, `GIT_USER_EMAIL` from the list. +- Add one sentence: the flow sets the `github-actions[bot]` identity itself. `GIT_USER`/`GIT_USER_EMAIL` are still + accepted but unused. +- Add one sentence for the upmerge check: it needs only `SLACK_TOKEN_UPMERGE`. +- Keep the `GIT_USER_TOKEN` paragraph (`:89-91`). After it, add: "A repo can delete `GIT_USER` and `GIT_USER_EMAIL` + once no caller passes them explicitly, and `GIT_USER_TOKEN` once none of its branches calls `fe-tag.yml` or + `workflows/fe-release.yml`." + +### Success Criteria: + +#### Automated Verification: +- [x] Upmerge unit tests pass, including the new one: `npx jest --config=./jest.config.js tools/scripts/upmerge` +- [x] The full test suite passes: `npm test` + - Note (2026-11-27, Windows): 92/100 pass. The 8 failures (`artifacts-handler-tag`, `nx-project`, `utils` + suites) are identical on `master`: Windows path separators (`\mock\…` vs `/mock/…`). They are unrelated to this + change. The new upmerge test was confirmed to fail against the old `upmerge.ts`. +- [x] actionlint is clean on the changed workflows: `~/go/bin/actionlint .github/workflows/fe-check-upmerge.yml .github/workflows/fe-release-flow.yml` +- [x] Only the optional declarations and `fe-tag.yml` remain. This prints nothing: + `grep -rn "GIT_USER" .github tools | grep -v "^.github/workflows/fe-tag.yml" | grep -vE "^\.github/workflows/(fe-check-upmerge|fe-release-flow)\.yml:[0-9]+: +GIT_USER(_EMAIL)?:$"` +- [x] No `GIT_USER*` declaration in either workflow is required. This prints nothing: + `grep -A1 -E "^ +GIT_USER(_EMAIL)?:$" .github/workflows/fe-check-upmerge.yml .github/workflows/fe-release-flow.yml | grep "required: true"` +- [x] The undeclared input is gone. This prints nothing: `grep -n "inputs.GHA_REF" .github/workflows/fe-check-upmerge.yml` +- [x] Every identity uses the correct bot id: `grep -rn "41898828" .github README.md` prints nothing, and + `grep -rn "41898282+github-actions" .github/workflows` prints exactly two lines +- [x] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 1 complete. Summary: bot identity + in fe-check-upmerge.yml and fe-release-flow.yml, GIT_USER* optional and unused, upmerge.ts no longer sets git + config (new unit test), template and README updated; nothing pushed yet. Please review the changes and reply + 'yes' to continue to Phase 2." Do NOT proceed until the user explicitly approves. This checkpoint cannot be + skipped or pre-checked. + - Approved 2026-11-27. The user asked whether the noreply bot email is needed; it is not for these two + workflows (nothing they commit is pushed), but the user chose to keep it as planned. + +#### Manual Verification: +- [x] The diff touches only the six files above. +- [x] The README wording reads correctly next to the migration section. + +--- + +## Phase 2: Live verification in clone-cplace-fe without the shared-account secrets + +### Overview +Prove AC2 and AC3 for this repo's workflows: + +- Point the clone's affected callers at a test branch. +- Remove every shared-account reference from all three clone branches. +- Delete the three secrets. +- Run a release, an upmerge check and a snapshot-PR comment. + +This also covers the R6 test that 34282 skipped. + +### Changes Required: + +#### 1. Push the feature branch and build the test branch (stop: pushes to github-actions) +**File**: `GA` branches `FB` and `TEST_BRANCH` +**Changes**: +1. Commit Phase 1 on `FB` (attribution per the session rules) and push `FB`. +2. Create the test branch: `git switch -c $TEST_BRANCH $FB`. + - Commit 1, "Test branch: point internal refs to `TEST_BRANCH`": + ```bash + grep -rlE 'collaborationFactory/github-actions/\.github/.+@master' .github/workflows .github/actions \ + | xargs sed -i "s#\(collaborationFactory/github-actions/\.github/[^@]*\)@master#\1@$TEST_BRANCH#g" + ``` + - Commit 2: drop the e2e job from `fe-release-flow.yml`, as in 34282 (`git cherry-pick 52aca8a`). On conflict, + redo it by hand: drop the `e2e` job and the `RUN_E2E` input, set `release.needs: build`, and drop the + `needs.e2e` condition. +3. Push `TEST_BRANCH`. + +#### 2. Remove shared-account use on every clone branch +**File**: `clone-cplace-fe: .github/workflows/*` on `main`, `release/26.4`, `release/26.3` +**Changes**: one commit per branch, touching only the files listed, and never `package.json`/`package-lock.json` +(xray). + +| File | `main` | `release/26.4` | `release/26.3` | +|---|---|---|---| +| `cron_check_upmerge.yaml` | `uses:` → `fe-check-upmerge.yml@$TEST_BRANCH`. Delete the `GIT_USER_EMAIL`/`GIT_USER` lines. | same | same | +| `deploy_storybook.yaml` | `git config user.name 'github-actions[bot]'` and `user.email '41898282+github-actions[bot]@users.noreply.github.com'` | same | same | +| `fe-release.yml` | unchanged (34282 test ref, default-branch snapshot only) | `uses:` → `fe-release-flow.yml@$TEST_BRANCH` | `uses:` → `fe-release-flow.yml@$TEST_BRANCH`. Its old 34283 ref still requires `GIT_USER*`. | +| `push_main.yaml` | unchanged (no `GIT_USER*`, 34293 interface) | delete the `GIT_USER_TOKEN:` line | delete the `GIT_USER_TOKEN:` line | + +- Do not touch the `main` snapshot/PR callers on `test/PFM-ISSUE-34293-jfrog-token`. +- The push to `release/26.4` starts a release run with nothing affected (**L0a**). The push to `release/26.3` starts + one too (**L0b**). The push to `main` starts the main CI (**L0c**). + +#### 3. Prepare and delete secrets (stop: ask before deleting) +**File**: `clone-cplace-fe` repo secrets +**Changes**: +- `gh secret set SLACK_TOKEN_UPMERGE -R $R --body dummy-not-a-slack-token`. + - The upmerge caller requires this secret, and the clone has none. + - With a dummy value, a Slack post fails inside `postToSlack`'s try/catch, which only logs the error. So nothing + reaches the real `#frontend-upmerge` channel. +- After L0a, L0b and L0c pass, and with the user's confirmation: + `gh secret delete GIT_USER_TOKEN -R $R; gh secret delete GIT_USER -R $R; gh secret delete GIT_USER_EMAIL -R $R`. + +#### 4. Live runs, with the secrets deleted + +| ID | Trigger | Expected | +|---|---|---| +| **L1 Release** | `gh workflow run fe-release.yml -R $R --ref release/26.4 -f force=true` | RELEASE(26.4.13) as in the 34282 live-test plan, R2/R6. `guard`, `install-deps`, `build`, `release` and `github-release` all succeed. The log line `Uses: …fe-release-flow.yml@refs/heads/$TEST_BRANCH`. "Configure git user" shows the fixed values with no secret env. `refs/tags/version/26.4.13` is lightweight. The GitHub release author is `github-actions[bot]`. There is no `Secret … is required, but not provided` error. | +| **L2 Upmerge** | `gh workflow run cron_check_upmerge.yaml -R $R --ref main` | The run succeeds, using `fe-check-upmerge.yml@refs/heads/$TEST_BRANCH`. The "Configure git identity" step ran. The log shows `cliResult:` (cplace-cli ran with no identity error) and `finished upmerge workflow`. A Slack `invalid_auth` error in the log is expected. | +| **L3 Snapshot PR comment** | Branch `test/33676-snapshot` from `main` with a one-line comment change in a publishable lib (for example `libs/cf-frontend-sdk/src/index.ts`). Open a PR to `main` and add the `snapshot` label. | `publish-pr-snapshot` succeeds. The PR has exactly one comment containing ``, authored by `github-actions[bot]`. Afterwards, close the PR (the close workflow cleans up snapshots) and delete the branch. | +| **L4 Main push** | The L3 PR is not merged. Instead, push an empty commit to `main`: `git commit --allow-empty -m "33676 L4: main CI without GIT_USER secrets"` | `push_main.yaml` succeeds with the secrets gone. | + +Record run IDs and results in a new file `specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/live-test-log.md` +(sections L0–L4, then H0–H4 in Phase 3). + +### Success Criteria: + +#### Automated Verification: +- [ ] The test branch refs point at itself. This prints nothing: + `git -C $GA grep -nE 'collaborationFactory/github-actions/\.github/.+@' origin/$TEST_BRANCH -- .github/workflows .github/actions | grep -v "@$TEST_BRANCH"` +- [ ] The test branch differs from `FB` only by the ref rewrite and the e2e drop: + `git -C $GA diff --stat origin/$FB origin/$TEST_BRANCH` +- [ ] No shared-account secret left. This prints nothing: `gh secret list -R $R | grep -E "^GIT_USER"` +- [ ] No clone branch references them. This prints nothing: + `for b in main release/26.4 release/26.3; do git -C $CL grep -nE 'secrets\.GIT_USER|GIT_USER_TOKEN|user\.name +squad-fe' origin/$b -- .github; done` +- [ ] L0a, L0b, L0c, L1, L2, L3 and L4 all concluded `success`: `gh run view -R $R --json conclusion` +- [ ] The L1 tag exists and is lightweight: + `gh api repos/$R/git/refs/tags/version/26.4.13 --jq .object.type` prints `commit` +- [ ] The L1 release is authored by the bot: + `gh api repos/$R/releases/tags/version/26.4.13 --jq .author.login` prints `github-actions[bot]` +- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 2 complete. Summary: TEST_BRANCH + pushed, all three clone branches free of GIT_USER*/squad-fe, the three secrets deleted, and release 26.4.13, + upmerge check, snapshot PR comment and main CI all passed (run IDs in live-test-log.md). Please review and reply + 'yes' to continue to Phase 3." Do NOT proceed until the user explicitly approves. This checkpoint cannot be + skipped or pre-checked. + +#### Manual Verification: +- [ ] The L2 log shows cplace-cli processed the clone's release chain (`release/26.3` → `release/26.4` → `main`) + without an identity error. +- [ ] The L3 PR comment lists the published snapshot versions. + +--- + +## Phase 3: cplace-fe heal App token and storybook identity, proven in clone-cplace-fe + +### Overview +Implement design decisions 3 and 4 on cplace-fe `FB`, which is branched from `origin/main`. Copy the exact heal +workflow into the clone, give the clone temporary access to the App plus a `product-fe`-like ruleset, force a +baseline drift, and prove the App pushes through the bypass. Then revert the temporary access and open the cplace-fe +PR. + +### Changes Required: + +#### 1. Heal workflow +**File**: `cplace-fe: .github/workflows/heal-visual-baselines.yml` +**Changes**: +- `:60-62`: change the comment's "with a branch-protection bypass PAT" to "with the sva-actions-upmerge App token + (bypass actor on the org `product-fe` ruleset)". +- `:79`: delete `BOT_EMAIL: ${{ secrets.GIT_USER_EMAIL }}`. The gate treats an empty value as "no bot". +- `heal` job: change `permissions: contents: write` to `contents: read`, since the push now uses the App token. +- Checkout `:93-100`: remove `token:` and its comment, and set `persist-credentials: false`. +- Insert a token step directly before "Heal baselines", with the same `if:` as that step. +- In "Heal baselines", change the env and the identity, and point `origin` at the App token before the + pull/push loop. + +```yaml + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.ref || github.sha }} + fetch-depth: 0 + # The push authenticates with the App token minted right before it (see below). + persist-credentials: false + + # ... render steps unchanged ... + + # Minted only when a heal is needed, and just before the push: App tokens live one hour and a + # heal job can run close to that. sva-actions-upmerge is a bypass actor on the org `product-fe` + # ruleset (default branch and release/*), which lets this commit land on protected branches. + - name: Get sva-actions-upmerge token + id: app-token + if: steps.render1.outcome == 'failure' && steps.render2.outcome == 'failure' + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + app-id: ${{ secrets.SVA_ACTIONS_UPMERGE_ID }} + private-key: ${{ secrets.SVA_ACTIONS_UPMERGE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + + - name: Heal baselines + id: heal + if: steps.render1.outcome == 'failure' && steps.render2.outcome == 'failure' + env: + APP: ${{ matrix.app }} + REF: ${{ inputs.ref || github.ref_name }} + APP_TOKEN: ${{ steps.app-token.outputs.token }} + SERVER_URL: ${{ github.server_url }} + REPO: ${{ github.repository }} + run: | + set -euo pipefail + ( cd "apps/$APP" && npx --no-install --ignore-scripts cypress-image-diff -u ) + git config user.name 'sva-actions-upmerge[bot]' + git config user.email '278916743+sva-actions-upmerge[bot]@users.noreply.github.com' + git remote set-url origin "https://x-access-token:${APP_TOKEN}@${SERVER_URL#https://}/${REPO}.git" + # ... rest unchanged (add, commit, pull --rebase / push loop, outputs) ... +``` + +#### 2. Storybook identity +**File**: `cplace-fe: .github/workflows/deploy_storybook.yaml` +**Changes**: replace the `:42-43` identity with +`git config user.name 'github-actions[bot]'` and +`git config user.email '41898282+github-actions[bot]@users.noreply.github.com'`. + +#### 3. Copy into the clone and force a drift +**File**: `clone-cplace-fe: .github/workflows/heal-visual-baselines.yml` (new, on `main`), plus one baseline PNG +**Changes**: +- **H0, commit 1 on clone `main`:** copy the cplace-fe `FB` heal workflow byte for byte. Its push only runs the + gate, which reports "not an upmerge commit". +- **H0, commit 2 on clone `main`:** corrupt one baseline by copying another baseline over it: + `cp apps/helles-ui-visual-e2e/visual-regression/baseline/accordion.cy.ts-types.png apps/helles-ui-visual-e2e/visual-regression/baseline/accordion.cy.ts-states.png`. + - Subject: `33676 H0: force visual drift for the heal test`. + - Its push starts only the gate and the main CI. The gate skips it as not an upmerge commit. + +#### 4. Temporary App access and ruleset for the clone (stop: confirm each org-level change) +**File**: GitHub org settings +**Changes**: +- **H1a:** add the clone to the App installation: + `gh api -X PUT user/installations/126667289/repositories/1430984878`. +- **H1b:** add the clone to both org secrets' selected repos: + `gh api -X PUT orgs/collaborationFactory/actions/secrets/SVA_ACTIONS_UPMERGE_ID/repositories/1430984878`, and the + same for `SVA_ACTIONS_UPMERGE_KEY`. +- **H1c:** create a repo ruleset `33676-heal-test` on the clone. It targets `~DEFAULT_BRANCH`, with rules + `pull_request` (1 approval), `non_fast_forward` and `deletion`. The only bypass actor is + `{"actor_id":3487076,"actor_type":"Integration","bypass_mode":"always"}`. Create it with + `gh api -X POST repos/$R/rulesets --input ` and record its id. +- **H1d negative control:** pushing an empty commit to clone `main` with the user's own credentials is + **rejected** by the ruleset. Afterwards, reset the local branch. + +#### 5. Heal run and cleanup +- **H2:** `gh workflow run heal-visual-baselines.yml -R $R --ref main -f app=helles-ui-visual-e2e -f ref=main`. + Expected results: + - The gate decides `workflow_dispatch override`. + - render1 and render2 fail. + - "Get sva-actions-upmerge token" succeeds. + - The heal pushes `chore: heal visual baselines for helles-ui-visual-e2e [skip visual-heal]` to `main`. + - The "Announce heal" Slack step is best-effort. With the dummy token it fails under `continue-on-error`. +- **H3:** the push run that the heal commit triggers decides `loop-break: heal marker present`, and no `heal` job + runs. +- **H4 cleanup** (confirm with the user): + - Delete the ruleset. + - Remove the clone from the installation: + `gh api -X DELETE user/installations/126667289/repositories/1430984878`. + - Remove the clone from both secrets' selected repos (`-X DELETE …/repositories/1430984878`). + - The heal workflow stays in the clone. +- Log H0–H4 in `live-test-log.md`. + +#### 6. Open the cplace-fe PR (stop: push) +- Commit on cplace-fe `FB` with the title `PFM-ISSUE-33676 - Push visual-baseline heals with the sva-actions-upmerge + App and drop the squad-fe storybook identity`. +- The body links the clone run IDs (H2, H3), says `main` only (release lines unchanged, 34281 decision), and names + the dependency on the `product-fe` bypass entry and the org secrets. + +### Success Criteria: + +#### Automated Verification: +- [ ] cplace-fe heal gate tests still pass: `node --test .github/scripts/` in `CFE` on `FB` +- [ ] actionlint is clean: `~/go/bin/actionlint .github/workflows/heal-visual-baselines.yml .github/workflows/deploy_storybook.yaml` in `CFE` +- [ ] No shared-account reference is left in either cplace-fe file. This prints nothing: + `git -C $CFE grep -nE "GIT_USER|squad-fe" $FB -- .github/workflows/heal-visual-baselines.yml .github/workflows/deploy_storybook.yaml` +- [ ] The clone copy is identical: + `git -C $CFE show $FB:.github/workflows/heal-visual-baselines.yml | diff - <(git -C $CL show origin/main:.github/workflows/heal-visual-baselines.yml)` +- [ ] The H2 run succeeded, and its heal commit on clone `main` is authored by the App bot: + `git -C $CL log -1 --format='%an <%ae> %s' origin/main` shows `sva-actions-upmerge[bot] <278916743+sva-actions-upmerge[bot]@users.noreply.github.com>` and `[skip visual-heal]` +- [ ] H3's gate output contains `loop-break: heal marker present`: `gh run view

-R $R --log | grep "reason=loop-break"` +- [ ] H1d was rejected: the recorded push output contains `GH013` / "repository rule violations" +- [ ] H4 restored the access: + `gh api --paginate user/installations/126667289/repositories --jq '.repositories[].name' | grep -x clone-cplace-fe` prints nothing, + `gh api repos/$R/rulesets --jq length` prints `0`, and + `gh api orgs/collaborationFactory/actions/secrets/SVA_ACTIONS_UPMERGE_ID/repositories --jq '.repositories[].name' | grep -x clone-cplace-fe` prints nothing +- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 3 complete. Summary: heal + workflow now pushes with a just-in-time sva-actions-upmerge token and storybook commits as github-actions[bot]; + in clone-cplace-fe a forced drift was healed through a ruleset that only the App can bypass, the loop-break + skipped the heal commit, temporary App/secret/ruleset access was removed, and the cplace-fe PR is open. Please + review and reply 'yes' to continue to Phase 4." Do NOT proceed until the user explicitly approves. This checkpoint + cannot be skipped or pre-checked. + +#### Manual Verification: +- [ ] The healed baseline commit in the clone changes only `apps/helles-ui-visual-e2e/visual-regression/baseline/`. +- [ ] After the cplace-fe PR merges, the next scheduled storybook run on cplace-fe makes its `gh-pages` merge commit + as `github-actions[bot]`: `git log -1 --format='%an <%ae>' origin/gh-pages`. + +--- + +## Phase 4: AC1 usage mapping and 15-repo audit + +### Overview +Produce the AC1 deliverable: every use of the shared account across this repo and the 15 FE repos, each with its +replacement and owner. It goes into the spec as an addendum to `research.md`. The research frontmatter is not +changed. + +### Changes Required: + +#### 1. Audit the 15 repos (read-only) +**File**: scratchpad clones (not committed) +**Changes**: +- Shallow-clone the default branch of each of the 15 repos (see Key Discoveries) into the scratchpad: + `gh repo clone collaborationFactory/ / -- --depth 1`. +- In each, run: + `git grep -nE 'GIT_USER(_TOKEN|_EMAIL)?\b|squad-fe|repository:|git clone|gh repo clone|create-github-app-token' -- .github` +- Also list which repos pass `GIT_USER*` to `fe-check-upmerge.yml` or call `fe-tag.yml` / `workflows/fe-release.yml`. +- Expected, from the design: the only cross-repo checkout is cplace-fe's devkit e2e (already on + `sva-actions-read-product-fe`). Explicit `GIT_USER*` upmerge passes are in cplace-fe, cplace-paw-fe, + cplace-office-reports-fe and cplace-workflow-fe. +- If the audit finds a shared-account use the design does not cover, STOP and report it to the user. + +#### 2. Mapping addendum +**File**: `specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md` +**Changes**: append the section `## Addendum (2026-11-xx): Final usage → replacement mapping (AC1)`. It contains: +- A table extending U1–U9 with the final status: + - U5 and U6: done here, `github-actions[bot]`. + - U7: verified by L3. + - U8: done by 34281. + - U9: README updated. +- New rows: + - U10: cplace-fe heal push → `sva-actions-upmerge`. + - U11: cplace-fe storybook identity → `github-actions[bot]`. + - U12: heal-gate `BOT_EMAIL` → dropped. + - U13: `fe-tag.yml` callers, per repo → migration/cleanup ticket. + - U14: explicit `GIT_USER*` upmerge passes, per repo → migration/cleanup ticket. + - U15: cplace-fe `squad-fe` pusher guard → migration/cleanup ticket. + - U16: the optional `GIT_USER*` declarations → migration/cleanup ticket. + - Any further hits from the audit. +- A per-repo audit table for the 15 repos: one row per repo, with hits by category, or "none". +- A note on the design's email typo (`41898828` → `41898282`). +- A pointer to `live-test-log.md` for the AC2/AC3 evidence. + +### Success Criteria: + +#### Automated Verification: +- [ ] The addendum exists: `grep -n "Final usage → replacement mapping" specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md` +- [ ] All 15 repos appear in the audit table: + `for r in cplace-e2e cplace-2lforge-toolbar-fe cplace-2lforge-trees-fe cplace-citizen-ai-fe cplace-dataciders-portfolio-management-fe cplace-fe cplace-loomeo-fe cplace-lowcode-widget-builder-fe cplace-office-reports-fe cplace-paw-fe cplace-project-planning-fe cplace-remote-filesystem-fe cplace-resource-management-fe cplace-time-bounded-values-fe cplace-workflow-fe; do grep -q "| $r " specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md || echo "missing $r"; done` prints nothing +- [ ] The research frontmatter is unchanged: `git diff HEAD -- specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md | grep -E "^[-+](git_commit|date):"` prints nothing +- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 4 complete. Summary: 15-repo audit + done and the final AC1 usage mapping (U1–U16+) added to research.md with owners. Please review and reply 'yes' to + finish." Do NOT proceed until the user explicitly approves. This checkpoint cannot be skipped or pre-checked. + +#### Manual Verification: +- [ ] Every mapping row has a replacement and an owner (this ticket, 34281, 35504 or migration/cleanup). +- [ ] The migration/cleanup ticket's scope can be copied from the "owner = migration/cleanup" rows. + +--- + +## Testing Strategy + +### Unit Tests: +- `upmerge.test.ts`: the new test asserts `checkUpmergeAndNotifiy()` runs no `user.name`/`user.email` git config. + The existing three tests still pass. +- cplace-fe `heal-gate.test.mjs`: unchanged, and still green. The `BOT_EMAIL`-empty path is already the effective + production path. + +### Integration Tests: +- Clone runs L0–L4: release, upmerge check, PR snapshot comment and main CI, all with `GIT_USER*` deleted. +- Clone runs H2–H3: a real App-token push through an App-only bypass ruleset, plus the loop-break. + +### Manual Testing Steps: +1. Read the L1 "Configure git user" and L2 "Configure git identity" step logs. The values are fixed, and no + secret is masked. +2. Check the H1d rejection message. It proves that the ruleset, not missing permissions, is what the App bypassed. +3. After the cplace-fe merge, check the next storybook `gh-pages` commit author. + +## Performance Considerations + +None. One extra trivial step per workflow. The heal mints its token only on actual drift. + +## Migration Notes + +- **Consumers need no change.** Explicit `GIT_USER*` passes still validate against the optional declarations. + Repos using `secrets: inherit` can delete `GIT_USER`/`GIT_USER_EMAIL` at any time. They keep `GIT_USER_TOKEN` + while any branch calls `fe-tag.yml` or `workflows/fe-release.yml`. +- **Rollback:** revert the github-actions PR. The declarations return to `required: true`. Repos that already deleted + the secrets then fail, so do not delete secrets in production repos until the cleanup ticket. +- **clone-cplace-fe state:** the clone keeps pointing at `TEST_BRANCH` after the tests. That is acceptable for the + test fork, and there is no teardown. Before `TEST_BRANCH` is deleted (ask the user), repoint the clone's + `cron_check_upmerge.yaml` and `fe-release.yml` to `@master` once the github-actions PR is merged. +- **cplace-fe heal dependency:** the heal depends on `sva-actions-upmerge` staying installed on cplace-fe, on the + `product-fe` bypass entry, and on the visibility of `SVA_ACTIONS_UPMERGE_*` to cplace-fe. All of these are owned by + the backend team. The workflow comment names this dependency. + +## References + +- Research: [Research Document](./research.md) +- Design: [Design Document](./design.md) +- Original ticket: [PFM-ISSUE-33676](https://base.cplace.io/pages/w64364g0a1qsl6z6vb11ngevs/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend-workflows) +- Live-test protocol to follow: `specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/live-test-plan.md` + (§2.3 test branch, R2/R6 release expectations) and + `specs/2026-10-12_PFM-ISSUE-34283_consolidate-fe-release-workflow/clone-cplace-fe-live-tests.md` +- App-token pattern: cplace-fe `.github/workflows/devkit-test-template.yaml:89-108`. Backend: + `cplace-gh-workflows` `.github/actions/prepare-git-environment/action.yml:37-44` +- Identity step being replaced: `.github/workflows/fe-release-flow.yml:140-146` diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md new file mode 100644 index 00000000..b771f6fc --- /dev/null +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md @@ -0,0 +1,216 @@ +--- +date: 2026-11-26T21:34:41+01:00 +git_commit: 3e8a45b364d0e9f6aae577fe230a0f85be09791c +branch: master +topic: "PFM-ISSUE-33676 - Replace shared GitHub user account in frontend workflows" +tags: [research, codebase, github-actions, github-token, permissions, github-app, fe-tag, fe-release-flow, fe-check-upmerge, upmerge, fe-pr-snapshot] +status: complete +last_updated: 2026-11-26 +--- + +# Research: Replace shared GitHub user account in frontend workflows (PFM-ISSUE-33676) + +**Date**: 2026-11-26T21:34:41+01:00 +**Git Commit**: 3e8a45b364d0e9f6aae577fe230a0f85be09791c +**Branch**: master + +## Research Question +Inventory every remaining use of the shared GitHub user account (`GIT_USER_TOKEN`, `GIT_USER`, `GIT_USER_EMAIL`, actor `squad-fe`) in this repo's frontend reusable workflows, caller templates, composite actions and tools. Map each use to its replacement: the workflow's own `GITHUB_TOKEN` with scoped `permissions:`, or a GitHub App. Also record what PFM-ISSUE-34282, -34283 and -34285 have already replaced. + +## PFM Ticket Context +- **Ticket**: [PFM-ISSUE-33676](https://base.cplace.io/pages/w64364g0a1qsl6z6vb11ngevs/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend-workflows) +- **Title**: Replace shared GitHub user account in frontend workflows +- **Type**: PFM Issue, category 30.groundwork. Priority 20.high, status 50.working. +- **Target Release**: not set on the ticket +- **Assignee**: Vladimir Arsov. Requested by Christian Kaltenbach. Squad 01 - Build & Connect, team Stratum. +- **Parent**: WP-1963 "Modernize FE 2.0 Frontend Workflow Authentication" +- **Suggested Branch**: `improvement/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend` +- **Description**: + > **User Story**: As a CI/CD engineer in the Build & Connect POD, I want the shared GitHub user account in frontend workflows replaced with GitHub-native authentication (scoped `GITHUB_TOKEN` or a GitHub Authentication App), so that we eliminate a shared credential with rotation, audit, and blast-radius risk. + > + > **Description**: The shared GitHub user account is used in frontend workflows for tag creation, PR decoration, and (in some cases) cross-repository checkout for end-to-end tests. Replace it with GitHub-native authentication — scoped `GITHUB_TOKEN` permissions or a dedicated GitHub Authentication App — wherever it can cover the required usage. + > + > **Open Questions (decide at implementation start)** + > - Which usages can be covered by the workflow's own `GITHUB_TOKEN` with appropriate `permissions:` settings (likely: tag creation, PR decoration on the same repo). + > - Which usages require a GitHub Authentication App (likely: cross-repository checkout for e2e tests). + > + > **Acceptance Criteria** + > 1. Each current usage of the shared GitHub user account is mapped to its replacement (`GITHUB_TOKEN` with permissions or GitHub App). + > 2. The replacement is implemented and verified in at least one reference frontend repository. + > 3. The shared GitHub user account is no longer used in that reference repository. + +## Summary + +The three uses the ticket expects are mostly already gone from this repo, or never existed here: + +| Ticket's expected use | State on `master` (3e8a45b) | Replacement | +|---|---|---| +| **Tag creation** | **Done in the current flow.** `fe-release-flow.yml` pushes `version/*` tags with the persisted default `GITHUB_TOKEN`, with job `permissions: contents: write` (PFM-ISSUE-34282, #189). **Still PAT-based** in the deprecated `fe-tag.yml`, which is kept for unmigrated branches. | `GITHUB_TOKEN` (`contents: write`). The remaining PAT use goes away when `fe-tag.yml` is retired, not when it is migrated. | +| **PR decoration** | **Already `GITHUB_TOKEN`.** The only PR write is the "published artifacts" comment in `fe-pr-snapshot.yml`, sent through `actions/github-script` with the default `github.token`. | `GITHUB_TOKEN` (`pull-requests: write`, granted by the caller template) | +| **Cross-repo checkout for e2e** | **Not in this repo.** No `actions/checkout` has `repository:`, and there is no `git clone`. `fe-e2e.yml` tests the same repo in a Cypress container. | n/a here. If it exists, it lives in a consumer repo's own workflows (open question). | + +The shared account is still referenced in four places: + +1. **`fe-tag.yml`**, deprecated. This is the only place a PAT (`GIT_USER_TOKEN`) authenticates anything. It is used for the checkout and the later tag `git push`, and it also sets `GIT_USER`/`GIT_USER_EMAIL` as identity. +2. **`fe-release-flow.yml`**, the current flow. `GIT_USER`/`GIT_USER_EMAIL` are declared `required: true` and set as the git identity in the `release` job. The job only creates a lightweight tag, so the identity is never recorded. Removing it is formally assigned to **PFM-ISSUE-34286**. +3. **`fe-check-upmerge.yml`, `.github/actions/upmerge`, `tools/scripts/upmerge/upmerge.ts` and the caller template.** These use `GIT_USER`/`GIT_USER_EMAIL` as global git identity only. No token is involved: checkout uses the default token, and `cplace-cli flow --upmerge --no-push` pushes nothing. No earlier spec covers this. +4. **README "FE Release Flow → Required secrets"**, which documents `GIT_USER`/`GIT_USER_EMAIL` and the deprecated reusables' need for `GIT_USER_TOKEN`. + +None of the remaining uses needs a GitHub App. Every one is either same-repo `GITHUB_TOKEN` work or a pure git identity that can become the `github-actions[bot]` identity or be dropped. A GitHub App would only be needed for a cross-repo or workflow-triggering use, and none exists in this repo. The real remaining work is: +- (a) the identity-only uses (upmerge, release flow); +- (b) retiring `fe-tag.yml`/`workflows/fe-release.yml` once consumers are migrated; +- (c) acceptance criteria 2 and 3: proving in a reference FE repo that the shared account, including the `GIT_USER*` repo secrets, is no longer used. Consumer-side workflows outside this repo are part of that. + +## Detailed Findings + +### 1. Tag creation + +**Current flow: done (PFM-ISSUE-34282).** +- `.github/workflows/fe-release-flow.yml:108-109`: the `release` job has `permissions: contents: write`. +- `.github/workflows/fe-release-flow.yml:115-118`: the checkout has no `token:` override, so the default `GITHUB_TOKEN` is saved in `.git/config`. `fetch-depth: 0`. +- `fe-release-flow.yml:148-156` → `tools/scripts/artifacts/artifacts-handler.ts:311-313`: with `RELEASE_FLOW: true`, after publish and promote the flow runs `git tag ` and `git push origin `. It pushes tags only, no commits or branches. +- `fe-release-flow.yml:160-193`: failure cleanup runs `git ls-remote --exit-code --tags origin` (`:173`) with the same token. +- `fe-release-flow.yml:195-219`: the `github-release` job runs `gh release create --verify-tag --generate-notes` with `GH_TOKEN: ${{ github.token }}` (`:205`) and `contents: write` (`:200-201`). +- `GIT_USER_TOKEN` is no longer declared in `workflow_call.secrets`. `fe-snapshot.yml` lost it in PFM-ISSUE-34285 (faa4771). + +**Deprecated `fe-tag.yml`: still uses the PAT.** +- `.github/workflows/fe-tag.yml:19-24`: declares `GIT_USER_TOKEN`, `GIT_USER_EMAIL` and `GIT_USER`, all `required: true`. +- `fe-tag.yml:30-31`: prints `::warning::fe-tag.yml is deprecated. Migrate to fe-release-flow.yml`. +- `fe-tag.yml:33-37`: checkout with `token: ${{ secrets.GIT_USER_TOKEN }}`. The token is saved by default, so the later push uses the PAT. +- `fe-tag.yml:48-51`: `git config user.name/user.email` with the secrets put straight into the shell command, unquoted. +- `fe-tag.yml:53-61` → `artifacts-handler.ts:203-223` (`ONLY_BUMP_VERSION`): on a release branch it runs `git tag version/X.Y.Z` and `git push origin `. The PAT push exists because the old `workflows/fe-release.yml` listens for tag pushes: a `GITHUB_TOKEN` push would not start it. +- It has no `permissions:` block. The PAT bypasses `GITHUB_TOKEN` scoping anyway. +- No template or workflow in this repo calls it. The only references are the guard grep at `fe-release-flow.yml:57-66` (which fails the flow while a consumer still calls `fe-tag.yml@`/`fe-release.yml@`) and the README (`:52-58`, `:66-67`, `:89-90`). +- Known external callers, from the 34282 research and not re-checked here: `cplace-fe/.github/workflows/push_to_release.yaml` (`fe-tag.yml@master`, explicit PAT), and `cplace-2lforge-scores-fe/.github/workflows/fe-release.yml` (`@release/26.1`, `write-all`, explicit `GIT_USER_TOKEN`/`GIT_USER`/`GIT_USER_EMAIL`). Release lines 25.4-26.4 keep the old flow. + +**What this means:** tag creation needs no new mechanism. The PAT goes away when consumers migrate to `fe-release-flow.yml` and `fe-tag.yml`/`workflows/fe-release.yml` are deleted or stop being called. Switching `fe-tag.yml` itself to `GITHUB_TOKEN` would break it, because its tag must trigger the old `fe-release.yml` consumer. + +### 2. PR decoration + +- `.github/workflows/fe-pr-snapshot.yml:75-89`: `actions/github-script@v9.0.0` creates or updates one comment, marked ``, with text from `githubCommentsForPR.txt`. It passes no `github-token:` input, so it uses the default `github.token`. The job runs only when the PR has the `snapshot` label (`:21`). +- The reusable workflow has no `permissions:` block. `pull-requests: write` comes from the caller template `.github/workflow-templates/fe/fe-pr-snapshot.yml:8-12`. +- The thollander action was replaced by `github-script` with the default token in the node24 migration (`specs/2026-06-05_node24-workflow-migration/plan.md:244-264`). +- `fe-code-quality.yml:182` and `fe-sonar.yml:128-131` use `SONAR_CLOUD_TOKEN`, a service token rather than the shared user. SonarCloud adds its PR decoration from the server side through its own GitHub integration. +- `.github/` has no `gh pr`, sticky-comment, labeler or commit-status calls. The `pr-checks` job in the `fe-pr.yml` template only gathers the results of the jobs it depends on, using `jq`. + +**What this means:** PR decoration is already on `GITHUB_TOKEN`. The only open point is verification. The 34282 research calls this "the PR-decoration part of 33676" (`specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/research.md:278`). + +### 3. Cross-repo checkout for e2e + +- `grep -rn "repository:" .github` finds nothing. Every `actions/checkout` targets the same repo, and only `fe-tag.yml:37` overrides `token:`. +- The only other git network calls are same-repo `git fetch origin ` in `fe-build.yml:44`, `fe-code-quality.yml:64`, `fe-e2e.yml:46` and `fe-pr-snapshot.yml:46,52`. +- `fe-e2e.yml` runs Cypress in the `cypress/browsers:24.22.1` container against the checked-out repo and uses `PERCY_TOKEN` (`:59`), a service token. + +**What this means:** none of this repo's reusable workflows checks out another repo. If an FE e2e setup checks out another repo with the shared account (for example `cplace-e2e` or a private test-data repo), it is in a consumer repo's own workflow files. That is the only place a GitHub App (an `actions/create-github-app-token` pattern like the backend's `SVA_ACTIONS_READ_PRODUCT_*`) might be justified. + +### 4. Upmerge check (identity only, not covered by any earlier spec) + +- `.github/workflows/fe-check-upmerge.yml:5-11`: declares `SLACK_TOKEN_UPMERGE`, `GIT_USER_EMAIL` and `GIT_USER`, all `required: true`. There is no `GIT_USER_TOKEN`. +- `fe-check-upmerge.yml:18-21`: checkout with the default token and `fetch-depth: 0`. `ref: ${{ inputs.GHA_REF }}` refers to an **input that is not declared** (`workflow_call` has no `inputs:`), so it is empty and checkout falls back to the default ref. This is a latent bug that has nothing to do with authentication. +- `fe-check-upmerge.yml:34-39` passes the three secrets as env to `collaborationFactory/github-actions/.github/actions/upmerge@master`. +- `.github/actions/upmerge/action.yml:1-13` runs `printenv`, `npm ci`, `npm i -g @cplace/cli` and `ts-node tools/scripts/upmerge/main.ts`. GitHub masks the secret values that `printenv` logs. +- `tools/scripts/upmerge/upmerge.ts:12-21`: `git config --global user.email ${GIT_USER_EMAIL}` / `user.name ${GIT_USER}`, unquoted. +- `upmerge.ts:26-61`: `cplace-cli flow --upmerge --release 5.17 --no-push --show-files`. It parses stdout for "have been merged". **Nothing is pushed**, and no branch, PR or comment is created. The identity is probably needed only because the CLI makes local merge commits. This has not been checked in cplace-cli. +- `upmerge.ts:63-91`: posts to Slack channel `frontend-upmerge` with `SLACK_TOKEN_UPMERGE`, which is not a GitHub credential. +- Caller template `.github/workflow-templates/fe/fe-check-upmerge.yml`: cron `0 18 * * *`. It passes the three secrets explicitly (`:16-19`) and grants `contents: write`, `pull-requests: write`, `actions: read` and `checks: write` (`:7-11`). `contents: read` is enough, because nothing is pushed. +- The node24 migration never live-tested this workflow (`specs/2026-06-05_node24-workflow-migration/design.md:62`, `plan.md:418`). + +**What this means:** the shared account appears here only as a git author name and email for local merge commits that are thrown away. A fixed bot identity can replace it, for example `github-actions[bot]` / `41898828+github-actions[bot]@users.noreply.github.com`, set in the workflow or in code. With that change the `GIT_USER*` secrets can stop being required. If the declarations are removed while callers still pass the secrets explicitly, those callers may start failing (see Open Questions). + +### 5. Release flow git identity (assigned to PFM-ISSUE-34286) + +- `.github/workflows/fe-release-flow.yml:24-27`: `GIT_USER` and `GIT_USER_EMAIL` are `required: true`. +- `fe-release-flow.yml:140-146`: the "Configure git user" step sets `git config user.name "$GIT_USER"` / `user.email "$GIT_USER_EMAIL"` through env, quoted. +- The `release` job creates only a **lightweight** tag (`artifacts-handler.ts:312`), which records no tagger. The 34282 research (`:215`) found no `git commit`/`git merge` in non-test `tools/` code, so the identity is never used. +- The caller template `.github/workflow-templates/fe/fe-release.yml:32` uses `secrets: inherit`. If the declarations are removed, inherit callers need no change. +- `README.md:83-91` lists `GIT_USER`/`GIT_USER_EMAIL` as required secrets for the flow. +- The 34282 design deferred removal to PFM-ISSUE-34286 (34282 `design.md` "Git identity" and decision 4; 34283 `design.md:82-85`). + +### 6. Permissions and secrets in the workflows and templates + +Reusable workflows (`.github/workflows/`): + +| Workflow | `permissions:` | Shared-account secrets | +|---|---|---| +| fe-tag (deprecated) | none | GIT_USER_TOKEN, GIT_USER, GIT_USER_EMAIL | +| fe-release (deprecated tag-push consumer) | none | none | +| fe-release-flow | job-level: `contents: read` for guard, install-deps, build, e2e; `contents: write` for release and github-release | GIT_USER, GIT_USER_EMAIL | +| fe-check-upmerge | none | GIT_USER, GIT_USER_EMAIL | +| fe-pr-snapshot | none (relies on the caller's `pull-requests: write`) | none | +| fe-sonar | `sonarqube-scan`: `contents: read` | none | +| fe-snapshot, fe-code-quality, fe-e2e, fe-licenses, fe-install-deps, fe-build, fe-pr-close, fe-cleanup-snapshots | none | none | + +Caller templates (`.github/workflow-templates/fe/`): +- All templates except `fe-release.yml` grant the same four scopes (`contents: write`, `pull-requests: write`, `actions: read`, `checks: write`) and pass secrets explicitly. Reducing these to least privilege is assigned to **PFM-ISSUE-35504**. +- `fe-release.yml` grants only `contents: write` and uses `secrets: inherit`. +- Only `fe-check-upmerge.yml` still passes `GIT_USER*`. +- There is no `fe-tag` template. + +## Usage → replacement mapping (acceptance criterion 1) + +| # | Use | Location | Current credential | Proposed replacement | Owner / status | +|---|---|---|---|---|---| +| U1 | Release tag push | `fe-release-flow.yml:108-156` | `GITHUB_TOKEN` | — (done) | 34282, merged #189 | +| U2 | GitHub release creation | `fe-release-flow.yml:195-219` | `GITHUB_TOKEN` | — (done) | 34283, merged #183 | +| U3 | Snapshot workflow checkout | `fe-snapshot.yml` | `GITHUB_TOKEN` | — (done) | 34285, merged #182 | +| U4 | Legacy tag push (PAT, triggers `fe-release.yml`) | `fe-tag.yml:19-61` | `GIT_USER_TOKEN` PAT + `GIT_USER*` | Retire: consumers migrate to `fe-release-flow.yml` (U1). No in-place migration, because a `GITHUB_TOKEN` tag would not trigger the legacy consumer. | Consumer rollout (34287 pilot); 33676 removes the PAT from the reference repo | +| U5 | Release flow git identity | `fe-release-flow.yml:24-27,140-146` | `GIT_USER*` (identity only) | Delete the step and declarations (lightweight tag, identity never used), or use `github-actions[bot]` | PFM-ISSUE-34286 (overlaps with 33676) | +| U6 | Upmerge check git identity | `fe-check-upmerge.yml:5-11,34-39`, `upmerge.ts:12-21`, template `:16-19` | `GIT_USER*` (identity only) | `github-actions[bot]` identity. Checkout already uses `GITHUB_TOKEN`. Narrow the template to `contents: read`. | **Unowned → 33676** | +| U7 | PR "published artifacts" comment | `fe-pr-snapshot.yml:75-89` | `GITHUB_TOKEN` | — (done). Verify with `pull-requests: write`. | Verify in 33676 | +| U8 | Cross-repo checkout for e2e | not in this repo | ? | GitHub App via `actions/create-github-app-token`, if it exists in a consumer repo | Open question | +| U9 | Docs | `README.md:83-91` | — | Remove `GIT_USER*` from the required secrets once U5/U6 land. Document secret deletion per repo. | 33676 / 34286 | + +## Code References +- `.github/workflows/fe-tag.yml:19-24` - `GIT_USER_TOKEN`/`GIT_USER`/`GIT_USER_EMAIL` declarations +- `.github/workflows/fe-tag.yml:30-31` - deprecation warning +- `.github/workflows/fe-tag.yml:33-37` - checkout with the PAT, which is saved and reused for the push +- `.github/workflows/fe-tag.yml:48-51` - unquoted git identity from secrets +- `tools/scripts/artifacts/artifacts-handler.ts:203-223` - `ONLY_BUMP_VERSION` tag and push (legacy) +- `tools/scripts/artifacts/artifacts-handler.ts:311-313` - `RELEASE_FLOW` tag and push (current) +- `.github/workflows/fe-release-flow.yml:24-27` - `GIT_USER`/`GIT_USER_EMAIL` declarations +- `.github/workflows/fe-release-flow.yml:57-66` - guard that fails while consumers still call `fe-tag.yml@`/`fe-release.yml@` +- `.github/workflows/fe-release-flow.yml:108-118` - `release` job, `contents: write`, default-token checkout +- `.github/workflows/fe-release-flow.yml:140-146` - "Configure git user" step +- `.github/workflows/fe-release-flow.yml:195-219` - GitHub release with `github.token` +- `.github/workflows/fe-check-upmerge.yml:5-11,18-21,34-39` - upmerge secrets, checkout (undeclared `inputs.GHA_REF`), env pass-through +- `.github/actions/upmerge/action.yml:1-13` - upmerge composite (`printenv`, `npm ci`, cplace-cli, ts-node) +- `tools/scripts/upmerge/upmerge.ts:12-21` - global git identity from `GIT_USER*` +- `tools/scripts/upmerge/upmerge.ts:26-61` - `cplace-cli flow --upmerge --no-push` +- `tools/scripts/upmerge/upmerge.ts:63-91` - Slack notification +- `.github/workflow-templates/fe/fe-check-upmerge.yml:7-19` - four-scope permissions, explicit `GIT_USER*` +- `.github/workflow-templates/fe/fe-release.yml:1-5,18-19,32` - header (GITHUB_TOKEN tag starts no workflow), `contents: write`, `secrets: inherit` +- `.github/workflows/fe-pr-snapshot.yml:75-89` - PR comment through `github-script` with the default token +- `README.md:52-58,66-67,83-98,156` - migration, deprecation, required secrets, tag rulesets, release token + +## Architecture Insights +- **`GITHUB_TOKEN` first, a GitHub App only where it can't work.** The FE workflows follow the backend precedent (`cplace-gh-workflows` commit 18ea38f3), which dropped the PAT for `GITHUB_TOKEN`. The backend uses Apps only for cross-repo reads (`SVA_ACTIONS_READ_PRODUCT_*`), pushes to protected branches that need a bypass (`SVA_ACTIONS_UPMERGE_*`), cross-repo PR comments (`SVA_ACTIONS_PR_WRITER_*`) and pushes that must trigger workflows (`SVA_CONTAINER_BUILD_BOT_*`). None of these cases is left in this repo's FE workflows. +- **`GITHUB_TOKEN` pushes start no workflows.** This is why the PAT existed (`fe-tag.yml` → tag-push → `workflows/fe-release.yml`). The consolidated `fe-release-flow.yml` (#183) removed the dependency on that trigger, and that change is what made the token swap possible. +- **The caller's permissions are a ceiling.** A reusable job that asks for more than its caller grants fails at startup (34282 live test R5). Adding new scopes to reusables means editing every caller, so reusables should only narrow. +- **`secrets: inherit` makes removing secrets easy.** Only the `fe-release` template uses it. The other templates, and external callers such as cplace-fe, pass secrets explicitly, so removing a `required` declaration has to be coordinated with callers that pass it. +- **Old and new flows run side by side.** A repo can't delete `GIT_USER_TOKEN` until none of its branches, release lines included, calls the deprecated reusables. + +## Historical Context (from specs/) +- `specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/research.md`, `design.md`, `plan.md`, `live-test-plan.md`: moved the release tag push to `GITHUB_TOKEN` with `contents: write` and removed `GIT_USER_TOKEN` from the flow. It rejected the `checks`/`pull-requests` baseline, deferred `GIT_USER*` removal to 34286 and template least-privilege to 35504, and left `fe-tag.yml` on the PAT on purpose. It was live-tested in `collaborationFactory/clone-cplace-fe` (R0-R5 passed). **R6 (release with `GIT_USER_TOKEN` deleted) was skipped**, so running without the PAT secret was never proven live. `research.md:278` names `fe-pr-snapshot` as "the PR-decoration part of 33676". +- `specs/2026-10-12_PFM-ISSUE-34283_consolidate-fe-release-workflow/research.md:49-50,281`: places 33676 under epic WP-1963 and expects tag creation and PR decoration to map to `GITHUB_TOKEN` and the cross-repo e2e checkout to a GitHub App. It notes "No spec yet covers PFM-ISSUE-33676". `design.md:82-85,97` covers identity deferral and the note on a future `version/*` tag ruleset (bypass actor = GitHub Actions, not `squad-fe`). `clone-cplace-fe-live-tests.md` describes the test-fork protocol. +- `specs/2026-06-05_node24-workflow-migration/plan.md:244-264`: moved the PR comment to `github-script` with the default token. `design.md:62`/`plan.md:418`: `fe-check-upmerge` was never live-tested. `validation-log.md:33-41`: never test on real `release/*` branches. +- `specs/2026-11-16_PFM-ISSUE-34301_third-party-npm-registries-jfrog/`: not related to GitHub auth. It touches upmerge only for `npm ci`/`.npmrc`. + +## Related Research +- `specs/2026-10-26_PFM-ISSUE-34282_github-token-scoped-permissions/research.md` +- `specs/2026-10-12_PFM-ISSUE-34283_consolidate-fe-release-workflow/research.md` +- `specs/2026-06-05_node24-workflow-migration/research.md` + +## Open Questions +1. **Reference repository for acceptance criteria 2 and 3.** The candidates: + - `collaborationFactory/clone-cplace-fe`, the test fork used by 34282/34283; + - `cplace-remote-filesystem-fe`, the 34287 pilot and node24 validation repo; + - `cplace-fe` itself. + + Criterion 3 ("no longer used in that reference repository") means auditing that repo's **own** workflow files, including direct `GIT_USER*` use, `squad-fe` pusher guards and any cross-repo checkout, and deleting the `GIT_USER_TOKEN`/`GIT_USER`/`GIT_USER_EMAIL` repo secrets. That also covers the R6 test that 34282 skipped. +2. **Cross-repo e2e checkout (U8).** Does any FE consumer repo check out another repo (for example `cplace-e2e` or test data) with the shared account? It doesn't happen in this repo. If it exists, a GitHub App is needed. Is there an existing App (for example the backend's `SVA_ACTIONS_READ_PRODUCT_*`) that can be reused for FE repos, or does a new one have to be requested? +3. **Overlap with PFM-ISSUE-34286.** Should 33676 also take over removing the release flow's git identity (U5), or only handle upmerge (U6) and leave U5 to 34286? +4. **Removing `required` secret declarations.** Callers that pass secrets explicitly (cplace-fe, the 2lforge repo, the `fe-check-upmerge` template) might fail if `GIT_USER*` is removed from `workflow_call.secrets` while they still pass it. The 34282 research's Open Q10 lists a related case to verify: cplace-fe `push_main.yaml` passes `GIT_USER_TOKEN` to `fe-snapshot.yml`, which no longer declares it. Options: make the declarations `required: false` first, then remove them later. +5. **Does upmerge need any identity?** The guess is that `cplace-cli flow --upmerge --no-push` creates local merge commits, which need `user.name`/`user.email`. This needs checking in `@cplace/cli` to decide between "bot identity" and "no identity". +6. **Retiring `fe-tag.yml`/`workflows/fe-release.yml`.** When can they be deleted (after release lines 25.4-26.4 reach end of life)? Is that in scope for 33676, or a separate cleanup? +7. **Side findings in upmerge, not about authentication but in the files being touched:** the undeclared `inputs.GHA_REF` (`fe-check-upmerge.yml:20`), the hard-coded `--release 5.17` (`upmerge.ts`), unquoted `git config` arguments, and `printenv` in the composite action. +8. **Template permissions for upmerge.** Should narrowing the `fe-check-upmerge` template to `contents: read` be done here, or left to PFM-ISSUE-35504? diff --git a/tools/scripts/upmerge/upmerge.test.ts b/tools/scripts/upmerge/upmerge.test.ts index 22fa0c08..6e5769b9 100644 --- a/tools/scripts/upmerge/upmerge.test.ts +++ b/tools/scripts/upmerge/upmerge.test.ts @@ -62,3 +62,27 @@ test('returns error message with correct repo name in link', async () => { 'There was an error running cplace-cli in repo https://github.com/collaborationFactory/cplace-paw-fe.git:\n\nhttps://github.com/collaborationFactory/cplace-paw-fe/actions/runs/123456' ); }); + +test('does not configure a git identity', async () => { + const execSpy = jest + .spyOn(child_process, 'execSync') + // cast: execSync is overloaded; ts-jest type-checks the test + .mockImplementation(((cmd: string) => + cmd.startsWith('git config --get remote.origin.url') + ? 'https://github.com/collaborationFactory/cplace-fe.git' + : 'Merging upmerge-x/release/24.1 into origin/main\n') as any); + const handler = new UpmergeHandler(); + const slackSpy = jest + .spyOn(handler, 'postToSlack') + .mockResolvedValue(undefined); + + await handler.checkUpmergeAndNotifiy(); + + const commands = execSpy.mock.calls.map(([cmd]) => String(cmd)); + expect( + commands.some((c) => c.includes('user.name') || c.includes('user.email')) + ).toBe(false); + expect(slackSpy).toHaveBeenCalledWith({ message: '' }); + execSpy.mockRestore(); + slackSpy.mockRestore(); +}); diff --git a/tools/scripts/upmerge/upmerge.ts b/tools/scripts/upmerge/upmerge.ts index 349dd719..9059aa4a 100644 --- a/tools/scripts/upmerge/upmerge.ts +++ b/tools/scripts/upmerge/upmerge.ts @@ -9,16 +9,6 @@ interface SlackPost { export class UpmergeHandler { public async checkUpmergeAndNotifiy() { - console.log( - execSync( - `git config --global user.email ${process.env.GIT_USER_EMAIL}` - ).toString() - ); - console.log( - execSync( - `git config --global user.name ${process.env.GIT_USER}` - ).toString() - ); const slackMessage = this.isUpmergeNeeded(); await this.postToSlack(slackMessage); } From 4629f38509250b596c1813e264b7aefd8243abf6 Mon Sep 17 00:00:00 2001 From: Vladimir Arsov Date: Mon, 30 Nov 2026 13:41:16 +0100 Subject: [PATCH 2/2] PFM-ISSUE-33676 - Record live-test evidence and the AC1 usage mapping - live-test-log.md: clone-cplace-fe runs L0-L4 (release, upmerge, PR snapshot comment, main CI without GIT_USER* secrets) and H0-H4 (App-token heal through an App-only bypass ruleset, loop-break, cleanup). - research.md: addendum with the final usage -> replacement mapping (U1-U17, owners) and the audit of the 15 FE repos. - plan.md: progress, deviations and checkpoint approvals. Co-Authored-By: Claude Opus 5.5 --- .../live-test-log.md | 72 +++++++++++++++++++ .../plan.md | 62 +++++++++------- .../research.md | 71 ++++++++++++++++++ 3 files changed, 179 insertions(+), 26 deletions(-) create mode 100644 specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/live-test-log.md diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/live-test-log.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/live-test-log.md new file mode 100644 index 00000000..15a146cc --- /dev/null +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/live-test-log.md @@ -0,0 +1,72 @@ +# PFM-ISSUE-33676 live-test log (clone-cplace-fe) + +Repo: `collaborationFactory/clone-cplace-fe`. Test branch in github-actions: `test/PFM-ISSUE-33676-bot-identity` +(Phase 1 commit, plus a ref rewrite to itself, plus the e2e job and the `RUN_E2E` input dropped by hand, because the +cherry-pick of the 34282 e2e-drop commit conflicted). + +## Setup (2026-11-27) + +One commit per clone branch, "PFM-ISSUE-33676 - Drop shared-account secrets and squad-fe identity (test branch …)": + +| Branch | Changes | +|---|---| +| `release/26.4` | `cron_check_upmerge.yaml` → `@test/PFM-ISSUE-33676-bot-identity`, without `GIT_USER*`. `deploy_storybook.yaml` → `github-actions[bot]`. `fe-release.yml` → `@test/PFM-ISSUE-33676-bot-identity`, with `RUN_E2E: false` commented out (deviation from the plan: the test branch drops the input, so passing it would fail validation). `push_main.yaml` without `GIT_USER_TOKEN` (`fe-snapshot.yml@release/26.4` declares it optional). | +| `release/26.3` | Same, except that `fe-release.yml` had no active `RUN_E2E`. Its old ref was the 34283 test branch. | +| `main` | `cron_check_upmerge.yaml` and `deploy_storybook.yaml` only. The 34282/34293 test refs are untouched. | + +## L0 — pushes, with the secrets still present + +| ID | Run | Branch | Result | +|---|---|---|---| +| L0a | 46025367521 | `release/26.4` | success. guard, install-deps, build and release succeeded. github-release was skipped and no tag was created (latest is still `version/26.4.12`), so nothing was affected, as expected. | +| L0b | 46025377463 | `release/26.3` | success. Same jobs as L0a. github-release was skipped and no new tag was created (`version/26.3.1` is older and points at the previous head). | +| L0c | 46025386669 | `main` (Frontend Main CI) | success. install-deps, build and snapshot all succeeded. | + +`SLACK_TOKEN_UPMERGE` was set to a dummy value by the user on 2026-11-27. + +## Secrets deleted (2026-11-27) + +After L0 passed, the user deleted `GIT_USER_TOKEN`, `GIT_USER` and `GIT_USER_EMAIL`. Afterwards, +`gh secret list -R collaborationFactory/clone-cplace-fe | grep -E "^GIT_USER"` printed nothing. + +## L1–L4 — with the secrets deleted + +| ID | Run | Trigger | Result | +|---|---|---|---| +| L1 Release | 46057064738 | `fe-release.yml` dispatch on `release/26.4`, `force=true` | success. guard, install-deps, build, release and github-release all succeeded. `Uses: …fe-release-flow.yml@refs/heads/test/PFM-ISSUE-33676-bot-identity (6a8808e)`. "Configure git user" ran with the fixed `github-actions[bot]` values and no secret env. `refs/tags/version/26.4.13` is lightweight (`object.type = commit`, `d5b628a55`). The release author is `github-actions[bot]`. There was no "Secret … is required" error. | +| L2 Upmerge | 46057069124 → **46057315523** | `cron_check_upmerge.yaml` dispatch on `main` | success (see the notes below). `Uses: …fe-check-upmerge.yml@refs/heads/test/PFM-ISSUE-33676-bot-identity`. "Configure git identity" ran. Slack failed with `invalid_auth`, as expected, and the log ends with `finished upmerge workflow`. | +| L3 Snapshot PR | 46057137170 | PR [#5](https://github.com/collaborationFactory/clone-cplace-fe/pull/5) from `test/33676-snapshot`, label `snapshot` (added through REST; `gh pr edit` failed on a GraphQL Projects-classic deprecation error) | success. Exactly one comment, by `github-actions[bot]`, containing ``. It lists the `0.0.0-test-33676-snapshot-5` versions. PR closed and branch deleted afterwards (close/cleanup run 46059569820). | +| L4 Main push | 46057190970 | Empty commit "33676 L4: main CI without GIT_USER secrets" on `main` | success. install-deps, build and snapshot all succeeded. | + +### L2 notes + +- **First attempt (46057069124), invalid.** cplace-cli refused with `current branch is 1 commits behind origin/main`, because + the L4 push landed on `main` between the dispatch checkout and the CLI's fetch. It was re-dispatched once `main` was + stable. +- **Retry (46057315523).** cplace-cli reported `Merge failed when merging upmerge-…/release/26.4`, so there was no + `cliResult:` line. That is a content conflict that already existed in the clone: `release/26.4` and `main` each add + their own `fe-release.yml` (add/add). `git merge-tree` shows the same conflict at the pre-33676 heads (`bf607143b` + and `c65717355`). The preceding `release/26.3 → release/26.4` step does succeed, and it is a real merge commit + (reproduced locally), which git can create only with an author identity. So the `github-actions[bot]` identity was + exercised and there was no identity error. The plan's `cliResult:` expectation is not met, for this unrelated + reason. + +## Phase 3 — heal with the App token + +cplace-fe `improvement/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend` commit "PFM-ISSUE-33676 - Push +visual-baseline heals with the sva-actions-upmerge App and drop the squad-fe storybook identity" (local, not pushed +yet). `node --test .github/scripts/*.test.mjs` gives 15/15. actionlint is clean on the heal workflow. Its two findings +on `deploy_storybook.yaml` (`runs-on: medium`, `setup-node@v3`) are identical on `origin/main` and unrelated. + +| ID | Run / evidence | Result | +|---|---|---| +| H0 | Clone `main` commits "33676 H0: add the heal-visual-baselines workflow from cplace-fe (App token)" and "33676 H0: force visual drift for the heal test" (`accordion.cy.ts-types.png` copied over `accordion.cy.ts-states.png`). Heal run 46068133820, main CI 46068134372. | The workflow is byte-identical to cplace-fe `FB`. The gate reported `event=push proceed=false apps=[] reason=not an upmerge commit`, and heal was skipped. | +| H1a–c | Run by the user on 2026-11-27 | The clone was added to installation 126667289 and to the selected repos of `SVA_ACTIONS_UPMERGE_ID`/`_KEY`. Ruleset **28262840** `33676-heal-test` is active on `~DEFAULT_BRANCH` with rules `pull_request`, `non_fast_forward` and `deletion`. Its only bypass actor is the Integration 3487076. All three were verified read-only. | +| H1d | Empty commit pushed with the user's credentials | **Rejected**: `GH013: Repository rule violations found for refs/heads/main … Changes must be made through a pull request.` The local branch was reset to `origin/main`. | +| H2 | 46069252083 (`workflow_dispatch`, app=helles-ui-visual-e2e, ref=main) | success. The gate reported `event=workflow_dispatch proceed=true apps=["helles-ui-visual-e2e"] reason=workflow_dispatch override`. Both renders failed (`1 failing`; each step exited 1 under `continue-on-error`). "Get sva-actions-upmerge token" succeeded. The push log shows `remote: Bypassed rule violations for refs/heads/main: - Changes must be made through a pull request.` and then `6b6d64e95..e753f8fa9 HEAD -> main`. The heal commit `e753f8fa9` "chore: heal visual baselines for helles-ui-visual-e2e [skip visual-heal]" has author and committer `sva-actions-upmerge[bot] <278916743+sva-actions-upmerge[bot]@users.noreply.github.com>` (GitHub `author.login = sva-actions-upmerge[bot]`). It changes only `apps/helles-ui-visual-e2e/visual-regression/baseline/accordion.cy.ts-states.png` (8222 → 23722 bytes; a fresh CI render, not byte-identical to the pre-H0 file). "Announce heal" ran with the dummy token. The Slack action is configured with `errors: false`, so it does not fail. | +| H3 | 46071111582 (push of `e753f8fa9`) | success. The gate reported `event=push proceed=false apps=[] reason=loop-break: heal marker present`, and heal was skipped. Main CI 46071111820 also succeeded. | +| H4 | Run by the user, 2026-11-30 | Ruleset 28262840 deleted (`gh api repos/…/rulesets --jq length` → `0`). The clone was removed from installation 126667289 and from the selected repos of `SVA_ACTIONS_UPMERGE_ID`/`_KEY`. All verified read-only. The heal workflow stays in the clone. | + +## cplace-fe PR + +[cplace-fe#3101](https://github.com/collaborationFactory/cplace-fe/pull/3101), opened 2026-11-30 from `improvement/PFM-ISSUE-33676-Replace-shared-GitHub-user-account-in-frontend`. diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md index c6763416..ebde0e18 100644 --- a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/plan.md @@ -365,28 +365,35 @@ Record run IDs and results in a new file `specs/2026-11-26_PFM-ISSUE-33676_repla ### Success Criteria: #### Automated Verification: -- [ ] The test branch refs point at itself. This prints nothing: +- [x] The test branch refs point at itself. This prints nothing: `git -C $GA grep -nE 'collaborationFactory/github-actions/\.github/.+@' origin/$TEST_BRANCH -- .github/workflows .github/actions | grep -v "@$TEST_BRANCH"` -- [ ] The test branch differs from `FB` only by the ref rewrite and the e2e drop: +- [x] The test branch differs from `FB` only by the ref rewrite and the e2e drop: `git -C $GA diff --stat origin/$FB origin/$TEST_BRANCH` -- [ ] No shared-account secret left. This prints nothing: `gh secret list -R $R | grep -E "^GIT_USER"` -- [ ] No clone branch references them. This prints nothing: +- [x] No shared-account secret left. This prints nothing: `gh secret list -R $R | grep -E "^GIT_USER"` +- [x] No clone branch references them. This prints nothing: `for b in main release/26.4 release/26.3; do git -C $CL grep -nE 'secrets\.GIT_USER|GIT_USER_TOKEN|user\.name +squad-fe' origin/$b -- .github; done` -- [ ] L0a, L0b, L0c, L1, L2, L3 and L4 all concluded `success`: `gh run view -R $R --json conclusion` -- [ ] The L1 tag exists and is lightweight: +- [x] L0a, L0b, L0c, L1, L2, L3 and L4 all concluded `success`: `gh run view -R $R --json conclusion` + - Deviations: the clone's `release/26.4` `fe-release.yml` had its `RUN_E2E: false` commented out (the test branch + drops that input). The e2e drop was redone by hand because the cherry-pick of `52aca8a` conflicted. The secrets were + set and deleted by the user (the auto-mode classifier blocks `gh secret` writes). The first L2 dispatch was + invalidated by the L4 push and re-run. +- [x] The L1 tag exists and is lightweight: `gh api repos/$R/git/refs/tags/version/26.4.13 --jq .object.type` prints `commit` -- [ ] The L1 release is authored by the bot: +- [x] The L1 release is authored by the bot: `gh api repos/$R/releases/tags/version/26.4.13 --jq .author.login` prints `github-actions[bot]` -- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 2 complete. Summary: TEST_BRANCH +- [x] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 2 complete. Summary: TEST_BRANCH pushed, all three clone branches free of GIT_USER*/squad-fe, the three secrets deleted, and release 26.4.13, upmerge check, snapshot PR comment and main CI all passed (run IDs in live-test-log.md). Please review and reply 'yes' to continue to Phase 3." Do NOT proceed until the user explicitly approves. This checkpoint cannot be skipped or pre-checked. #### Manual Verification: -- [ ] The L2 log shows cplace-cli processed the clone's release chain (`release/26.3` → `release/26.4` → `main`) +- [x] The L2 log shows cplace-cli processed the clone's release chain (`release/26.3` → `release/26.4` → `main`) without an identity error. -- [ ] The L3 PR comment lists the published snapshot versions. + - Partly met: `26.3 → 26.4` merged (a real merge commit), and `26.4 → main` stopped on an add/add conflict in + `fe-release.yml` that predates 33676. There is no `cliResult:` line. Details are in `live-test-log.md` under + "L2 notes". +- [x] The L3 PR comment lists the published snapshot versions. --- @@ -512,21 +519,24 @@ PR. ### Success Criteria: #### Automated Verification: -- [ ] cplace-fe heal gate tests still pass: `node --test .github/scripts/` in `CFE` on `FB` -- [ ] actionlint is clean: `~/go/bin/actionlint .github/workflows/heal-visual-baselines.yml .github/workflows/deploy_storybook.yaml` in `CFE` -- [ ] No shared-account reference is left in either cplace-fe file. This prints nothing: +- [x] cplace-fe heal gate tests still pass: `node --test .github/scripts/` in `CFE` on `FB` + - On Windows a directory argument fails to load; `node --test .github/scripts/*.test.mjs` gives 15/15. +- [x] actionlint is clean: `~/go/bin/actionlint .github/workflows/heal-visual-baselines.yml .github/workflows/deploy_storybook.yaml` in `CFE` + - The heal workflow is clean. `deploy_storybook.yaml` has two findings (`runs-on: medium`, `setup-node@v3`) that are + identical on `origin/main`, on lines this change does not touch. +- [x] No shared-account reference is left in either cplace-fe file. This prints nothing: `git -C $CFE grep -nE "GIT_USER|squad-fe" $FB -- .github/workflows/heal-visual-baselines.yml .github/workflows/deploy_storybook.yaml` -- [ ] The clone copy is identical: +- [x] The clone copy is identical: `git -C $CFE show $FB:.github/workflows/heal-visual-baselines.yml | diff - <(git -C $CL show origin/main:.github/workflows/heal-visual-baselines.yml)` -- [ ] The H2 run succeeded, and its heal commit on clone `main` is authored by the App bot: +- [x] The H2 run succeeded, and its heal commit on clone `main` is authored by the App bot: `git -C $CL log -1 --format='%an <%ae> %s' origin/main` shows `sva-actions-upmerge[bot] <278916743+sva-actions-upmerge[bot]@users.noreply.github.com>` and `[skip visual-heal]` -- [ ] H3's gate output contains `loop-break: heal marker present`: `gh run view

-R $R --log | grep "reason=loop-break"` -- [ ] H1d was rejected: the recorded push output contains `GH013` / "repository rule violations" -- [ ] H4 restored the access: +- [x] H3's gate output contains `loop-break: heal marker present`: `gh run view

-R $R --log | grep "reason=loop-break"` +- [x] H1d was rejected: the recorded push output contains `GH013` / "repository rule violations" +- [x] H4 restored the access: `gh api --paginate user/installations/126667289/repositories --jq '.repositories[].name' | grep -x clone-cplace-fe` prints nothing, `gh api repos/$R/rulesets --jq length` prints `0`, and `gh api orgs/collaborationFactory/actions/secrets/SVA_ACTIONS_UPMERGE_ID/repositories --jq '.repositories[].name' | grep -x clone-cplace-fe` prints nothing -- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 3 complete. Summary: heal +- [x] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 3 complete. Summary: heal workflow now pushes with a just-in-time sva-actions-upmerge token and storybook commits as github-actions[bot]; in clone-cplace-fe a forced drift was healed through a ruleset that only the App can bypass, the loop-break skipped the heal commit, temporary App/secret/ruleset access was removed, and the cplace-fe PR is open. Please @@ -534,7 +544,7 @@ PR. cannot be skipped or pre-checked. #### Manual Verification: -- [ ] The healed baseline commit in the clone changes only `apps/helles-ui-visual-e2e/visual-regression/baseline/`. +- [x] The healed baseline commit in the clone changes only `apps/helles-ui-visual-e2e/visual-regression/baseline/`. - [ ] After the cplace-fe PR merges, the next scheduled storybook run on cplace-fe makes its `gh-pages` merge commit as `github-actions[bot]`: `git log -1 --format='%an <%ae>' origin/gh-pages`. @@ -586,17 +596,17 @@ changed. ### Success Criteria: #### Automated Verification: -- [ ] The addendum exists: `grep -n "Final usage → replacement mapping" specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md` -- [ ] All 15 repos appear in the audit table: +- [x] The addendum exists: `grep -n "Final usage → replacement mapping" specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md` +- [x] All 15 repos appear in the audit table: `for r in cplace-e2e cplace-2lforge-toolbar-fe cplace-2lforge-trees-fe cplace-citizen-ai-fe cplace-dataciders-portfolio-management-fe cplace-fe cplace-loomeo-fe cplace-lowcode-widget-builder-fe cplace-office-reports-fe cplace-paw-fe cplace-project-planning-fe cplace-remote-filesystem-fe cplace-resource-management-fe cplace-time-bounded-values-fe cplace-workflow-fe; do grep -q "| $r " specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md || echo "missing $r"; done` prints nothing -- [ ] The research frontmatter is unchanged: `git diff HEAD -- specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md | grep -E "^[-+](git_commit|date):"` prints nothing -- [ ] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 4 complete. Summary: 15-repo audit +- [x] The research frontmatter is unchanged: `git diff HEAD -- specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md | grep -E "^[-+](git_commit|date):"` prints nothing +- [x] **HUMAN CHECKPOINT**: Call `AskUserQuestion` now with the question: "Phase 4 complete. Summary: 15-repo audit done and the final AC1 usage mapping (U1–U16+) added to research.md with owners. Please review and reply 'yes' to finish." Do NOT proceed until the user explicitly approves. This checkpoint cannot be skipped or pre-checked. #### Manual Verification: -- [ ] Every mapping row has a replacement and an owner (this ticket, 34281, 35504 or migration/cleanup). -- [ ] The migration/cleanup ticket's scope can be copied from the "owner = migration/cleanup" rows. +- [x] Every mapping row has a replacement and an owner (this ticket, 34281, 35504 or migration/cleanup). +- [x] The migration/cleanup ticket's scope can be copied from the "owner = migration/cleanup" rows. --- diff --git a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md index b771f6fc..0d44a9a7 100644 --- a/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md +++ b/specs/2026-11-26_PFM-ISSUE-33676_replace-shared-github-user/research.md @@ -214,3 +214,74 @@ Caller templates (`.github/workflow-templates/fe/`): 6. **Retiring `fe-tag.yml`/`workflows/fe-release.yml`.** When can they be deleted (after release lines 25.4-26.4 reach end of life)? Is that in scope for 33676, or a separate cleanup? 7. **Side findings in upmerge, not about authentication but in the files being touched:** the undeclared `inputs.GHA_REF` (`fe-check-upmerge.yml:20`), the hard-coded `--release 5.17` (`upmerge.ts`), unquoted `git config` arguments, and `printenv` in the composite action. 8. **Template permissions for upmerge.** Should narrowing the `fe-check-upmerge` template to `contents: read` be done here, or left to PFM-ISSUE-35504? + +## Addendum (2026-11-30): Final usage → replacement mapping (AC1) + +This addendum records the final state after implementation and the read-only audit of the 15 FE repos. The live +evidence for AC2/AC3 (release, upmerge, PR snapshot comment, main CI and App-token heal, all in `clone-cplace-fe` +with the `GIT_USER*` secrets deleted) is in [`live-test-log.md`](./live-test-log.md). + +**Typo in the design:** the `github-actions[bot]` user id is **41898282** +(`gh api users/github-actions%5Bbot%5D`), not `41898828` as written in `design.md`. The noreply address used +everywhere is `41898282+github-actions[bot]@users.noreply.github.com`. + +### Mapping + +Owners: **33676** is this ticket. **cleanup** is the FE migration/cleanup ticket. + +| # | Use | Where | Replacement | Status | Owner | +|---|---|---|---|---|---| +| U1 | Release tag push | `fe-release-flow.yml` | `GITHUB_TOKEN` | Done. Re-verified in L1 with the secrets deleted (lightweight tag `version/26.4.13`). | 34282 (#189) | +| U2 | GitHub release creation | `fe-release-flow.yml` | `GITHUB_TOKEN` | Done. In L1 the release author is `github-actions[bot]`. | 34283 (#183) | +| U3 | Snapshot workflow checkout | `fe-snapshot.yml` | `GITHUB_TOKEN` | Done. Re-verified in L4. | 34285 (#182) | +| U4 | Legacy tag push via PAT, which triggers the deprecated `workflows/fe-release.yml` | `fe-tag.yml` | Retired by migrating consumers to `fe-release-flow.yml` | Open. See U13. | cleanup | +| U5 | Release flow git identity | `fe-release-flow.yml` "Configure git user" | Fixed `github-actions[bot]`. The secrets are `required: false` and unused. | Done. Verified in L1. | 33676 | +| U6 | Upmerge check git identity | `fe-check-upmerge.yml`, `upmerge.ts`, upmerge caller template | Fixed `github-actions[bot]` (`--global`). `upmerge.ts` no longer runs `git config`. The template no longer passes `GIT_USER*`. | Done. Verified in L2, where the identity was exercised by the `26.3 → 26.4` merge commit. | 33676 | +| U7 | PR "published artifacts" comment | `fe-pr-snapshot.yml` | `GITHUB_TOKEN` | Done. Verified in L3 (one comment by `github-actions[bot]`). | 33676 (verification) | +| U8 | Cross-repo checkout for e2e | cplace-fe `devkit-test-template.yaml` (the only one across the 15 repos) | `sva-actions-read-product-fe` App token | Done. Confirmed by the audit. | 34281 | +| U9 | Docs | `README.md` "Required secrets" | `GIT_USER*` removed from the required secrets. Says the bot identity is set by the flow, and when a repo can delete each secret. | Done | 33676 | +| U10 | cplace-fe visual-baseline heal push | cplace-fe `heal-visual-baselines.yml` | Just-in-time `sva-actions-upmerge` App token; commit as `sva-actions-upmerge[bot]`; heal job `contents: read` | Done in [cplace-fe#3101](https://github.com/collaborationFactory/cplace-fe/pull/3101). Verified in H1d/H2/H3 (ruleset bypass, loop-break). | 33676 | +| U11 | cplace-fe storybook `gh-pages` merge identity | cplace-fe `deploy_storybook.yaml` | `github-actions[bot]` | Done in cplace-fe#3101. The first post-merge `gh-pages` commit is still to be checked. | 33676 | +| U12 | Heal gate `BOT_EMAIL` | cplace-fe `heal-visual-baselines.yml` gate step | Dropped. The gate never used it on dispatch, and loop-break uses the `[skip visual-heal]` marker. | Done in cplace-fe#3101 (heal-gate tests 15/15) | 33676 | +| U13 | `fe-tag.yml` callers that pass `GIT_USER_TOKEN`/`GIT_USER`/`GIT_USER_EMAIL`, and the deprecated `workflows/fe-release.yml` callers that it triggers | All 14 `frontend-product` repos (see the audit table) | Migrate each repo to `fe-release-flow.yml`. Then delete `fe-tag.yml` and the deprecated `workflows/fe-release.yml`. | Open | cleanup | +| U14 | Explicit `GIT_USER_EMAIL`/`GIT_USER` passes to `fe-check-upmerge.yml` | cplace-fe, cplace-paw-fe, cplace-office-reports-fe, cplace-workflow-fe | Drop the two lines from each caller. They still validate against the optional declarations, so this is not urgent. | Open | cleanup | +| U15 | cplace-fe `squad-fe` pusher guard | cplace-fe `push_to_release.yaml:43` (`github.event.pusher.name != 'squad-fe'`) | Remove together with the cplace-fe `fe-tag.yml` call (U13) | Open | cleanup | +| U16 | Optional, unused `GIT_USER`/`GIT_USER_EMAIL` declarations | `fe-check-upmerge.yml`, `fe-release-flow.yml` | Remove from `workflow_call.secrets` once U14 and the release-flow callers no longer pass them | Open | cleanup | +| U17 | `GIT_USER*` repo secrets | every FE repo except `clone-cplace-fe` (deleted there by 33676) | Delete `GIT_USER`/`GIT_USER_EMAIL` after U14. Delete `GIT_USER_TOKEN` after U13. | Open | cleanup | + +**Note on the deprecated `workflows/fe-release.yml`:** it does not read `GIT_USER_TOKEN` itself. It depends on the PAT +only because it is triggered by the tag that `fe-tag.yml` pushes with the PAT (a `GITHUB_TOKEN` tag push would not +trigger it). So `GIT_USER_TOKEN` can go once `fe-tag.yml` is no longer called, which is what the README rule says. + +Not in scope, and not a credential or a git identity: `squad-fe` as the npm `package.json` `author` in +`tools/scripts/artifacts/nx-project.ts`. The comment in clone-cplace-fe's test-only `zz-tag-push-canary.yml` is also +excluded. + +### Audit of the 15 FE repos (default branch, 2026-11-30) + +Method: a shallow clone of each default branch, then +`git grep -nE 'GIT_USER(_TOKEN|_EMAIL)?\b|squad-fe|repository:|git clone|gh repo clone|create-github-app-token|fe-tag\.yml|workflows/fe-release\.yml|fe-check-upmerge\.yml|fe-release-flow\.yml' HEAD -- .github`. +No repo calls `fe-release-flow.yml` on its default branch yet. + +| Repo | Default branch @ commit | `fe-tag.yml` + `GIT_USER*` (U13) | Deprecated `workflows/fe-release.yml` (U13) | Explicit `GIT_USER*` upmerge pass (U14) | `squad-fe` | Cross-repo checkout / App token | +|---|---|---|---|---|---|---| +| cplace-e2e | `master` @ 4e631e6 | none | none | none | none | none | +| cplace-2lforge-toolbar-fe | `master` @ b514150 | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-2lforge-trees-fe | `master` @ 74acdd8 | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-citizen-ai-fe | `master` @ 01a2606 | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-dataciders-portfolio-management-fe | `main` @ 4265e0f | `fe-release.yml:30,38-40` | `fe-tag-pushed.yml:15` | none | none | none (the `.github/agents/*.md` hits are prose about "repository") | +| cplace-fe | `main` @ bd1924a | `push_to_release.yaml:44,53-55` | `on_tag_pushed.yaml:20` | `cron_check_upmerge.yaml:18-19` | `push_to_release.yaml:43` pusher guard (U15); `deploy_storybook.yaml:44` (U11, fixed in #3101) | `devkit-test-template.yaml:91,102` App tokens, `:115-151` five cross-repo checkouts (U8, done); `heal-visual-baselines.yml` `GIT_USER*` (U10/U12, fixed in #3101) | +| cplace-loomeo-fe | `main` @ 9f87bd5 | `release.yml:30,38-40` | `tag_pushed.yml:15` | none | none | none | +| cplace-lowcode-widget-builder-fe | `master` @ 703f3be | `fe-release.yml:43,51-53` | `fe-tag-pushed.yml:19` | none | none | none | +| cplace-office-reports-fe | `master` @ 3978df6 | `push_release.yml:39,47-49` | `tag_pushed.yml:15` | `cron_check_upmerge.yml:14-15` | none | none | +| cplace-paw-fe | `master` @ 5604748 | `fe-release.yml:43,51-53` | `fe-tag-pushed.yml:19` | `cron_check_upmerge.yaml:18-19` | none | none | +| cplace-project-planning-fe | `master` @ 5084a7f | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-remote-filesystem-fe | `master` @ 6b996fd | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-resource-management-fe | `master` @ 8159898 | `fe-release.yml:37,45-47` | `fe-tag-pushed.yml:13` | none | none | none | +| cplace-time-bounded-values-fe | `master` @ b7f0214 | `fe-release.yml:39,47-49` | `fe-tag-pushed.yml:15` | none | none | none | +| cplace-workflow-fe | `master` @ dd3225d | `push_release.yml:39,47-49` | `tag_pushed.yml:15` | `cron_check_upmerge.yml:14-15` | none | none | + +The audit matches the design. The only cross-repo checkout is cplace-fe's devkit e2e, which is already on an App +token. The explicit upmerge passes are exactly cplace-fe, cplace-paw-fe, cplace-office-reports-fe and +cplace-workflow-fe. No shared-account use was found outside the rows above. Release branches were not audited: they +follow the 34281 decision (frozen, covered by the cleanup ticket).