Skip to content

chore: reduce CI matrix for PRs to prevent runner exhaustion#7463

Merged
JohnMcLear merged 1 commit intoether:developfrom
JohnMcLear:chore/optimize-ci-matrix
Apr 5, 2026
Merged

chore: reduce CI matrix for PRs to prevent runner exhaustion#7463
JohnMcLear merged 1 commit intoether:developfrom
JohnMcLear:chore/optimize-ci-matrix

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

@JohnMcLear JohnMcLear commented Apr 5, 2026

Summary

Two CI improvements:

1. Reduce PR matrix to prevent runner exhaustion

PRs now run a minimal test matrix; full matrix runs on push to develop.

Workflow Before (per commit) PR Push to develop
Backend tests 12 (4 configs × 3 nodes) 2 (Linux only, Node 24) 12 (unchanged)
Upgrade from latest 3 (3 nodes) 1 (Node 24) 3 (unchanged)
Frontend admin 3 (3 nodes) 1 (Node 24) 3 (unchanged)
Frontend tests 2 2 (unchanged) 2 (unchanged)
Others ~5 ~5 (unchanged) ~5 (unchanged)
Total ~25 ~10 ~25

2. Clean up Playwright CI output

Redirect Etherpad server stdout/stderr to /tmp/etherpad-server.log during frontend tests so Playwright's test list output isn't interleaved with server log noise (ENTER, LEAVE, INFO, etc.). Server logs are uploaded as artifacts on failure for debugging.

🤖 Generated with Claude Code

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Optimize CI matrix for PRs to prevent runner exhaustion

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Reduce PR CI matrix from ~25 to ~10 jobs by testing only Node 24 on Linux
• Disable Windows tests for PRs; run full matrix only on push to develop
• Conditionally set Node versions based on event type (PR vs push)
• Remove duplicate libreoffice installation step in upgrade workflow
Diagram
flowchart LR
  PR["Pull Request Event"]
  PUSH["Push to develop Event"]
  PR -- "Node 24 Linux only" --> REDUCED["Reduced Matrix<br/>~10 jobs"]
  PUSH -- "Full matrix<br/>3 Node × 2 platforms" --> FULL["Full Matrix<br/>~25 jobs"]
  REDUCED --> FAST["Quick Feedback"]
  FULL --> COVERAGE["Complete Coverage"]
Loading

Grey Divider

File Changes

1. .github/workflows/backend-tests.yml ⚙️ Configuration changes +6/-10

Reduce backend test matrix for PRs

• Conditionally set Node matrix: PR events test Node 24 only, push events test all three versions
• Simplify Windows job conditions to skip PRs entirely (github.event_name != 'pull_request')
• Remove external fork condition from Windows jobs since they no longer run on PRs
• Add clarifying comments about PR vs push behavior

.github/workflows/backend-tests.yml


2. .github/workflows/frontend-admin-tests.yml ⚙️ Configuration changes +2/-1

Reduce frontend admin test matrix for PRs

• Conditionally set Node matrix: PR events test Node 24 only, push events test all three versions
• Add comment explaining the conditional matrix behavior

.github/workflows/frontend-admin-tests.yml


3. .github/workflows/upgrade-from-latest-release.yml ⚙️ Configuration changes +2/-7

Reduce upgrade test matrix and remove duplication

• Conditionally set Node matrix: PR events test Node 24 only, push events test all three versions
• Remove duplicate libreoffice installation step that was redundantly defined
• Add comment explaining the conditional matrix behavior

.github/workflows/upgrade-from-latest-release.yml


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects bot commented Apr 5, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX Issues (0)

Grey Divider


Action required

1. Backend PRs still full-matrix 🐞 Bug ≡ Correctness
Description
In backend-tests.yml, the reduced Node matrix is selected only for pull_request events, but the
Linux jobs skip same-repo pull_request events, so internal PRs run via push using the full Node
matrix (and Windows jobs). This defeats the intended CI job reduction for typical PRs.
Code

.github/workflows/backend-tests.yml[R30-31]

+        # PRs: test on latest Node only. Push to develop: full matrix.
+        node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }}
Evidence
The workflow triggers on both push and pull_request, but the Linux jobs use an if: guard that
skips same-repo PR events; therefore internal PR commits primarily execute as push runs. The new
matrix conditional keys off github.event_name, so those push runs always take the full matrix,
leaving CI load unchanged for internal PRs.

.github/workflows/backend-tests.yml[4-10]
.github/workflows/backend-tests.yml[20-25]
.github/workflows/backend-tests.yml[27-32]
.github/workflows/backend-tests.yml[142-152]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`backend-tests.yml` reduces the matrix only when `github.event_name == 'pull_request'`, but same-repo PR jobs are skipped on the `pull_request` event, so internal PR CI runs on `push` and always selects the full matrix.

## Issue Context
The Linux jobs have an `if:` guard that avoids running on internal `pull_request` events. With the new event-based matrix selection, that guard means the reduced PR matrix won't apply to internal PR branches.

## Fix Focus Areas
- .github/workflows/backend-tests.yml[4-32]
- .github/workflows/backend-tests.yml[20-25]

## Suggested fix direction
Change the matrix selection (and any heavy jobs such as Windows) to key off branch/ref (e.g., run full matrix only on `push` to `develop`/`master`, and run reduced matrix for PRs and non-default-branch pushes), OR remove/adjust the job-level `if:` so internal PRs actually run under `pull_request` and can use the reduced matrix.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Misleading Windows job comment 🐞 Bug ⚙ Maintainability
Description
backend-tests.yml now states Windows tests run only on pushes to develop/master, but the workflow
still triggers on push to any branch and the Windows job if: only checks event type. This
comment will mislead future changes/debugging because the code does not enforce the stated scope.
Code

.github/workflows/backend-tests.yml[R142-148]

+  # Windows tests only run on push to develop/master, not on PRs
  withoutpluginsWindows:
    env:
      PNPM_HOME: ~\\.pnpm-store
-    # run on pushes to any branch
-    # run on PRs from external forks
    if: |
-      (github.event_name != 'pull_request')
-      || (github.event.pull_request.head.repo.id != github.event.pull_request.base.repo.id)
+      github.event_name != 'pull_request'
    strategy:
Evidence
The workflow has on: push without any branches: restriction, and the Windows jobs only guard on
github.event_name != 'pull_request', which still includes pushes to any branch; therefore the new
comment is inaccurate relative to actual execution criteria.

.github/workflows/backend-tests.yml[3-8]
.github/workflows/backend-tests.yml[142-148]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A newly added comment claims Windows tests only run on pushes to develop/master, but the workflow/job conditions do not implement that restriction.

## Issue Context
This is a maintainability/documentation mismatch: future contributors will trust the comment, but the actual triggers/`if:` logic differ.

## Fix Focus Areas
- .github/workflows/backend-tests.yml[3-8]
- .github/workflows/backend-tests.yml[142-148]

## Suggested fix direction
Either (a) update the comment to match the current behavior (Windows runs on any non-PR event), or (b) implement branch gating (via `on.push.branches` and/or `if:` checking `github.ref`) so the behavior matches the comment.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

PRs now run a minimal test matrix; full matrix runs on push to develop.

Changes:
- Backend tests: PRs test on Node 24 only (Linux). Windows tests only
  run on push to develop. Reduces from 12 to 2 jobs for PRs.
- Upgrade-from-latest-release: PRs test on Node 24 only (1 job vs 3).
- Frontend admin tests: PRs test on Node 24 only (1 job vs 3).

This reduces PR CI from ~25 jobs to ~10, preventing runner exhaustion
when multiple PRs are merged in succession. The full matrix (3 Node
versions × Linux + Windows) still runs on every push to develop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JohnMcLear JohnMcLear force-pushed the chore/optimize-ci-matrix branch from e14f579 to a2df63c Compare April 5, 2026 09:10
Comment on lines +30 to +31
# PRs: test on latest Node only. Push to develop: full matrix.
node: ${{ github.event_name == 'pull_request' && fromJSON('[">=24.0.0 <25.0.0"]') || fromJSON('[">=20.0.0 <21.0.0", ">=22.0.0 <23.0.0", ">=24.0.0 <25.0.0"]') }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Backend prs still full-matrix 🐞 Bug ≡ Correctness

In backend-tests.yml, the reduced Node matrix is selected only for pull_request events, but the
Linux jobs skip same-repo pull_request events, so internal PRs run via push using the full Node
matrix (and Windows jobs). This defeats the intended CI job reduction for typical PRs.
Agent Prompt
## Issue description
`backend-tests.yml` reduces the matrix only when `github.event_name == 'pull_request'`, but same-repo PR jobs are skipped on the `pull_request` event, so internal PR CI runs on `push` and always selects the full matrix.

## Issue Context
The Linux jobs have an `if:` guard that avoids running on internal `pull_request` events. With the new event-based matrix selection, that guard means the reduced PR matrix won't apply to internal PR branches.

## Fix Focus Areas
- .github/workflows/backend-tests.yml[4-32]
- .github/workflows/backend-tests.yml[20-25]

## Suggested fix direction
Change the matrix selection (and any heavy jobs such as Windows) to key off branch/ref (e.g., run full matrix only on `push` to `develop`/`master`, and run reduced matrix for PRs and non-default-branch pushes), OR remove/adjust the job-level `if:` so internal PRs actually run under `pull_request` and can use the reduced matrix.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@JohnMcLear JohnMcLear merged commit f8e6b20 into ether:develop Apr 5, 2026
14 checks passed
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