CI: Satisfy required status checks for docs-only PRs via GitHub Actions status posting#35121
CI: Satisfy required status checks for docs-only PRs via GitHub Actions status posting#35121Copilot wants to merge 5 commits into
Conversation
Co-authored-by: Sidnioulz <5108577+Sidnioulz@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the CircleCI config generator so that docs-only PRs (using the reduced docs workflow) still report the GitHub-required CircleCI status checks, by adding “dummy” jobs that complete successfully but use the same Circle job keys as the real jobs.
Changes:
- Added a
createDocsDummyJob()helper and exported dummy jobs whose names intentionally match required-status-check job IDs (Build (linux),ESLint,Tests (linux),Tests stories (linux)). - Updated config generation to include these dummy jobs (plus
fmt) when generating thedocsworkflow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/ci/main.ts | Adds the docs-workflow job list entries so required status checks are reported as passing. |
| scripts/ci/common-jobs.ts | Introduces helper + dummy job definitions intended to match existing required CircleCI job keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds a GitHub Actions job ChangesRequired Check Satisfaction for Docs-Only PRs
🎯 2 (Simple) | ⏱️ ~10 minutes
Comment |
Sidnioulz
left a comment
There was a problem hiding this comment.
Read this documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks.md
There should be a way to have conditionally defined jobs that we reject/ignore for ci:docs and that report skip in a way that github treats as a success. If this is doable then lets do it otherwise stay on your mechanism.
Also we've added a bunch more required checks:
Danger JS
ci/circleci: build--linux
ci/circleci: tests-stories--linux
ci/circleci: eslint
ci/circleci: tests--linux
ci/circleci: format-check
ci/circleci: react-latest--vite---typescript---e2e
ci/circleci: typescript-validation
ci/circleci: react-latest--vite---typescript---build
ci/circleci: react-latest--vite---typescript---create
ci/circleci: react-latest--vite---typescript---dev
ci/circleci: react-latest--vite---typescript---vitest
UI Tests: storybook-ui
UI Review: storybook-ui
ci/circleci: internal-storybook-e2e
Storybook Publish: react-vite/default-ts
Storybook Publish: storybook-ui
…r docs-only PRs Co-authored-by: Sidnioulz <5108577+Sidnioulz@users.noreply.github.com>
The GitHub conditional-skip mechanism (where a job with an Instead, I implemented a cleaner alternative: a new
The docs CircleCI workflow is now simplified to only run the real |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/trigger-circle-ci-workflow.yml (1)
197-206: ⚡ Quick winAdd error handling for commit status creation.
The loop creates commit statuses without error handling. If any
createCommitStatuscall fails (e.g., due to API rate limits, network issues, or invalid parameters), the entire job will fail and no statuses will be reported, leaving the PR blocked.🛡️ Proposed error handling
for (const check of checks) { - await github.rest.repos.createCommitStatus({ - owner: context.repo.owner, - repo: context.repo.repo, - sha, - state: 'success', - description: 'Not required for docs-only PR (ci:docs label)', - context: check, - }); + try { + await github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha, + state: 'success', + description: 'Not required for docs-only PR (ci:docs label)', + context: check, + }); + } catch (error) { + core.warning(`Failed to create status for check "${check}": ${error.message}`); + } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/trigger-circle-ci-workflow.yml around lines 197 - 206, The loop calling github.rest.repos.createCommitStatus inside the for (const check of checks) block lacks error handling; wrap each createCommitStatus call in a try/catch so failures for a single check don’t abort the whole job, log or warn the error (including check and sha) and continue to the next check, and optionally implement a simple retry/backoff around github.rest.repos.createCommitStatus to handle transient API/rate-limit errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/trigger-circle-ci-workflow.yml:
- Around line 197-206: The loop calling github.rest.repos.createCommitStatus
inside the for (const check of checks) block lacks error handling; wrap each
createCommitStatus call in a try/catch so failures for a single check don’t
abort the whole job, log or warn the error (including check and sha) and
continue to the next check, and optionally implement a simple retry/backoff
around github.rest.repos.createCommitStatus to handle transient API/rate-limit
errors.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c58a5f5d-c0dd-49e4-a918-d57b892ba9f9
📒 Files selected for processing (1)
.github/workflows/trigger-circle-ci-workflow.yml
PRs labeled
ci:docsrun a reduced CircleCIdocsworkflow, but GitHub's required status checks are never reported — leaving them stuck in "Waiting for status to be reported" and blocking merge.The GitHub conditional-skip mechanism (where a GitHub Actions job with an
if: falsecondition reports "skipped" → success) only applies to GitHub Actions jobs, not CircleCI checks. Instead, a GitHub Actions job postsstate: successcommit statuses directly to the GitHub Status API for all required checks that are not covered by the docs CircleCI workflow.Changes
.github/workflows/trigger-circle-ci-workflow.yml— adds a newsatisfy-docs-required-checksjob that runs only whenworkflow == 'docs'(i.e.,ci:docs-labeled PRs). It usesstatuses: writepermission and the GitHub Commit Status API to mark the following required checks as successful:ci/circleci: build--linuxci/circleci: eslintci/circleci: tests--linuxci/circleci: tests-stories--linuxci/circleci: typescript-validationci/circleci: react-latest--vite---typescript---e2eci/circleci: react-latest--vite---typescript---buildci/circleci: react-latest--vite---typescript---createci/circleci: react-latest--vite---typescript---devci/circleci: react-latest--vite---typescript---vitestci/circleci: internal-storybook-e2eUI Tests: storybook-uiUI Review: storybook-uiStorybook Publish: react-vite/default-tsStorybook Publish: storybook-uici/circleci: format-checkis excluded — it is satisfied by the realfmtjob in the CircleCI docs workflow.Danger JSis excluded — it always runs for all PRs via its own workflow.scripts/ci/main.ts— the docs CircleCI workflow now only runs the realfmtjob (format checking):scripts/ci/common-jobs.ts— removed thecreateDocsDummyJob()helper and all dummy job exports entirely.Summary by CodeRabbit
Summary by CodeRabbit
Manual testing
Will require merge and monitoring