Add no-op companion for API Compatibility required check#4995
Merged
ChrisJBurns merged 1 commit intomainfrom Apr 21, 2026
Merged
Add no-op companion for API Compatibility required check#4995ChrisJBurns merged 1 commit intomainfrom
ChrisJBurns merged 1 commit intomainfrom
Conversation
Branch protection on main requires the CRD Schema Compatibility check to pass. The real workflow (api-compat.yml, introduced in #4980 and refined in #4987, #4991, #4993) has a paths filter that limits it to PRs touching cmd/thv-operator/api/**, files/crds/**, or the workflow itself — correct in isolation, but deadlocks every PR that doesn't touch those paths: the workflow never fires, the required check never reports, GitHub marks it as expected-but-waiting forever, and the PR cannot merge. Add a companion workflow with paths-ignore set to the inverse path list, reusing the same workflow name and job name so the check-run context string is identical (CRD Schema Compatibility). On PRs that don't touch the api surface, the companion runs in a few seconds, echoes a short message, and reports success — satisfying branch protection. Broaden the real workflow's self-watch from .github/workflows/ api-compat.yml to .github/workflows/api-compat*.yml so edits to either file fire the real check and keep the companion from firing on its own edits. Keep the paths and paths-ignore lists mutually exclusive. A path that moves from one list needs to move from the other or the deadlock (or a double-fire) returns. Currently-open PRs blocked by this deadlock need to resync with main (rebase, merge, or any fresh push) after this lands to pick up the companion workflow. The fix does not unblock them retroactively. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4995 +/- ##
=======================================
Coverage 68.98% 68.99%
=======================================
Files 552 552
Lines 72996 72996
=======================================
+ Hits 50359 50364 +5
+ Misses 19639 19634 -5
Partials 2998 2998 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rdimitrov
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Branch protection on
mainrequiresCRD Schema Compatibilityto pass. The real workflow (api-compat.yml, introduced in #4980 and refined in #4987, #4991, #4993) is filtered to PRs touchingcmd/thv-operator/api/**,deploy/charts/operator-crds/files/crds/**, or the workflow itself — correct in isolation, but it deadlocks every PR that doesn't touch those paths: the workflow never fires, the required check never reports, GitHub marks it as "expected — waiting to be reported" indefinitely, and the PR cannot merge.Example: #4942 (a status-helper refactor that touches zero API surface) is currently blocked on this.
This PR adds a companion no-op workflow that satisfies the required check on PRs that don't touch the api surface.
How it works
.github/workflows/api-compat-noop.ymluses the same workflowname:(API Compatibility) and jobname:(CRD Schema Compatibility) as the real workflow, so the resulting check-run context string is identical. Branch protection treats a successful report from either workflow as satisfying the requirement.The two workflows use strictly complementary path filters:
api-compat.ymlpaths:include the api-surface paths +api-compat*.ymlapi-compat-noop.ymlpaths-ignore:same listThe real workflow also gets a small change: its self-watch path broadens from
.github/workflows/api-compat.ymlto.github/workflows/api-compat*.yml, so edits to either workflow fire the real check (and the companion skips viapaths-ignore, avoiding a double-fire on workflow edits).Caveats
This PR unblocks itself. The edit to
api-compat.ymlmatches the real workflow'spaths:filter, so the real check fires on this very PR. No CRDs changed, so it reports Compatible and the PR is mergeable without the companion needing to exist yet.Currently-blocked PRs need a resync after merge. Introduce MutateAndPatchStatus helper for status writes #4942 (and any other PR stuck on the same deadlock) will remain stuck until someone pushes a commit, rebases onto main, or reopens the PR — that's what causes the branch-protection status to re-evaluate against the newly-merged companion. The fix does not unblock retroactively.
Keep the paths lists in sync. If someone adds a new path to the real workflow's
paths:, the same path must be added to the companion'spaths-ignore:(and vice versa). Drift causes either a deadlock (path removed frompaths-ignorebut still inpaths) or a double-fire (added to one without the other). The companion workflow's header comment calls this out explicitly.Type of change
Test plan
python3 -c 'import yaml; yaml.safe_load(...)').api-compat*.yml, so this PR triggers the real check (no CRD changes → Compatible).paths-ignorelist is byte-identical to the real workflow'spathslist (modulo theapi-compat*.ymlglob covering both workflow files).cmd/thv-operator/api/sees the companion workflow run to completion in seconds and reportsCRD Schema Compatibilityas success.task test) — N/A, no Go changes.task lint-fix) — N/A, no Go changes.API Compatibility
v1beta1API.Does this introduce a user-facing change?
No. Internal CI only. Contributors who previously saw PRs deadlock on the required status check will now see the check report success in seconds when their PR doesn't touch api surface.
Special notes for reviewers
dorny/paths-filterinside the main workflow trade the simpler file for more machinery; given this is a 30-line no-op, the two-file approach is cleaner.timeout-minutes: 2. The no-op is a singleecho— it should complete in well under a second. The 2-minute bound protects against runner starvation.job.name:is ever renamed, both must move together, and the branch-protection required-check list must be updated to the new name. The current nameCRD Schema Compatibilityis load-bearing.Generated with Claude Code