Skip to content

Commit 8d8ff35

Browse files
fix(ci): preprocess coverage paths before Codecov upload (#606)
Add step to strip /github/workspace/ prefix from coverage XML files before uploading to Codecov. The Unity test runner generates absolute paths from the Docker container, which Codecov cannot match to repo files. The codecov.yml `fixes` section wasn't being applied reliably, so preprocessing the files directly is more robust. Signed-off-by: JasonXuDeveloper - 傑 <jason@xgamedev.net> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b2a8b33 commit 8d8ff35

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed

.claude/rules/commit-conventions.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,41 @@ git commit -s -m "feat(core): add new feature"
9999
```
100100

101101
This adds a `Signed-off-by` line certifying you have the right to submit the code under the project's license.
102+
103+
## PR Code Review Handling
104+
105+
When addressing code review comments on a PR:
106+
107+
1. **Fix the issue** in code
108+
2. **Commit and push** the fix
109+
3. **Reply** to the review comment explaining the fix
110+
4. **Resolve the conversation** immediately after replying
111+
112+
To resolve conversations via CLI:
113+
114+
```bash
115+
# Get thread IDs
116+
gh api graphql -f query='
117+
{
118+
repository(owner: "OWNER", name: "REPO") {
119+
pullRequest(number: PR_NUMBER) {
120+
reviewThreads(first: 20) {
121+
nodes {
122+
id
123+
isResolved
124+
}
125+
}
126+
}
127+
}
128+
}'
129+
130+
# Resolve a thread
131+
gh api graphql -f query='
132+
mutation {
133+
resolveReviewThread(input: {threadId: "THREAD_ID"}) {
134+
thread { isResolved }
135+
}
136+
}'
137+
```
138+
139+
**Important:** Always resolve conversations after fixing and replying - don't leave them open.

.github/workflows/pr-tests.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ jobs:
9999
echo "Coverage directory structure:"
100100
find coverage -type f -name "*.xml" 2>/dev/null || echo "No XML files found"
101101
102+
- name: Fix coverage paths
103+
run: |
104+
# Unity test runner generates paths with /github/workspace/ prefix (Docker container path)
105+
# Strip this prefix so Codecov can match paths to repository files
106+
echo "Fixing coverage paths..."
107+
find coverage -name "*.xml" -exec sed -i 's|/github/workspace/||g' {} \;
108+
echo "Path fix complete. Sample paths after fix:"
109+
find coverage -name "TestCoverageResults*.xml" -exec grep -h "fullPath=" {} \; | head -5 || true
110+
102111
- name: Upload coverage to Codecov (util package)
103112
uses: codecov/codecov-action@v4
104113
with:

.github/workflows/release.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,15 @@ jobs:
181181
echo "Coverage directory structure:"
182182
find coverage -type f -name "*.xml" 2>/dev/null || echo "No XML files found"
183183
184+
- name: Fix coverage paths
185+
run: |
186+
# Unity test runner generates paths with /github/workspace/ prefix (Docker container path)
187+
# Strip this prefix so Codecov can match paths to repository files
188+
echo "Fixing coverage paths..."
189+
find coverage -name "*.xml" -exec sed -i 's|/github/workspace/||g' {} \;
190+
echo "Path fix complete. Sample paths after fix:"
191+
find coverage -name "TestCoverageResults*.xml" -exec grep -h "fullPath=" {} \; | head -5 || true
192+
184193
- name: Upload coverage to Codecov (util package)
185194
uses: codecov/codecov-action@v4
186195
with:

.github/workflows/unity-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
artifactsPath: artifacts/EditMode
7272
githubToken: ${{ secrets.GITHUB_TOKEN }}
7373
checkName: EditMode Test Results
74-
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport'
74+
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+JEngine.*'
7575

7676
# Run PlayMode tests
7777
- name: Run PlayMode tests
@@ -89,7 +89,7 @@ jobs:
8989
artifactsPath: artifacts/PlayMode
9090
githubToken: ${{ secrets.GITHUB_TOKEN }}
9191
checkName: PlayMode Test Results
92-
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport'
92+
coverageOptions: 'generateAdditionalMetrics;generateHtmlReport;generateBadgeReport;assemblyFilters:+JEngine.*'
9393

9494
# Upload test results as artifacts
9595
- name: Upload EditMode test results

0 commit comments

Comments
 (0)