voonhous opened a new pull request, #20475:
URL: https://github.com/apache/hudi/pull/20475

   ### Describe the issue this Pull Request addresses
   
   With fork CI, a fork PR's tests run on the fork, which cannot use 
apache/hudi's Codecov token and is not linked to the PR, so the Codecov comment 
disappears from fork PRs during review.
   
   Part of #20471. Stacked on the fork CI PR (and #20473): review the top 
commit only.
   
   ### Summary and Changelog
   
   - New `upload-coverage` action replaces the 12 Codecov steps. In apache/hudi 
it uploads exactly as before; on a fork it saves `jacoco-report.xml` as an 
artifact named by commit, job and flag.
   - New `fork_coverage_bridge.yml`, every 15 minutes: matches each open fork 
PR's head commit to the fork's finished CI run, downloads its coverage 
artifacts with its own `GITHUB_TOKEN`, uploads them to Codecov for that PR and 
commit under the same flags, and records a `Coverage (fork)` check so each run 
uploads once.
   
   <details>
   <summary>Trust model and smaller changes</summary>
   
   - Artifacts are untrusted data: names must match a strict pattern and a flag 
allowlist, sizes are capped, only the one XML member is extracted, and no fork 
code is checked out or executed. A fork can still forge its own coverage; 
coverage does not gate merges.
   - Codecov maps JaCoCo package paths through the uploader's file list, so the 
bridge loads the PR head's file list with a tree-only fetch from apache/hudi 
(no file contents).
   - A workflow's own `GITHUB_TOKEN` can download another public repository's 
artifacts: [probe 
run](https://github.com/voonhous/hudi/actions/runs/40894825025) (302 with the 
token, 401 without).
   - 15 node tests of the selection and recording scripts run in 
`validate-pr-and-source`.
   </details>
   
   ### Impact
   
   Fork PRs get the Codecov comment back, up to about 15 minutes after their 
fork run finishes. Nothing changes for runs in apache/hudi.
   
   ### Risk Level
   
   low. The upload path in apache/hudi is unchanged; the bridge only reads 
public artifacts and writes Codecov uploads and one check per run.
   
   ### Documentation Update
   
   `.github/workflows/README.md` updated.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to