Skip to content

ci: discover staged Codecov flags instead of a hardcoded matrix#6824

Merged
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:ci/codecov-upload-discover-flags
Jul 23, 2026
Merged

ci: discover staged Codecov flags instead of a hardcoded matrix#6824
aglinxinyuan merged 3 commits into
apache:mainfrom
aglinxinyuan:ci/codecov-upload-discover-flags

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Follow-up to #6730. The deferred Codecov Upload workflow hardcoded all 11 flags in its matrix and tried to download each from the source run. On a label-gated PR — e.g. a frontend-only PR that only stages codecov-frontend — the other 10 legs hit ##[error] Artifact not found for name: codecov-<flag>, which looks like a name mismatch; and because the download used continue-on-error: true, a genuinely failed download was swallowed, the leg went green, and notify-failure never fired.

Fix: add a discover job that lists the source run's actual codecov-* artifacts and drives the upload matrix from that (fromJSON), and drop continue-on-error on the download.

  • No more spurious errors — only the flags the source run actually built are processed; a frontend-only PR runs one clean leg.
  • Failures surface — a listed artifact that then fails to download or upload fails the leg, so notify-failure fires (previously it went silently green).
  • Also removes the hardcoded flag list, so adding a platform service no longer needs a matching matrix row here.

Observed on the first live run after #6730 merged (run 29984668372, triggered by a frontend-only PR's checks): frontend uploaded fine, but 10 legs logged Artifact not found for the label-gated flags and the run still went green.

Any related issues, documentation, discussions?

Follow-up to #6730 (reported on #6685).

How was this PR tested?

  • workflow_run only activates from the copy of the file on the default branch, so this can't run on its own PR. Validated by YAML lint and an adversarial review of the discover → upload → notify flow: empty-flags cleanly skips (no failure, no notify), the dynamic fromJSON matrix handles one or many flags, a download/upload failure now fails the leg and fires notify-failure, amber-integration (results-only) skips the coverage step via hashFiles, and the workflow_dispatch path resolves the run id.
  • The workflow_dispatch (run_id) entry remains for manual post-merge validation against a finished Required Checks run.

Was this PR authored or co-authored using generative AI tooling?

Yes.

Generated-by: Claude Code (Opus 4.8 [1M context])

Follow-up to apache#6730. The deferred Codecov Upload matrix hardcoded all 11 flags
and tried to download each from the source run. On a label-gated PR (e.g. a
frontend-only PR that only stages codecov-frontend) the other 10 legs hit
"Artifact not found" — noise that looks like a name mismatch — and because the
download used continue-on-error, a genuinely failed download was swallowed, the
leg went green, and notify-failure never fired.

Add a discover job that lists the source run's actual codecov-* artifacts and
drives the upload matrix via fromJSON, and drop continue-on-error on the
download. Now only the flags that were actually built are processed (no spurious
errors), and a listed artifact that fails to download/upload fails the leg so
notify-failure fires. Also removes the hardcoded flag list, so adding a platform
service no longer needs a matching row here (build.yml comment updated).

Harden the discover github-script to read the source run id from env rather than
interpolating a workflow_dispatch-supplied run_id into the script body.
Copilot AI review requested due to automatic review settings July 23, 2026 06:38
@github-actions github-actions Bot added the ci changes related to CI label Jul 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • No candidates found from git blame history.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the deferred Codecov Upload GitHub Actions workflow by dynamically discovering which codecov-* artifacts were actually produced by the upstream “Required Checks” run, then uploading only those flags—eliminating spurious “artifact not found” errors and ensuring real download/upload failures surface correctly.

Changes:

  • Add a discover job to list codecov-* artifacts from the source run and drive the upload matrix via fromJSON.
  • Remove continue-on-error from artifact download so missing/failed downloads correctly fail the corresponding matrix leg and trigger failure notification.
  • Update build.yml comments to reflect that Codecov flags are now discovered dynamically (no hardcoded matrix sync).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/codecov-upload.yml Introduces discover job and switches upload matrix to dynamic flags; makes download failures fail loudly and adjusts failure notification dependencies.
.github/workflows/build.yml Updates staging/upload comment to reflect dynamic Codecov artifact discovery (no manual flag matrix maintenance).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/codecov-upload.yml
Comment thread .github/workflows/codecov-upload.yml Outdated
Per Copilot review on apache#6824:
- Validate the source run id in the discover script and fail with a clear
  message instead of letting a non-numeric workflow_dispatch run_id become NaN
  and produce a confusing artifacts-API error.
- Default the upload matrix to `[]` (fromJSON(flags || '[]')) so an empty-string
  output can never throw during matrix evaluation; the job `if` still skips the
  empty case.
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 3 better · 🔴 5 worse · ⚪ 7 noise (<±5%) · 0 without baseline

Compared against main 0ba5d1a benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 481 0.293 20,605/27,906/27,906 us 🟢 -7.4% / 🔴 +73.1%
🔴 bs=100 sw=10 sl=64 913 0.558 105,402/145,488/145,488 us 🔴 +13.2% / 🔴 +35.5%
bs=1000 sw=10 sl=64 1,125 0.687 887,709/907,468/907,468 us ⚪ within ±5% / 🟢 -14.1%
Baseline details

Latest main 0ba5d1a from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 481 tuples/sec 472 tuples/sec 760.2 tuples/sec +1.9% -36.7%
bs=10 sw=10 sl=64 MB/s 0.293 MB/s 0.288 MB/s 0.464 MB/s +1.7% -36.9%
bs=10 sw=10 sl=64 p50 20,605 us 22,240 us 12,781 us -7.4% +61.2%
bs=10 sw=10 sl=64 p95 27,906 us 30,107 us 16,118 us -7.3% +73.1%
bs=10 sw=10 sl=64 p99 27,906 us 30,107 us 19,074 us -7.3% +46.3%
bs=100 sw=10 sl=64 throughput 913 tuples/sec 978 tuples/sec 988.68 tuples/sec -6.6% -7.7%
bs=100 sw=10 sl=64 MB/s 0.558 MB/s 0.597 MB/s 0.603 MB/s -6.5% -7.5%
bs=100 sw=10 sl=64 p50 105,402 us 99,562 us 101,448 us +5.9% +3.9%
bs=100 sw=10 sl=64 p95 145,488 us 128,498 us 107,410 us +13.2% +35.5%
bs=100 sw=10 sl=64 p99 145,488 us 128,498 us 120,258 us +13.2% +21.0%
bs=1000 sw=10 sl=64 throughput 1,125 tuples/sec 1,131 tuples/sec 1,023 tuples/sec -0.5% +10.0%
bs=1000 sw=10 sl=64 MB/s 0.687 MB/s 0.69 MB/s 0.624 MB/s -0.4% +10.0%
bs=1000 sw=10 sl=64 p50 887,709 us 883,915 us 983,888 us +0.4% -9.8%
bs=1000 sw=10 sl=64 p95 907,468 us 923,691 us 1,030,100 us -1.8% -11.9%
bs=1000 sw=10 sl=64 p99 907,468 us 923,691 us 1,056,513 us -1.8% -14.1%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,416.05,200,128000,481,0.293,20604.62,27906.22,27906.22
1,100,10,64,20,2189.46,2000,1280000,913,0.558,105402.02,145487.57,145487.57
2,1000,10,64,20,17770.87,20000,12800000,1125,0.687,887709.45,907468.36,907468.36

Comment thread .github/workflows/codecov-upload.yml
Address review (apache#6824): unlike the upload job's download (which fails hard so a
real failure surfaces), notify-failure's download is only fetching a codecov-*
artifact to read the PR number for the comment. Keep continue-on-error so a
missing artifact degrades to "no comment" via the `if: pr != ''` guard instead
of hard-failing notify-failure — which isn't a required check, so failing it
would be invisible noise. Comment-only change.
@aglinxinyuan
aglinxinyuan enabled auto-merge July 23, 2026 09:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.28%. Comparing base (0ba5d1a) to head (ef3898c).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #6824   +/-   ##
=========================================
  Coverage     76.28%   76.28%           
  Complexity     3452     3452           
=========================================
  Files          1161     1161           
  Lines         45916    45916           
  Branches       5099     5099           
=========================================
  Hits          35025    35025           
  Misses         9327     9327           
  Partials       1564     1564           
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 93bb2b4
agent-service 76.76% <ø> (ø) Carriedforward from 93bb2b4
amber 67.33% <ø> (ø) Carriedforward from 93bb2b4
computing-unit-managing-service 20.49% <ø> (ø) Carriedforward from 93bb2b4
config-service 66.66% <ø> (ø) Carriedforward from 93bb2b4
file-service 67.21% <ø> (ø) Carriedforward from 93bb2b4
frontend 81.72% <ø> (ø) Carriedforward from 93bb2b4
notebook-migration-service 78.94% <ø> (ø) Carriedforward from 93bb2b4
pyamber 92.15% <ø> (ø) Carriedforward from 93bb2b4
workflow-compiling-service 55.14% <ø> (ø) Carriedforward from 93bb2b4

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 23, 2026
@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Jul 23, 2026
Merged via the queue into apache:main with commit dda9e83 Jul 23, 2026
92 of 96 checks passed
@aglinxinyuan
aglinxinyuan deleted the ci/codecov-upload-discover-flags branch July 23, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci changes related to CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants