ci(github): add Mergify flaky test detection workflow#983
Conversation
Adds a scheduled GitHub Actions workflow that runs Jest unit tests 5 times in parallel (matrix strategy) every 12 hours on weekdays, uploading JUnit XML results to Mergify for flaky test analysis. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtPYPZotcNDvxig8bNXqUh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtPYPZotcNDvxig8bNXqUh
🔍 Reviewer Summary for PR #983CI Status: ❌ Recommendations
|
|
Warning Review limit reached
More reviews will be available in 20 minutes and 32 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds a new entry to the CHANGELOG.md documenting the addition of Mergify flaky test detection. The reviewer suggested a minor grammatical improvement to fix a comma splice in the description of the new workflow.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
|
||
| ### Added | ||
|
|
||
| - **Mergify flaky test detection** — Added `.github/workflows/flaky-test-detection.yml` to detect flaky Jest unit tests via Mergify CI. Runs 5 parallel matrix jobs every 12 hours on weekdays, uploads JUnit XML results to Mergify using `mergifyio/gha-mergify-ci@v14` with `flaky_test_detection: true`. ([#979](https://github.com/lightspeedwp/.github/issues/979)) |
There was a problem hiding this comment.
The sentence has a minor grammatical issue (comma splice) between 'weekdays' and 'uploads'. Replacing the comma with 'and' improves readability and sentence flow. For example:
- **Mergify flaky test detection** — Added ".github/workflows/flaky-test-detection.yml" to detect flaky Jest unit tests via Mergify CI. Runs 5 parallel matrix jobs every 12 hours on weekdays and uploads JUnit XML results to Mergify using "mergifyio/gha-mergify-ci@v14" with "flaky_test_detection: true". ([#979](https://github.com/lightspeedwp/.github/issues/979))
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtPYPZotcNDvxig8bNXqUh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bab98ebe52
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - run: npm install --no-save jest-junit | ||
|
|
||
| - name: Run unit tests | ||
| run: npx jest --config .jest.config.cjs --reporters=jest-junit --outputFile=junit-unit-${{ matrix.run_number }}.xml || true |
There was a problem hiding this comment.
Write the JUnit XML where Mergify looks
In this workflow, the upload step later points Mergify at junit-unit-${{ matrix.run_number }}.xml, but Jest's --outputFile only writes Jest JSON when --json is also set (per the Jest CLI docs), and jest-junit uses JEST_JUNIT_OUTPUT_FILE/JEST_JUNIT_OUTPUT_NAME or reporter options for XML output. On every scheduled/manual matrix run this will leave the expected XML absent or still at junit.xml, so gha-mergify-ci has no JUnit report to ingest for flaky-test analysis; set the JEST_JUNIT_* env vars or reporter options to this filename.
Useful? React with 👍 / 👎.
| matrix: | ||
| run_number: [1, 2, 3, 4, 5] | ||
| env: | ||
| MERGIFY_JOB_NAME: check |
There was a problem hiding this comment.
Pass the job-name override to the action input
This job-level MERGIFY_JOB_NAME does not reach Mergify as intended because mergifyio/gha-mergify-ci@v14 sets MERGIFY_JOB_NAME inside its composite step from the job_name input, and this workflow does not pass that input. In the scheduled matrix context, uploads will therefore be associated with the matrix job rather than the existing PR CI check job that the workflow is trying to match; move this to with: job_name: check on the upload step.
Useful? React with 👍 / 👎.
- Replace --outputFile (Jest JSON flag) with JEST_JUNIT_OUTPUT_FILE env var so jest-junit writes JUnit XML to the expected path - Move MERGIFY_JOB_NAME from job env to job_name input on the upload step, which is how gha-mergify-ci@v14 reads the override Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EtPYPZotcNDvxig8bNXqUh
Build/CI Pull Request
This PR updates the build or CI configuration for Pipelines, linting, packaging, or release automation.
Please review the summary, baseline/target, and changelog below.
Linked issues
Closes #979
Build/CI change
.github/workflows/flaky-test-detection.yml) that runs Jest unit tests 5 times in parallel using a matrix strategy and uploads JUnit XML results to Mergify for flaky test analysis.Baseline & Target
Rollback
.github/workflows/flaky-test-detection.yml. No other files are affected.Notes
MERGIFY_TOKENsecret (withciscope) to be present in repository settings.jest-junitis installed at runtime (npm install --no-save jest-junit) since it is not indevDependencies.MERGIFY_JOB_NAMEset tocheckto match the existing PR CI job name intesting.yml.Changelog
Added
Checklist (Global DoD / PR)
🤖 Generated with Claude Code
https://claude.ai/code/session_01EtPYPZotcNDvxig8bNXqUh
Generated by Claude Code