Skip to content

chore: Make the Compile Check required status check report on every PR - #1328

Merged
hatayama merged 5 commits into
v3-betafrom
feature/require-ci-checks-before-merge
Jun 13, 2026
Merged

chore: Make the Compile Check required status check report on every PR#1328
hatayama merged 5 commits into
v3-betafrom
feature/require-ci-checks-before-merge

Conversation

@hatayama

@hatayama hatayama commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Lets the repository safely require Compile Check (Linux) as a merge gate without blocking PRs that do not touch C# code.

User Impact

  • A branch ruleset can now require CI to pass before merging. Previously, the compile check only ran on PRs that changed C# files and only when targeting main, so making it a required status check would leave non-C# PRs (and PRs targeting v3-beta) stuck forever waiting for a check that never reports.
  • After this change, every PR to main or v3-beta reports the Compile Check (Linux) status — either the real compile run (C# changes) or an instant no-op success (no C# changes) — so the required check is always satisfiable.

Changes

  • Add v3-beta to the pull_request branch filter of the real Unity compile check workflow.
  • Add a no-op twin workflow (unity-compile-check-skip.yml) that reports the same Compile Check (Linux) check name via the inverse paths-ignore filter, following GitHub's documented pattern for skipped-but-required checks.

Verification

  • Validated both workflow YAML files parse successfully.
  • Confirmed Compile Check (Linux), build-typescript-server, and test-unity-package all run under the github-actions app (integration_id 15368) used by the ruleset.

Review in cubic

The branch ruleset will require "Compile Check (Linux)" before merging,
but the workflow only triggers on C# path changes and only for PRs
targeting main. Without changes, PRs without C# edits (or PRs targeting
v3-beta) would never report the check and stay unmergeable.

- Add v3-beta to the pull_request branches of the real compile check
- Add a no-op twin workflow with the inverse paths-ignore filter so the
  check name is always reported, following GitHub's documented pattern
  for skipped-but-required checks
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hatayama, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 15 minutes and 19 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 075a19a7-d5de-4b60-9c15-707c60bc56e6

📥 Commits

Reviewing files that changed from the base of the PR and between 72e143a and 3ab74b4.

📒 Files selected for processing (1)
  • .github/workflows/unity-compile-check-and-test-runner.yml
📝 Walkthrough

Walkthrough

The Unity compile check workflow is expanded to run on v3-beta pull requests, removes trigger-level path filtering, adds a runtime C# change detection step using git diff, and gates downstream compilation and error check steps on that detection result. A test file adds a using directive.

Changes

Compile Check CI Updates for v3-beta

Layer / File(s) Summary
Workflow trigger expansion and C# change detection
.github/workflows/unity-compile-check-and-test-runner.yml
The pull_request trigger is updated to target both main and v3-beta and removes path-level filtering at the event trigger level. A new "Detect C# changes" step using git diff between the PR base and head (with fetch-depth: 0) determines if C# files changed and exports a csharp output flag.
Gate compilation checks on detected C# changes
.github/workflows/unity-compile-check-and-test-runner.yml
The Unity compilation and "Check for compile errors and warnings" steps now conditionally execute only if both C# changes are detected (steps.changes.outputs.csharp == 'true') and a Unity license is available.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: making the Compile Check required status check report on every PR by adding v3-beta support and conditional execution.
Description check ✅ Passed The description is directly related to the changeset, explaining the motivation, changes made, and verification performed for the workflow modifications.
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 feature/require-ci-checks-before-merge

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

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

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In @.github/workflows/unity-compile-check-skip.yml:
- Around line 12-29: The two workflows both declare the job compile-check and
can both run for the same PR; fix by making them mutually exclusive: either
consolidate .github/workflows/unity-compile-check-skip.yml into the main
.github/workflows/unity-compile-check-and-test-runner.yml (remove the duplicate
compile-check job), or keep the skip workflow but make its compile-check job
conditional by adding a preliminary step/job that detects C# changes (via git
diff of the PR or the checkout action) and only proceeds when no C# files are
present (expose that as an output and use job-level if to skip the no-op),
referencing the compile-check job name and the two workflow filenames to locate
the code to change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4704fb26-a33e-47e3-85b2-e341164f5812

📥 Commits

Reviewing files that changed from the base of the PR and between 1b1b89b and 5ce3451.

📒 Files selected for processing (2)
  • .github/workflows/unity-compile-check-and-test-runner.yml
  • .github/workflows/unity-compile-check-skip.yml

Comment thread .github/workflows/unity-compile-check-skip.yml Outdated
Running the Unity compile check on v3-beta PRs exposed that the
DynamicCodeExecutionScheduler unit tests no longer compiled on this
branch. The production scheduler was moved to
Packages/src/Editor/FirstPartyTools/ExecuteDynamicCode/Execution and its
namespace changed to io.github.hatayama.UnityCliLoop.FirstPartyTools, but
the test project was never updated, so the workflow's "Run concurrency
unit tests" step failed with CS2001 (missing source files) and CS0246
(missing types). This was hidden until now because the workflow only ran
on PRs targeting main.

- Point the csproj <Compile Include> paths at the relocated source files
- Import the FirstPartyTools namespace in the test so the scheduler types
  resolve, since UnitTests is no longer nested under the source namespace

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found and verified against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/unity-compile-check-skip.yml Outdated
CodeRabbit and cubic both flagged that the no-op twin workflow and the
real compile workflow were not mutually exclusive: GitHub's paths-ignore
fires whenever any changed file is outside the ignored set, so a PR that
mixes C# and non-C# files triggered both workflows and produced two
"Compile Check (Linux)" results. As a required status check, the no-op
success could mask the real failure, defeating the merge gate.

Consolidate into one always-running workflow. A change-detection step
diffs the PR head against its base and only runs the .NET tests and Unity
compile when C# sources changed; otherwise the job reports success
immediately. This guarantees exactly one Compile Check result per PR.

- Remove the workflow-level paths filter and detect C# changes in-job
- Gate the .NET and Unity steps on the detection output
- Delete the redundant unity-compile-check-skip.yml twin workflow
The architecture test TestPullRequestWorkflowCacheActionsRequireTrustedUnitySecrets
requires every actions/cache step in a pull request workflow to carry the
exact guard `if: env.HAS_UNITY_LICENSE == 'true'`, so that cache actions
never run for untrusted PRs that lack the Unity license secret. The new
change-detection gate had combined that guard with the C# detection
output, which broke the literal match and failed build-cli.

Drop the C# condition from the cache step's `if`. The expensive Unity
compile remains gated on C# changes; restoring the Library cache on a
non-C# PR is harmless and keeps the security guard intact.

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In @.github/workflows/unity-compile-check-and-test-runner.yml:
- Around line 50-54: The change detection regex (the grep -qE on "$CHANGED" in
unity-compile-check-and-test-runner.yml) only matches .cs, .csproj and the
workflow file, so edits to Unity compile-affecting files (.asmdef,
Packages/manifest.json, Packages/packages-lock.json, etc.) are missed; update
that grep pattern to also include .asmdef and the specific package/manifest
filenames (e.g., Packages/manifest.json, Packages/packages-lock.json) and any
other project metadata files you care about so that when CHANGED contains those
paths the script emits "csharp=true" to GITHUB_OUTPUT.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d785b8af-bca6-4634-9f7e-eb85ff363c1d

📥 Commits

Reviewing files that changed from the base of the PR and between 2aa3ae4 and 72e143a.

📒 Files selected for processing (1)
  • .github/workflows/unity-compile-check-and-test-runner.yml

Comment thread .github/workflows/unity-compile-check-and-test-runner.yml Outdated
CodeRabbit flagged that the change-detection regex only matched .cs and
test .csproj files, so a PR touching only compile-shaping metadata could
skip the Unity compile yet still report the required check as green.

Extend the detection to assembly definitions and package metadata, which
the workflow already treats as compile-affecting via the Library cache key:

- Packages/**/*.asmdef and Assets/**/*.asmdef
- Packages/manifest.json
- Packages/packages-lock.json
@hatayama
hatayama merged commit 9753fce into v3-beta Jun 13, 2026
6 checks passed
@hatayama
hatayama deleted the feature/require-ci-checks-before-merge branch June 13, 2026 02:58
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