Repository navigation
fix: make the required validate-profile check fail, not skip - #50
Merged
Merged
Conversation
The code part of this bug merged in #48: main-branch-ruleset.json requires a pull request and the validate-profile check, and a daily job fails while main is unprotected. Main is still unprotected today; the 2026-10-14 scheduled run failed and filed issue #49. The ruleset had a gap that would open once it is applied. validate-profile had a job-level condition and needed reject-lifecycle-app, so on a pull request the lifecycle App opens, the job was skipped. GitHub counts a skipped job as a passing required check, so that pull request would show validate-profile as passed although validation never ran. validate-profile now has no job-level condition or needs. Its first step refuses the lifecycle App and fails, before checkout. The check is red, not skipped, on App-triggered runs. A person closes and reopens the pull request to run validation as themselves. The new test reads the required checks from the committed ruleset and fails if the job behind any of them can be skipped. Ledger: B247 Signed-off-by: abrichr <richard.abrich@mldsai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The regression test for B247 checked that validate-profile has no job-level condition or needs, and that its first step refuses the lifecycle App. It still passed in three cases that weaken the refusal. A step-level if can skip the refusal. continue-on-error on the refusal step turns its failure into a success, so the job goes on and the check passes. The test now fails on both, and on continue-on-error at the job level as well. A mutation run on the workflow shows the earlier test missed these three cases. The new test catches them and the five cases the earlier test already caught. Ledger: B247 Signed-off-by: abrichr <richard.abrich@mldsai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Main's committed ruleset (
main-branch-ruleset.json, from #48) makesvalidate-profilea required check. Until now, that job was skipped on runs the lifecycle App starts, because it had a job-levelifandneeds: reject-lifecycle-app. GitHub reports a skipped job as a success, even when it is a required check. So once the ruleset is applied, a pull request the App opens would showvalidate-profileas passed although validation never ran.This change keeps the job from being skipped. It now fails on those runs instead.
Fixes
validate-profilejob is skipped, and a skipped job satisfies a required check.validate-profileno longer has a job-leveliforneeds. Its first step, before checkout, refuses the App the same wayreject-lifecycle-appdoes, and fails. The other jobs are unchanged.tests/test_branch_protection.py::WorkflowTests::test_required_check_fails_instead_of_skippingreads the required checks from the committed ruleset. It fails if the job behind a required check has a job-levelif,needsorcontinue-on-error. It also fails if the job's first step is an action, lacks the App refusal, or has its owniforcontinue-on-error.Not fixed here
GET branches/main/protectionreturned 404 "Branch not protected", and bothrulesetsandrules/branches/mainreturned[]. Applying the ruleset needs an admin, so this pull request can't do it. The scheduled run on 2026-10-14 (38567461248) failed atcheck-branch-protectionand filed Branch protection on main needs attention #49. Leave Branch protection on main needs attention #49 open until the ruleset is in place.pull_requestruns use the workflow file from the pull request. With the approval floor at 0, anyone with write access can merge a pull request that weakensvalidate-profile, and the check runs the weakened version. The same applies to the lifecycle App if it can write workflow files. This pull request does not check the App's permissions. The required check stops mistakes, not a determined writer. Raising the approval floor (the open decision from fix: add a daily check that main is branch-protected #48) is what would close this.mainand is not related to this change.How it was tested
origin/main(936617b) and passes on this branch. Copying only the updated test file ontomaingives 1 failure in 418 tests. On this branch, all 418 pass (1 skipped), with the pinned versions fromrequirements/profile-consistency.txt.if,needsandcontinue-on-error,ifon the refusal step (as the first key and as a later key),continue-on-erroron the refusal step, the refusal moved after checkout, and the refusal removed. The test catches all 8. The first version of the test missed the 3 cases with a step-leveliforcontinue-on-error, so the second commit adds checks for them.ruff checkandruff format --checkpass on the test file.validate_evidence_registry.py,check_profile.py, andcheck_benchmark_claims.py --allow-recorded-drift.After merging
gh api -X POST repos/OpenAdaptAI/.github/rulesets --input main-branch-ruleset.json. This creates an active ruleset named "OpenAdapt policy: protected main". It requires a pull request and thevalidate-profilecheck from GitHub Actions, blocks force pushes and deletion, and has no bypass actors.check-branch-protectionpasses, then close Branch protection on main needs attention #49. The workflow files and updates that issue but does not close it.validate-profileas failed. To validate it, close and reopen the pull request so that a run starts under your account. Re-running the job does not help, becausegithub.actorstays the App.🤖 Generated with Claude Code