Skip to content

CI: Satisfy required status checks for docs-only PRs via GitHub Actions status posting#35121

Closed
Copilot wants to merge 5 commits into
nextfrom
copilot/fix-ci-status-checks-for-docs
Closed

CI: Satisfy required status checks for docs-only PRs via GitHub Actions status posting#35121
Copilot wants to merge 5 commits into
nextfrom
copilot/fix-ci-status-checks-for-docs

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

PRs labeled ci:docs run a reduced CircleCI docs workflow, 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: false condition reports "skipped" → success) only applies to GitHub Actions jobs, not CircleCI checks. Instead, a GitHub Actions job posts state: success commit 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 new satisfy-docs-required-checks job that runs only when workflow == 'docs' (i.e., ci:docs-labeled PRs). It uses statuses: write permission and the GitHub Commit Status API to mark the following required checks as successful:

    • ci/circleci: build--linux
    • ci/circleci: eslint
    • ci/circleci: tests--linux
    • ci/circleci: tests-stories--linux
    • ci/circleci: typescript-validation
    • ci/circleci: react-latest--vite---typescript---e2e
    • 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
    • ci/circleci: internal-storybook-e2e
    • UI Tests: storybook-ui
    • UI Review: storybook-ui
    • Storybook Publish: react-vite/default-ts
    • Storybook Publish: storybook-ui

    ci/circleci: format-check is excluded — it is satisfied by the real fmt job in the CircleCI docs workflow. Danger JS is excluded — it always runs for all PRs via its own workflow.

  • scripts/ci/main.ts — the docs CircleCI workflow now only runs the real fmt job (format checking):

if (isWorkflowOrAbove(workflow, 'docs')) {
  jobs.push(fmt);
}
  • scripts/ci/common-jobs.ts — removed the createDocsDummyJob() helper and all dummy job exports entirely.

Summary by CodeRabbit

  • Chores
    • Optimized CI pipeline for documentation-only PRs by replacing dummy CircleCI jobs with a lightweight GitHub Actions job that posts commit statuses directly to the GitHub Status API, satisfying all required checks without executing the full CI pipeline.

Summary by CodeRabbit

  • Chores
    • CI workflow updated to automatically mark required checks as successful for documentation-only pull requests, streamlining and speeding up docs PR handling.

Manual testing

Will require merge and monitoring

Co-authored-by: Sidnioulz <5108577+Sidnioulz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unnecessary status check for documentation pull requests ci: satisfy required status checks for docs-only PRs via dummy jobs Jun 10, 2026
Copilot AI requested a review from Sidnioulz June 10, 2026 06:37
@Sidnioulz Sidnioulz changed the title ci: satisfy required status checks for docs-only PRs via dummy jobs CI: Satisfy required status checks for docs-only PRs via dummy jobs Jun 10, 2026
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:normal Run our default set of CI jobs (choose this for most PRs). qa:skip Pull Requests that do not need any QA. labels Jun 10, 2026
@Sidnioulz Sidnioulz marked this pull request as ready for review June 10, 2026 07:11
Copilot AI review requested due to automatic review settings June 10, 2026 07:11

Copilot AI 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.

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 the docs workflow.

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.

Comment thread scripts/ci/common-jobs.ts Outdated
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a9499573-7798-4de2-b118-5cb0f070f97e

📥 Commits

Reviewing files that changed from the base of the PR and between 77e1155 and 93971ca.

📒 Files selected for processing (1)
  • .github/workflows/trigger-circle-ci-workflow.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/trigger-circle-ci-workflow.yml

📝 Walkthrough

Walkthrough

This PR adds a GitHub Actions job satisfy-docs-required-checks that runs when the computed workflow parameter is docs and sets a fixed list of CircleCI/GitHub status contexts to success for the PR head SHA via github.rest.repos.createCommitStatus.

Changes

Required Check Satisfaction for Docs-Only PRs

Layer / File(s) Summary
GitHub Actions job to satisfy required checks
.github/workflows/trigger-circle-ci-workflow.yml
New conditional job satisfy-docs-required-checks runs when needs.get-parameters.outputs.workflow == 'docs', requests statuses: write, and iterates a hardcoded list of required status contexts calling github.rest.repos.createCommitStatus to set each to success for the PR head SHA (with context.sha fallback).

🎯 2 (Simple) | ⏱️ ~10 minutes


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

@Sidnioulz Sidnioulz 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.

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>
Copilot AI requested review from a team June 10, 2026 08:36

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

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

T...

The GitHub conditional-skip mechanism (where a job with an if: false condition reports "skipped" → success) only applies to GitHub Actions jobs, not CircleCI checks. Since the required checks are ci/circleci: status checks posted by CircleCI, that mechanism doesn't directly apply.

Instead, I implemented a cleaner alternative: a new satisfy-docs-required-checks GitHub Actions job in trigger-circle-ci-workflow.yml that uses the GitHub Commit Status API to post state: 'success' for all required checks when the workflow is docs. This:

  • Removes the dummy CircleCI jobs entirely — no more risk of collision with real jobs in non-docs workflows
  • Covers all the new required checks you listed: ci/circleci: typescript-validation, ci/circleci: react-latest--vite---typescript---{e2e,build,create,dev,vitest}, ci/circleci: internal-storybook-e2e, UI Tests: storybook-ui, UI Review: storybook-ui, Storybook Publish: react-vite/default-ts, Storybook Publish: storybook-ui
  • Excludes ci/circleci: format-check — it's already covered by the real fmt job in the CircleCI docs workflow
  • Excludes Danger JS — it always runs for all PRs via its own danger-js.yml workflow

The docs CircleCI workflow is now simplified to only run the real fmt job.

Copilot AI changed the title CI: Satisfy required status checks for docs-only PRs via dummy jobs CI: Satisfy required status checks for docs-only PRs via GitHub Actions status posting Jun 10, 2026
Copilot AI requested a review from Sidnioulz June 10, 2026 08:37

@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 (1)
.github/workflows/trigger-circle-ci-workflow.yml (1)

197-206: ⚡ Quick win

Add error handling for commit status creation.

The loop creates commit statuses without error handling. If any createCommitStatus call 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9ec9052 and 77e1155.

📒 Files selected for processing (1)
  • .github/workflows/trigger-circle-ci-workflow.yml

Comment thread .github/workflows/trigger-circle-ci-workflow.yml Outdated
@Sidnioulz Sidnioulz closed this Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal Run our default set of CI jobs (choose this for most PRs). qa:skip Pull Requests that do not need any QA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Unnecessary status check for documentation related pull requests

4 participants