Skip to content

Commit aa21704

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/add-tests-issue-1276-cTfRS
# Conflicts: # CHANGELOG.md
2 parents ac24c2b + c52026c commit aa21704

26 files changed

Lines changed: 1875 additions & 341 deletions

.codecov.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,17 @@ flags:
4545
paths:
4646
- frontend/src/
4747
carryforward: true
48-
# Merged frontend flag uploaded by codecov-notify.yml after combining the
49-
# three per-suite lcovs (frontend-unit, frontend-component, frontend-e2e).
50-
# This is what the README badge reads so it reflects the union of all
51-
# frontend test suites, not just the Vitest slice. Intentionally does NOT
48+
# Merged frontend flag that the README badge reads. Populated by tagging
49+
# each per-suite upload (`frontend-unit`, `frontend-component`,
50+
# `frontend-e2e`) with `frontend` as an additional flag in its workflow,
51+
# so Codecov aggregates the union of the three uploads server-side.
52+
# `carryforward: true` is load-bearing — a backend-only commit path-filters
53+
# all three producing workflows out, so without carryforward the badge
54+
# would drop to "unknown" on those commits; with it, the flag reuses the
55+
# last known coverage from the parent commit. Intentionally does NOT
5256
# match the `frontend-.*` regex used by the component_management block
5357
# below, so the `frontend` component keeps aggregating only the three
54-
# per-suite flags and doesn't double-count this merged upload.
58+
# per-suite flags and doesn't double-count this merged flag.
5559
frontend:
5660
paths:
5761
- frontend/src/

.github/workflows/codecov-notify.yml

Lines changed: 5 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ name: Codecov Notify
88
# the triggering SHA. Workflows that skipped due to path filters don't block
99
# the notify step.
1010
#
11-
# This workflow also merges the three per-suite frontend lcov reports
12-
# (`frontend-unit-lcov`, `frontend-ct-lcov`, `frontend-e2e-lcov`, each
13-
# published as a GitHub Actions artifact by its producing job) into a
14-
# single lcov and uploads it to Codecov under the `frontend` flag. That
15-
# gives one authoritative Frontend coverage number — the README badge
16-
# reads it, and PR comments show the merged total alongside the per-suite
17-
# flags. The three individual flag uploads still happen in their own
18-
# workflows, so drill-in by suite continues to work.
11+
# The merged `frontend` flag that the README badge reads is produced
12+
# server-side: each per-suite frontend upload (`frontend-unit`,
13+
# `frontend-component`, `frontend-e2e`) is tagged with `frontend` as an
14+
# additional flag in its own workflow, so Codecov aggregates the union
15+
# of all three without any cross-workflow lcov merging here.
1916

2017
on:
2118
workflow_run:
@@ -60,7 +57,6 @@ jobs:
6057
);
6158
6259
let allDone = true;
63-
const runIds = {};
6460
for (const name of expected) {
6561
const matching = runs
6662
.filter((r) => r.name === name)
@@ -77,102 +73,13 @@ jobs:
7773
core.info(
7874
`${name}: status=${latest.status} conclusion=${latest.conclusion} id=${latest.id}`
7975
);
80-
runIds[name] = latest.id;
8176
if (latest.status !== "completed") {
8277
allDone = false;
8378
}
8479
}
8580
8681
core.setOutput("all_done", allDone ? "true" : "false");
8782
core.setOutput("sha", sha);
88-
core.setOutput(
89-
"frontend_ci_run_id",
90-
runIds["Frontend CI"] || ""
91-
);
92-
core.setOutput(
93-
"frontend_e2e_run_id",
94-
runIds["Frontend E2E Integration"] || ""
95-
);
96-
97-
# ────────────────────────────────────────────────────────────────
98-
# Download per-suite lcov artifacts from each producing workflow.
99-
#
100-
# Each download is guarded by the producing workflow's run id (empty
101-
# string when that workflow was path-filtered for this SHA), and
102-
# `continue-on-error: true` tolerates a completed run that did not
103-
# publish the artifact (for example, when the suite failed before
104-
# the upload step ran).
105-
# ────────────────────────────────────────────────────────────────
106-
- name: Download unit lcov artifact
107-
if: steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_ci_run_id != ''
108-
continue-on-error: true
109-
uses: actions/download-artifact@v7
110-
with:
111-
github-token: ${{ secrets.GITHUB_TOKEN }}
112-
run-id: ${{ steps.check.outputs.frontend_ci_run_id }}
113-
name: frontend-unit-lcov
114-
path: coverage/unit
115-
116-
- name: Download component lcov artifact
117-
if: steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_ci_run_id != ''
118-
continue-on-error: true
119-
uses: actions/download-artifact@v7
120-
with:
121-
github-token: ${{ secrets.GITHUB_TOKEN }}
122-
run-id: ${{ steps.check.outputs.frontend_ci_run_id }}
123-
name: frontend-ct-lcov
124-
path: coverage/ct
125-
126-
- name: Download e2e lcov artifact
127-
if: steps.check.outputs.all_done == 'true' && steps.check.outputs.frontend_e2e_run_id != ''
128-
continue-on-error: true
129-
uses: actions/download-artifact@v7
130-
with:
131-
github-token: ${{ secrets.GITHUB_TOKEN }}
132-
run-id: ${{ steps.check.outputs.frontend_e2e_run_id }}
133-
name: frontend-e2e-lcov
134-
path: coverage/e2e
135-
136-
- name: Check for downloaded lcov files
137-
id: lcov
138-
if: steps.check.outputs.all_done == 'true'
139-
run: |
140-
shopt -s nullglob
141-
files=(coverage/*/lcov.info)
142-
if [ ${#files[@]} -eq 0 ]; then
143-
echo "No lcov artifacts retrieved; skipping merged frontend upload."
144-
echo "has_lcov=false" >> "$GITHUB_OUTPUT"
145-
else
146-
echo "Found ${#files[@]} lcov file(s):"
147-
printf ' - %s\n' "${files[@]}"
148-
echo "has_lcov=true" >> "$GITHUB_OUTPUT"
149-
fi
150-
151-
- name: Setup Node.js
152-
if: steps.lcov.outputs.has_lcov == 'true'
153-
uses: actions/setup-node@v6
154-
with:
155-
node-version: "20"
156-
157-
- name: Merge frontend lcov reports
158-
if: steps.lcov.outputs.has_lcov == 'true'
159-
run: |
160-
mkdir -p coverage/merged
161-
npx --yes lcov-result-merger@5 'coverage/*/lcov.info' coverage/merged/lcov.info
162-
echo "Merged lcov source-file count:"
163-
grep -c "^SF:" coverage/merged/lcov.info || true
164-
165-
- name: Upload merged frontend coverage to Codecov
166-
if: steps.lcov.outputs.has_lcov == 'true'
167-
uses: codecov/codecov-action@v6
168-
with:
169-
token: ${{ secrets.CODECOV_TOKEN }}
170-
files: coverage/merged/lcov.info
171-
flags: frontend
172-
name: frontend-merged-coverage
173-
fail_ci_if_error: false
174-
disable_search: true
175-
override_commit: ${{ steps.check.outputs.sha }}
17683
17784
- name: Send notifications to Codecov
17885
if: steps.check.outputs.all_done == 'true'

.github/workflows/frontend-e2e.yml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -208,29 +208,20 @@ jobs:
208208
path: frontend/playwright-report-e2e/
209209
if-no-files-found: ignore
210210

211+
# The `frontend` flag rides along so the same upload feeds both the
212+
# per-suite drill-in and the merged Frontend coverage total that the
213+
# README badge reads. See `frontend.yml` for the companion uploads.
211214
- name: Upload frontend E2E coverage to Codecov
212215
if: success() || failure()
213216
uses: codecov/codecov-action@v6
214217
with:
215218
token: ${{ secrets.CODECOV_TOKEN }}
216219
files: frontend/coverage/e2e/lcov.info
217-
flags: frontend-e2e
220+
flags: frontend-e2e,frontend
218221
name: frontend-e2e-coverage
219222
fail_ci_if_error: false
220223
disable_search: true
221224

222-
# Publish the raw lcov so the cross-workflow merge job in
223-
# `codecov-notify.yml` can pull it via `actions/download-artifact` and
224-
# combine it with the unit + component lcovs into a single `frontend` flag.
225-
- name: Upload frontend E2E lcov artifact
226-
if: success() || failure()
227-
uses: actions/upload-artifact@v7
228-
with:
229-
name: frontend-e2e-lcov
230-
path: frontend/coverage/e2e/lcov.info
231-
if-no-files-found: warn
232-
retention-days: 7
233-
234225
- name: Upload backend E2E coverage to Codecov
235226
if: success() || failure()
236227
uses: codecov/codecov-action@v6

.github/workflows/frontend.yml

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,27 +79,22 @@ jobs:
7979
yarn run test:ct --reporter=list tests/*Metadata*.ct.tsx
8080
continue-on-error: true
8181

82+
# The `frontend` flag is intentionally listed alongside
83+
# `frontend-component` so the same upload feeds both the per-suite
84+
# drill-in and the merged Frontend coverage total. Codecov aggregates
85+
# all uploads sharing a flag server-side, so the README `flag=frontend`
86+
# badge reflects the union of unit + component + e2e without any
87+
# cross-workflow lcov merging on our side.
8288
- name: Upload CT Coverage to Codecov
8389
if: success() || failure()
8490
uses: codecov/codecov-action@v6
8591
with:
8692
token: ${{ secrets.CODECOV_TOKEN }}
8793
files: frontend/coverage/ct/lcov.info
88-
flags: frontend-component
94+
flags: frontend-component,frontend
8995
name: frontend-ct-coverage
9096
fail_ci_if_error: false
91-
92-
# Publish the raw lcov so the cross-workflow merge job in
93-
# `codecov-notify.yml` can pull it via `actions/download-artifact` and
94-
# combine it with the unit + e2e lcovs into a single `frontend` flag.
95-
- name: Upload CT lcov artifact
96-
if: success() || failure()
97-
uses: actions/upload-artifact@v7
98-
with:
99-
name: frontend-ct-lcov
100-
path: frontend/coverage/ct/lcov.info
101-
if-no-files-found: warn
102-
retention-days: 7
97+
disable_search: true
10398

10499
build:
105100
name: Build
@@ -144,27 +139,17 @@ jobs:
144139
run: yarn install --frozen-lockfile
145140
- name: Run Unit Tests with Coverage
146141
run: yarn run test:coverage:unit
142+
# See the CT upload above for why the `frontend` flag is listed here too.
147143
- name: Upload Unit Coverage to Codecov
148144
if: success() || failure()
149145
uses: codecov/codecov-action@v6
150146
with:
151147
token: ${{ secrets.CODECOV_TOKEN }}
152148
files: frontend/coverage/unit/lcov.info
153-
flags: frontend-unit
149+
flags: frontend-unit,frontend
154150
name: frontend-unit-coverage
155151
fail_ci_if_error: false
156-
157-
# Publish the raw lcov so the cross-workflow merge job in
158-
# `codecov-notify.yml` can pull it via `actions/download-artifact` and
159-
# combine it with the component + e2e lcovs into a single `frontend` flag.
160-
- name: Upload Unit lcov artifact
161-
if: success() || failure()
162-
uses: actions/upload-artifact@v7
163-
with:
164-
name: frontend-unit-lcov
165-
path: frontend/coverage/unit/lcov.info
166-
if-no-files-found: warn
167-
retention-days: 7
152+
disable_search: true
168153

169154
docker-build:
170155
name: Build Docker Image

0 commit comments

Comments
 (0)