Skip to content

ci: restructure CI workflow for parallel jobs and improved build process#7135

Merged
PavelVanecek merged 12 commits into
mainfrom
ci
Mar 15, 2026
Merged

ci: restructure CI workflow for parallel jobs and improved build process#7135
PavelVanecek merged 12 commits into
mainfrom
ci

Conversation

@PavelVanecek

@PavelVanecek PavelVanecek commented Mar 14, 2026

Copy link
Copy Markdown
Collaborator

Description

Hopefully this will make it run a bit faster, and allow us to re-run only flaked tests instead of the whole pipeline.

Summary by CodeRabbit

  • Chores
    • CI reorganized into parallel, named jobs with artifact-based handoffs for faster feedback and clearer sequencing.
    • Packaging separated so package artifacts are produced and consumed by downstream tests; packaging metadata exposure moved to the pack step.
    • Storybook, website and publishing flows reworked; website build and docs now pull storybook artifacts and handle their own checks.
    • Visual tests split per-browser with per-browser reports merged before staging deploy.
    • Prebuild/type-check scripts simplified and test tooling paths/reporting made CI-friendly.

@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Split the CI into multiple parallel jobs with artifact handoffs (build, storybook, pack, tests, website, VR, deploy). Moved tgz_name output to the new pack job. package.json prebuild no longer runs lint; added check-types-lib and updated check-types. Playwright CT config paths, reporters, aliases, and workers adjusted.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/ci.yml
Replaced a single combined CI job with multiple parallel jobs (build, unit_tests, storybook, checks, omnidoc, treeshaking, website, pack, integration_tests, vr_tests, merge_vr_reports, deploy_staging). Introduced artifact upload/downloads (build-output, storybook, pack.tgz), moved tgz_name output to pack, reworked job dependencies/gating, VR browser matrix and report merge, and moved BASE_URL logic into website.
NPM scripts
package.json
Removed lint from prebuild, added check-types-lib (tsc --noEmit), and updated check-types to invoke check-types-lib before test/storybook/website type checks.
Playwright CT config (VR)
test-vr/playwright-ct.config.ts
Made paths relative using __dirname/repoRoot, changed snapshot/output dirs and reporters (CI blob vs local HTML), increased CI workers to 2, and updated Vite alias resolutions to use repoRoot node_modules and src paths.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Build as Build Job
  participant Storybook as Storybook Job
  participant Pack as Pack Job
  participant Integration as Integration Tests
  participant VR as VR Tests
  participant MergeVR as merge_vr_reports
  participant Website as Website Job
  participant Deploy as Deploy Staging

  GH->>Build: start build
  Build->>GH: upload artifact (build-output) rgba(70,130,180,0.5)
  GH->>Storybook: start storybook job
  Storybook->>GH: upload artifact (storybook) rgba(34,139,34,0.5)
  GH->>Pack: start pack (downloads build-output)
  Pack->>GH: emit output tgz_name + upload tgz rgba(255,165,0,0.5)
  GH->>Integration: integration_tests downloads pack.tgz (tgz_name) rgba(128,0,128,0.5)
  GH->>VR: vr_tests matrix runs (depends on build) rgba(199,21,133,0.5)
  VR->>GH: upload per-browser vr-blob-report rgba(199,21,133,0.5)
  GH->>MergeVR: merge_vr_reports collects blobs
  MergeVR->>GH: upload merged vr-report rgba(148,0,211,0.5)
  GH->>Website: website downloads build + storybook, computes BASE_URL, builds site rgba(0,128,128,0.5)
  Website->>Deploy: deploy_staging gated on website + merged vr-report rgba(220,20,60,0.5)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • ckifer
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is minimal and lacks required sections from the template (Related Issue, Motivation and Context, How Has This Been Tested, Types of changes, Checklist). Add missing sections: link a related issue, explain the motivation/problem solved, describe testing approach, select change types, and complete the checklist.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: restructuring the CI workflow to enable parallel jobs and improve the build process.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ci
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)

415-415: vr_tests waits for build but still rebuilds locally.

Line 415 introduces needs: [build], but this job rebuilds on Line 433 and again via test-vr:prepare on Line 448. This likely adds avoidable CI wall time.

Options to remove duplicate work
-    needs: [build]
+    # Remove if this job does not consume build artifacts

And if you keep the dependency, consider removing one of the two local build invocations in this job path.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 415, The vr_tests job currently declares a
dependency on the build job (needs: [build]) but still runs local builds twice
(a local build invocation inside the vr_tests job and another in the
test-vr:prepare job), causing duplicate work; fix by keeping the dependency and
removing the redundant local build commands (delete the local build step(s)
inside the vr_tests job or inside test-vr:prepare), or alternatively remove the
needs: [build] if you intend vr_tests to perform its own build — specifically
edit the vr_tests job and/or the test-vr:prepare job to ensure only one build
step remains (remove the extra "yarn build"/"npm run build" run step or
equivalent).

257-257: website is gated by build without consuming its artifact.

Line 257 adds build as a dependency, but this job only consumes Storybook output (Lines 287-291). That serializes the pipeline without a data dependency.

Possible simplification
-    needs: [build, storybook]
+    needs: [storybook]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 257, The website job lists build in its
needs array but never consumes build's artifacts—only Storybook's—creating
unnecessary serialization; update the needs for the website job (the job named
"website") to remove "build" and depend only on "storybook", or alternatively
add explicit artifact download steps to consume build's output if that
dependency is really required; adjust the needs array in the CI workflow so
"website" only depends on the jobs whose artifacts it actually uses (e.g.,
"storybook") or add artifact consumption for "build".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 415: The vr_tests job currently declares a dependency on the build job
(needs: [build]) but still runs local builds twice (a local build invocation
inside the vr_tests job and another in the test-vr:prepare job), causing
duplicate work; fix by keeping the dependency and removing the redundant local
build commands (delete the local build step(s) inside the vr_tests job or inside
test-vr:prepare), or alternatively remove the needs: [build] if you intend
vr_tests to perform its own build — specifically edit the vr_tests job and/or
the test-vr:prepare job to ensure only one build step remains (remove the extra
"yarn build"/"npm run build" run step or equivalent).
- Line 257: The website job lists build in its needs array but never consumes
build's artifacts—only Storybook's—creating unnecessary serialization; update
the needs for the website job (the job named "website") to remove "build" and
depend only on "storybook", or alternatively add explicit artifact download
steps to consume build's output if that dependency is really required; adjust
the needs array in the CI workflow so "website" only depends on the jobs whose
artifacts it actually uses (e.g., "storybook") or add artifact consumption for
"build".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67f7b734-9dc8-460f-b050-f1ba052047ec

📥 Commits

Reviewing files that changed from the base of the PR and between be4c033 and 083eb2d.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • package.json

@codecov

codecov Bot commented Mar 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.59%. Comparing base (be4c033) to head (6ea809f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7135   +/-   ##
=======================================
  Coverage   89.59%   89.59%           
=======================================
  Files         536      536           
  Lines       40401    40401           
  Branches     5498     5499    +1     
=======================================
  Hits        36197    36197           
  Misses       4196     4196           
  Partials        8        8           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

5-8: ⚠️ Potential issue | 🟠 Major

Narrow default workflow token permissions to least privilege.

pull-requests: write at workflow scope gives every job write-level PR permissions, even jobs that only build/test. Keep write scope only in jobs that actually comment/update PRs.

🔒 Suggested least-privilege change
 permissions:
   contents: read
-  pull-requests: write
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 5 - 8, The workflow-wide permissions
block currently grants pull-requests: write; change the default workflow
permissions to the least privilege by removing or setting pull-requests to none
under the top-level permissions key (i.e., update the permissions block that
contains "contents" and "pull-requests"), and then add a job-level permissions
override only in the job(s) that need to modify or comment on PRs by setting
permissions: pull-requests: write in that job; ensure all other jobs inherit the
restricted default to avoid unnecessary write access.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 5-8: The workflow-wide permissions block currently grants
pull-requests: write; change the default workflow permissions to the least
privilege by removing or setting pull-requests to none under the top-level
permissions key (i.e., update the permissions block that contains "contents" and
"pull-requests"), and then add a job-level permissions override only in the
job(s) that need to modify or comment on PRs by setting permissions:
pull-requests: write in that job; ensure all other jobs inherit the restricted
default to avoid unnecessary write access.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb45d96d-0e7a-4f64-b4e3-0bed68e8b910

📥 Commits

Reviewing files that changed from the base of the PR and between 083eb2d and 65f8caa.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

325-329: ⚠️ Potential issue | 🟡 Minor

Make the Storybook copy step idempotent.

mkdir www/docs/storybook-static fails if the directory already exists. Use -p to avoid brittle reruns/retries.

Suggested fix
       - name: Copy storybook to docs folder
         run: |
-          mkdir www/docs/storybook-static
+          mkdir -p www/docs/storybook-static
           cp -r storybook/public/* www/docs/storybook-static/
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 325 - 329, The "Copy storybook to docs
folder" CI step is brittle because mkdir www/docs/storybook-static fails if the
directory exists; update this step to create the directory idempotently by using
mkdir -p for www/docs/storybook-static (and keep the existing cp -r
storybook/public/* www/docs/storybook-static/ command) so repeated runs/retries
don't fail; locate the step by its name "Copy storybook to docs folder" and the
commands invoking mkdir and cp to apply the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 179-191: The Chromatic publish step should not block downstream
artifact consumers — move the Chromatic action out of the storybook job into its
own job (e.g., job name "chromatic") that has needs: [storybook] so it runs
after storybook but is not a prerequisite for website or deploy_staging; update
the existing Chromatic step (and the duplicate at lines ~276-279) to that new
job and keep the same with: options (projectToken, skip) and conditional on
env.ENCRYPTED_CHROMATIC_TOKEN so failures in Chromatic won’t fail the storybook
job or prevent website/deploy_staging from running.
- Line 184: The CI workflow step using chromaui/action@latest is
non-deterministic; replace the floating tag by pinning to a specific immutable
commit SHA or a fixed major version (e.g., chromaui/action@vX) to ensure
reproducible builds—locate the step with the uses: chromaui/action@latest
reference in the .github/workflows/ci.yml and update it to the chosen commit SHA
or stable version tag.

---

Outside diff comments:
In @.github/workflows/ci.yml:
- Around line 325-329: The "Copy storybook to docs folder" CI step is brittle
because mkdir www/docs/storybook-static fails if the directory exists; update
this step to create the directory idempotently by using mkdir -p for
www/docs/storybook-static (and keep the existing cp -r storybook/public/*
www/docs/storybook-static/ command) so repeated runs/retries don't fail; locate
the step by its name "Copy storybook to docs folder" and the commands invoking
mkdir and cp to apply the change.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 556cd354-a871-4f4c-917d-dc7e795f1388

📥 Commits

Reviewing files that changed from the base of the PR and between 65f8caa and 6aa4403.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Comment thread .github/workflows/ci.yml
Comment on lines +179 to +191
# Chromatic gives us only this many free credits per month
# so let's publish only at the end so that we don't waste them when we know we can't merge from the previous steps anyway.
- name: Publish visual regression tests to Chromatic
if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}
# Chromatic action from https://www.chromatic.com/docs/github-actions
uses: chromaui/action@latest
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
# Let's say that we don't want to use our Chromatic credits for PRs from dependabot
skip: 'dependabot/**'

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.

⚠️ Potential issue | 🟠 Major

Decouple Chromatic publishing from the storybook job’s success path.

Right now, a failure in the final Chromatic step fails storybook, which then skips website (it needs: [build, storybook]) and blocks deploy_staging. That undermines the flaky-rerun goal because a non-artifact step can block downstream artifact consumers.

Suggested adjustment
       - name: Publish visual regression tests to Chromatic
         if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}
+        continue-on-error: true
         # Chromatic action from https://www.chromatic.com/docs/github-actions
         uses: chromaui/action@latest

Also applies to: 276-279

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 179 - 191, The Chromatic publish step
should not block downstream artifact consumers — move the Chromatic action out
of the storybook job into its own job (e.g., job name "chromatic") that has
needs: [storybook] so it runs after storybook but is not a prerequisite for
website or deploy_staging; update the existing Chromatic step (and the duplicate
at lines ~276-279) to that new job and keep the same with: options
(projectToken, skip) and conditional on env.ENCRYPTED_CHROMATIC_TOKEN so
failures in Chromatic won’t fail the storybook job or prevent
website/deploy_staging from running.

Comment thread .github/workflows/ci.yml
- name: Publish visual regression tests to Chromatic
if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}
# Chromatic action from https://www.chromatic.com/docs/github-actions
uses: chromaui/action@latest

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Floating action refs:"
rg -nP 'uses:\s*[^#\s]+@latest\b'

echo
echo "Non-immutable action refs (consider pinning to commit SHA):"
rg -nP 'uses:\s*[^#\s]+@(main|master|latest|next|beta|v?\d+)\b'

Repository: recharts/recharts

Length of output: 82


🏁 Script executed:

sed -n '180,190p' .github/workflows/ci.yml

Repository: recharts/recharts

Length of output: 735


Pin the chromaui/action to a specific commit SHA or major version.

uses: chromaui/action@latest at line 184 is non-deterministic and can break CI unexpectedly due to untracked changes or security vulnerabilities in newer versions. Pin to a specific immutable commit SHA (preferred) or at least a fixed major version tag.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 184, The CI workflow step using
chromaui/action@latest is non-deterministic; replace the floating tag by pinning
to a specific immutable commit SHA or a fixed major version (e.g.,
chromaui/action@vX) to ensure reproducible builds—locate the step with the uses:
chromaui/action@latest reference in the .github/workflows/ci.yml and update it
to the chosen commit SHA or stable version tag.

@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)

186-190: ⚠️ Potential issue | 🟠 Major

Chromatic is still a blocking and non-deterministic step in storybook.

Line 186-190 keeps Chromatic inside storybook and uses chromaui/action@latest; this can both block downstream jobs on Chromatic flake and introduce unreproducible CI behavior.

Suggested minimal hardening
       - name: Publish visual regression tests to Chromatic
         if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}
+        continue-on-error: true
-        uses: chromaui/action@latest
+        uses: chromaui/action@<pinned-commit-sha-or-fixed-major>
#!/bin/bash
set -euo pipefail

echo "Chromatic step and ref:"
rg -nP 'Publish visual regression tests to Chromatic|uses:\s*chromaui/action@' .github/workflows/ci.yml -A3 -B2

echo
echo "Downstream dependency on storybook:"
rg -nP '^\s*website:|^\s*needs:\s*\[build,\s*storybook\]' .github/workflows/ci.yml -A2 -B1
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 186 - 190, The Chromatic step "Publish
visual regression tests to Chromatic" currently uses chromaui/action@latest
inside the storybook job and blocks downstream jobs; fix this by extracting that
step into its own job (e.g., a "chromatic" job) that depends on storybook but is
not required for critical downstream jobs, or make the step non-blocking by
setting continue-on-error: true; also stop using chromaui/action@latest and pin
the action to a stable version (replace chromaui/action@latest with a specific
version tag) and keep the existing if: condition on the
ENCRYPTED_CHROMATIC_TOKEN to preserve gating.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 533-535: The deploy_staging job currently attempts an
unconditional download of the vr-report artifact which will fail if
merge_vr_reports didn't upload it; update the download step in deploy_staging to
tolerate missing artifacts by adding if-no-files-found: ignore to the
download-artifact action (or wrap the step with a conditional that checks
needs.merge_vr_reports.result == 'success') so deployment can proceed when
merge_vr_reports failed; refer to the deploy_staging job and the
download-artifact step for the exact location to change and the artifact name
vr-report.

In `@package.json`:
- Around line 34-35: The "check-types" npm script incorrectly invokes the npm
script check-types-lib as a shell command; update the "check-types" script to
call "npm run check-types-lib" (matching how the other scripts are invoked) so
npm resolves the script correctly; specifically modify the "check-types" entry
to use npm run before check-types-lib while keeping the rest of the chain ("npm
run check-types-test", "npm run check-types-storybook", "npm run
check-types-website") unchanged.

---

Duplicate comments:
In @.github/workflows/ci.yml:
- Around line 186-190: The Chromatic step "Publish visual regression tests to
Chromatic" currently uses chromaui/action@latest inside the storybook job and
blocks downstream jobs; fix this by extracting that step into its own job (e.g.,
a "chromatic" job) that depends on storybook but is not required for critical
downstream jobs, or make the step non-blocking by setting continue-on-error:
true; also stop using chromaui/action@latest and pin the action to a stable
version (replace chromaui/action@latest with a specific version tag) and keep
the existing if: condition on the ENCRYPTED_CHROMATIC_TOKEN to preserve gating.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 51fa6c1c-e7cb-4007-b6fd-5dbf0f1b4abe

📥 Commits

Reviewing files that changed from the base of the PR and between 6aa4403 and 2d1ac6f.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • package.json
  • test-vr/playwright-ct.config.ts

Comment thread .github/workflows/ci.yml
Comment on lines +533 to +535
# Since the merge_vr_reports job will fail when tests fail,
# the deploy_staging job will be skipped. To achieve your intended behavior, you need to explicitly allow deploy_staging to run when merge_vr_reports fails.
if: always() && needs.website.result == 'success' && (needs.merge_vr_reports.result == 'success' || needs.merge_vr_reports.result == 'failure')

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Deploy condition:"
rg -n 'if:\s*always\(\).*needs\.merge_vr_reports\.result' .github/workflows/ci.yml -A1 -B2

echo
echo "VR artifact download in deploy_staging:"
rg -n 'name:\s*Download VR report artifact|name:\s*vr-report' .github/workflows/ci.yml -A4 -B2

Repository: recharts/recharts

Length of output: 1037


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== merge_vr_reports job definition ==="
rg -n 'merge_vr_reports:' .github/workflows/ci.yml -A 50 | head -70

echo
echo "=== Check for if-no-files-found in artifact downloads ==="
rg -n 'if-no-files-found' .github/workflows/ci.yml -B 5 -A 2

echo
echo "=== Full deploy_staging job section ==="
rg -n 'deploy_staging:' .github/workflows/ci.yml -A 40

Repository: recharts/recharts

Length of output: 2313


🌐 Web query:

actions/download-artifact default behavior when artifact does not exist

💡 Result:

actions/download-artifact fails the step by default if the requested artifact(s) don’t exist (there’s no “ignore missing” input like actions/cache has).

  • If you set with: name: my-artifact and it doesn’t exist, the action errors (e.g. Error: Unable to find an artifact with the name: …) and the step fails. [2]
  • If you don’t set name, the action tries to download all artifacts for the run; if there are no artifacts, it errors (e.g. Unable to find any artifacts for the associated workflow) and the step fails. [3][1]

Workarounds: wrap the step with continue-on-error: true, or pre-check for the artifact via the API/gh and only run the download when it exists. [1]

Sources: [1] [2] [3]


The failure-tolerant condition is undermined by unconditional artifact download.

Line 535 allows deploy_staging to run when merge_vr_reports fails, but line 553-557 unconditionally download the vr-report artifact. If merge_vr_reports fails (either from test failures or merge command errors), the artifact is never uploaded. The download-artifact action fails by default when the artifact doesn't exist, causing deploy_staging to fail anyway—defeating the purpose of the failure-tolerant condition.

Make the artifact download conditional or add if-no-files-found: ignore to allow deployment to proceed even if the report is unavailable.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 533 - 535, The deploy_staging job
currently attempts an unconditional download of the vr-report artifact which
will fail if merge_vr_reports didn't upload it; update the download step in
deploy_staging to tolerate missing artifacts by adding if-no-files-found: ignore
to the download-artifact action (or wrap the step with a conditional that checks
needs.merge_vr_reports.result == 'success') so deployment can proceed when
merge_vr_reports failed; refer to the deploy_staging job and the
download-artifact step for the exact location to change and the artifact name
vr-report.

Comment thread package.json Outdated

@coderabbitai coderabbitai Bot 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.

♻️ Duplicate comments (3)
.github/workflows/ci.yml (3)

186-190: ⚠️ Potential issue | 🟠 Major

Decouple Chromatic failure from the storybook job success path.

A transient Chromatic failure here still fails storybook, which blocks website (Line 283) and then deploy_staging. That conflicts with the flaky-rerun objective.

Suggested minimal fix
       - name: Publish visual regression tests to Chromatic
         if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}
+        continue-on-error: true
         # Chromatic action from https://www.chromatic.com/docs/github-actions
         uses: chromaui/action@latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 186 - 190, The Chromatic step "Publish
visual regression tests to Chromatic" currently causes the entire storybook job
to fail on transient Chromatic errors; update that step (the one using
chromaui/action@latest) to allow failures by adding continue-on-error: true (or
equivalent conditional that does not set job to failed) while keeping the
existing if: check for env.ENCRYPTED_CHROMATIC_TOKEN so the step still runs only
when the token is present; this will decouple Chromatic failures from the
storybook job and avoid blocking downstream website/deploy_staging jobs.

553-557: ⚠️ Potential issue | 🟠 Major

Guard VR artifact download and move to preserve failure-tolerant deploy behavior.

deploy_staging is allowed to run when merge_vr_reports fails (Line 535), but this step always downloads vr-report, and deploy always moves ../vr-report. If the artifact is missing, deployment still fails.

Suggested fix
       - name: Download VR report artifact
+        if: needs.merge_vr_reports.result == 'success'
         uses: actions/download-artifact@v4
         with:
           name: vr-report
           path: vr-report
-          mv ../vr-report $TARGET_DIR/vr-tests
+          if [ -d ../vr-report ]; then
+            mv ../vr-report $TARGET_DIR/vr-tests
+          fi

Based on learnings: In this repository, staging should still deploy website/VR report artifacts even when VR tests fail so report review remains possible.

Also applies to: 585-587

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml around lines 553 - 557, Guard the "Download VR
report artifact" step and the deploy step that moves "../vr-report" so missing
VR artifacts don't break deploy_staging: conditionally run the "Download VR
report artifact" step (the actions/download-artifact@v4 step with name
"vr-report" / path "vr-report") only when the VR-report-producing job/step
succeeded (e.g. add if: ${{ steps.merge_vr_reports.outcome == 'success' }} or
check the producing job outcome), and add the same conditional around the deploy
logic that moves ../vr-report (or make the download step continue-on-error: true
and have the deploy step check the artifact exists before moving) so
deploy_staging remains tolerant when merge_vr_reports fails.

189-189: ⚠️ Potential issue | 🟠 Major

Pin chromaui/action to an immutable ref.

chromaui/action@latest is non-deterministic and can introduce unexpected CI breakages. Pin to a full commit SHA (preferred) or at least a fixed major tag.

What are the currently available release tags for `chromaui/action`, and which immutable commit SHA corresponds to the stable tag we should pin in GitHub Actions?
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 189, Replace the non-deterministic
reference chromaui/action@latest in the GitHub Actions step with an immutable
ref by pinning to the full commit SHA for a stable release (e.g.,
chromaui/action@<40-char-commit-sha>) or at minimum a fixed release tag like
chromaui/[email protected]; to get the correct SHA, open the chromaui/action repo's
Releases/Tags, pick the stable tag you want to lock to, click the tag to view
its commit and copy the full commit SHA, then update the uses line accordingly
so the workflow is pinned to that immutable commit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In @.github/workflows/ci.yml:
- Around line 186-190: The Chromatic step "Publish visual regression tests to
Chromatic" currently causes the entire storybook job to fail on transient
Chromatic errors; update that step (the one using chromaui/action@latest) to
allow failures by adding continue-on-error: true (or equivalent conditional that
does not set job to failed) while keeping the existing if: check for
env.ENCRYPTED_CHROMATIC_TOKEN so the step still runs only when the token is
present; this will decouple Chromatic failures from the storybook job and avoid
blocking downstream website/deploy_staging jobs.
- Around line 553-557: Guard the "Download VR report artifact" step and the
deploy step that moves "../vr-report" so missing VR artifacts don't break
deploy_staging: conditionally run the "Download VR report artifact" step (the
actions/download-artifact@v4 step with name "vr-report" / path "vr-report") only
when the VR-report-producing job/step succeeded (e.g. add if: ${{
steps.merge_vr_reports.outcome == 'success' }} or check the producing job
outcome), and add the same conditional around the deploy logic that moves
../vr-report (or make the download step continue-on-error: true and have the
deploy step check the artifact exists before moving) so deploy_staging remains
tolerant when merge_vr_reports fails.
- Line 189: Replace the non-deterministic reference chromaui/action@latest in
the GitHub Actions step with an immutable ref by pinning to the full commit SHA
for a stable release (e.g., chromaui/action@<40-char-commit-sha>) or at minimum
a fixed release tag like chromaui/[email protected]; to get the correct SHA, open
the chromaui/action repo's Releases/Tags, pick the stable tag you want to lock
to, click the tag to view its commit and copy the full commit SHA, then update
the uses line accordingly so the workflow is pinned to that immutable commit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a2673ced-3609-4121-8d0c-3ea9c50c6591

📥 Commits

Reviewing files that changed from the base of the PR and between 2d1ac6f and a771eab.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Staging Deployment Details

These deployments will remain available for 30 days.

To update snapshots: Comment /update-snapshots on this PR to automatically update the baseline screenshots.

@PavelVanecek
PavelVanecek merged commit 681daea into main Mar 15, 2026
59 checks passed
@PavelVanecek
PavelVanecek deleted the ci branch March 15, 2026 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant