Skip to content

ci: limit coverage to canonical matrix legs#5917

Closed
killagu wants to merge 1 commit into
nextfrom
agent/egg-dev/f5385c80
Closed

ci: limit coverage to canonical matrix legs#5917
killagu wants to merge 1 commit into
nextfrom
agent/egg-dev/f5385c80

Conversation

@killagu
Copy link
Copy Markdown
Contributor

@killagu killagu commented May 3, 2026

Summary

  • keep CI matrix check names stable while limiting coverage collection to canonical legs
  • run no-coverage correctness on the remaining OS/Node matrix legs
  • preserve the done gate and non-test quality checks

Validation

  • node -e js-yaml parse for .github/workflows/ci.yml
  • pnpm exec oxfmt --check .github/workflows/ci.yml
  • git diff --check origin/next..HEAD

Refs EGG-44.

Summary by CodeRabbit

  • Chores
    • Optimized CI workflow configuration for improved test execution efficiency across different platforms and Node versions.

Copilot AI review requested due to automatic review settings May 3, 2026 05:26
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 3, 2026

📝 Walkthrough

Walkthrough

The CI workflow now conditions test execution on OS and Node version. Coverage tests (ut run ci) run only on ubuntu-latest with Node 24, while other combinations run without coverage (ut run test). This pattern is applied consistently across the main test job, test-egg-bin, and test-egg-scripts jobs.

Changes

Test Execution Conditional Structure

Layer / File(s) Summary
Main Test Job
.github/workflows/ci.yml (lines 162–179)
ut run ci executes on ubuntu-latest/Node 24 only; ut run test executes on all other OS/Node combinations. Example tests step removed.
Test-Egg-Bin Job
.github/workflows/ci.yml (lines 213–224)
ut run ci runs on ubuntu-latest after building ./tools/egg-bin; ut run test runs on non-ubuntu OSes after the same build.
Test-Egg-Scripts Job
.github/workflows/ci.yml (lines 260–271)
ut run ci runs on Node 24 after building ./tools/scripts; ut run test runs on other Node versions after the same build. Codecov upload conditioned to Node 24 only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Coverage hops with conditions wise,
Ubuntu-24 claims the testing prize,
Others sprint without the coverage cheer,
But builds and tests still flourish here!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'ci: limit coverage to canonical matrix legs' accurately and concisely summarizes the main change: restricting coverage collection to specific CI matrix configurations while maintaining test execution across all configurations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/egg-dev/f5385c80

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
Review rate limit: 6/8 reviews remaining, refill in 13 minutes and 19 seconds.

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 3, 2026

Deploying egg-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: ac0599f
Status: ✅  Deploy successful!
Preview URL: https://fa7ae673.egg-v3.pages.dev
Branch Preview URL: https://agent-egg-dev-f5385c80.egg-v3.pages.dev

View logs

@codecov
Copy link
Copy Markdown

codecov Bot commented May 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.61%. Comparing base (5baa1ed) to head (ac0599f).

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #5917      +/-   ##
==========================================
- Coverage   85.03%   80.61%   -4.43%     
==========================================
  Files         667      667              
  Lines       19123    19123              
  Branches     3723     3723              
==========================================
- Hits        16262    15416     -846     
- Misses       2468     3179     +711     
- Partials      393      528     +135     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

213-223: ⚡ Quick win

Deduplicate repeated build commands in conditional branches.

ut run build ... is duplicated in both coverage and non-coverage branches in two jobs. Moving build into a single prior step reduces drift and keeps branch logic focused on test mode only.

Proposed refactor
-      - name: Run tests with coverage
-        if: ${{ matrix.os == 'ubuntu-latest' }}
-        run: |
-          ut run build -- --workspace ./tools/egg-bin
-          ut run ci --workspace `@eggjs/bin`
+      - name: Build egg-bin workspace
+        run: ut run build -- --workspace ./tools/egg-bin
+
+      - name: Run tests with coverage
+        if: ${{ matrix.os == 'ubuntu-latest' }}
+        run: ut run ci --workspace `@eggjs/bin`

       - name: Run tests without coverage
         if: ${{ matrix.os != 'ubuntu-latest' }}
-        run: |
-          ut run build -- --workspace ./tools/egg-bin
-          ut run test --workspace `@eggjs/bin`
+        run: ut run test --workspace `@eggjs/bin`
-      - name: Run tests with coverage
-        if: ${{ matrix.node == '24' }}
-        run: |
-          ut run build -- --workspace ./tools/scripts
-          ut run ci --workspace tools/scripts
+      - name: Build scripts workspace
+        run: ut run build -- --workspace ./tools/scripts
+
+      - name: Run tests with coverage
+        if: ${{ matrix.node == '24' }}
+        run: ut run ci --workspace tools/scripts

       - name: Run tests without coverage
         if: ${{ matrix.node != '24' }}
-        run: |
-          ut run build -- --workspace ./tools/scripts
-          ut run test --workspace tools/scripts
+        run: ut run test --workspace tools/scripts

Also applies to: 260-270

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

In @.github/workflows/ci.yml around lines 213 - 223, The workflow duplicates the
build step in both conditional test branches; extract the shared "ut run build
-- --workspace ./tools/egg-bin" invocation into a single step run before the
per-OS conditional steps (the steps named "Run tests with coverage" and "Run
tests without coverage" and their counterparts at lines 260-270), then have
those conditional steps only run the test commands ("ut run ci --workspace
`@eggjs/bin`" or "ut run test --workspace `@eggjs/bin`") so the build is executed
once for all matrix.os values.
🤖 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:
- Around line 213-223: The workflow duplicates the build step in both
conditional test branches; extract the shared "ut run build -- --workspace
./tools/egg-bin" invocation into a single step run before the per-OS conditional
steps (the steps named "Run tests with coverage" and "Run tests without
coverage" and their counterparts at lines 260-270), then have those conditional
steps only run the test commands ("ut run ci --workspace `@eggjs/bin`" or "ut run
test --workspace `@eggjs/bin`") so the build is executed once for all matrix.os
values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dfc101a6-2d50-43b6-aa98-cf9d8c8d0e52

📥 Commits

Reviewing files that changed from the base of the PR and between 5baa1ed and ac0599f.

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adjusts the CI workflow to keep the OS/Node matrix check names stable while collecting and uploading code coverage only from canonical matrix legs, running non-coverage test correctness on the remaining legs.

Changes:

  • Split test execution into “with coverage” (canonical legs) vs “without coverage” (non-canonical legs) across the CI matrix.
  • Restrict Codecov uploads to canonical legs to avoid redundant coverage collection while keeping the existing done gate and other quality checks intact.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying egg with  Cloudflare Pages  Cloudflare Pages

Latest commit: ac0599f
Status: ✅  Deploy successful!
Preview URL: https://c94f41d5.egg-cci.pages.dev
Branch Preview URL: https://agent-egg-dev-f5385c80.egg-cci.pages.dev

View logs

@killagu killagu closed this May 3, 2026
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.

2 participants