Skip to content

Commit e9f781f

Browse files
gustavoliraclaude
andauthored
fix(coverage): scope Codecov flags to workspace paths and harden jest-junit install (RHIDP-11862) (#2973)
Without individual_flags paths, carryforward merged coverage from all workspaces into every flag, causing the Codecov Flags page to show "No report uploaded". Add per-workspace paths so each flag only covers its own files. Also add --ignore-scripts to jest-junit install for supply-chain hardening and pre-create test output directories. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e3985a8 commit e9f781f

3 files changed

Lines changed: 75 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ jobs:
124124
run: yarn backstage-cli repo fix --check --publish
125125

126126
- name: Install jest-junit reporter
127-
run: npm install jest-junit@17.0.0 --prefix ${{ runner.temp }}/jest-junit
127+
run: |
128+
npm install jest-junit@17.0.0 --ignore-scripts --prefix ${{ runner.temp }}/jest-junit
129+
mkdir -p ${{ runner.temp }}/test-results/${{ matrix.workspace }}
128130
129131
- name: Test changed packages
130132
id: tests

.github/workflows/coverage-baseline.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ jobs:
7676
run: yarn install --immutable
7777

7878
- name: Install jest-junit reporter
79-
run: npm install jest-junit@17.0.0 --prefix ${{ runner.temp }}/jest-junit
79+
run: |
80+
npm install jest-junit@17.0.0 --ignore-scripts --prefix ${{ runner.temp }}/jest-junit
81+
mkdir -p ${{ runner.temp }}/test-results/${{ matrix.workspace }}
8082
8183
- name: Run tests with coverage
8284
id: tests

codecov.yml

Lines changed: 69 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Epic: RHIDP-11862 — Unit Test Coverage for RHDH Plugins Repository
66
#
77
# Each workspace uploads coverage with its own flag (e.g., lightspeed,
8-
# orchestrator). Flags are created dynamically by the upload step in CI;
9-
# default_rules apply to all of them automatically.
8+
# orchestrator). individual_flags scope each flag to its workspace path
9+
# so the Flags page shows per-workspace coverage correctly.
1010

1111
codecov:
1212
require_ci_to_pass: false
@@ -68,3 +68,70 @@ flag_management:
6868
- type: patch
6969
target: auto
7070
threshold: 100%
71+
individual_flags:
72+
- name: adoption-insights
73+
paths:
74+
- workspaces/adoption-insights/
75+
- name: ai-integrations
76+
paths:
77+
- workspaces/ai-integrations/
78+
- name: app-defaults
79+
paths:
80+
- workspaces/app-defaults/
81+
- name: augment
82+
paths:
83+
- workspaces/augment/
84+
- name: bulk-import
85+
paths:
86+
- workspaces/bulk-import/
87+
- name: cost-management
88+
paths:
89+
- workspaces/cost-management/
90+
- name: dcm
91+
paths:
92+
- workspaces/dcm/
93+
- name: extensions
94+
paths:
95+
- workspaces/extensions/
96+
- name: global-floating-action-button
97+
paths:
98+
- workspaces/global-floating-action-button/
99+
- name: global-header
100+
paths:
101+
- workspaces/global-header/
102+
- name: homepage
103+
paths:
104+
- workspaces/homepage/
105+
- name: konflux
106+
paths:
107+
- workspaces/konflux/
108+
- name: lightspeed
109+
paths:
110+
- workspaces/lightspeed/
111+
- name: mcp-integrations
112+
paths:
113+
- workspaces/mcp-integrations/
114+
- name: orchestrator
115+
paths:
116+
- workspaces/orchestrator/
117+
- name: quickstart
118+
paths:
119+
- workspaces/quickstart/
120+
- name: repo-tools
121+
paths:
122+
- workspaces/repo-tools/
123+
- name: sandbox
124+
paths:
125+
- workspaces/sandbox/
126+
- name: scorecard
127+
paths:
128+
- workspaces/scorecard/
129+
- name: theme
130+
paths:
131+
- workspaces/theme/
132+
- name: translations
133+
paths:
134+
- workspaces/translations/
135+
- name: x2a
136+
paths:
137+
- workspaces/x2a/

0 commit comments

Comments
 (0)