ci: add one job branch protection can require - #90
Open
Kartikey1306 wants to merge 1 commit into
Open
Conversation
`required_status_checks` is null on master here, the same gap eos#92 and ebuild#87 track: nothing builds the merge result before it becomes master. This repository has had the consequence twice -- embeddedos-org#70 landed a TEST() macro missing a line continuation, and master was red from 08-31 08:07 until embeddedos-org#77. Marking a check required is a settings change, but it needs a name worth pointing at. `release` is skipped on every pull request, and a required check that is skipped never reports, so the pull request waits for a status that never arrives. Requiring the three real jobs individually works only until the next one is added and silently sits outside the requirement. `ci-gate` is one job, one stable name, that succeeds only if every other job that runs on a pull request succeeded. `if: always()` so a real failure shows as a red X rather than a pull request that hangs. Any non-success result fails it, `skipped` included -- a job that did not run did not verify anything, which is the fail-open shape embeddedos-org#38, embeddedos-org#59 and embeddedos-org#82 removed from the boot path. tests/unit/test_ci_gate.py fails if a job is added without being wired into the gate. Verified by mutation: dropping a job from `needs`, removing `if: always()`, and adding an unwired job are each caught. pyyaml added to the pytest installer, since the test parses the workflow. Verified: 25 Python tests pass (1 skipped), ctest 20/20.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
The gate was run against a real failure, not just reasoned aboutPushed a deliberately failing test to a branch on my fork so the whole workflow Job results in that run: And the gate's own log: Three things that confirms, which the workflow file alone does not:
The self-test branch has been deleted; nothing from it is in this PR. |
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.
required_status_checksisnullon this repository'smaster— the same gapeos#92 and ebuild#87 track. @srpatcha noted it applies here too:
This repo has paid for it. #70 landed a
TEST()macro that had lost a\linecontinuation;
masterwas red from 08-31 08:07 until #77, and the 24 resultingerrors all pointed away from the cause. Nothing built the merge result before it
became
master.Why the existing checks cannot be required as they are
releaseis skipped on every pull request (if: startsWith(github.ref, 'refs/tags/v')), and a required check that is skipped never reports — thepull request waits for a status that never arrives, which presents as
infrastructure flake rather than a policy.
Requiring
test,build-armandstatic-analysisindividually works today andstops working the next time a job is added, silently.
What this adds
One job,
ci-gate, displayed asCI Gate— the single name to require:if: always()so a real failure shows as a red X rather than a hang.skippedincluded — a job that did notrun did not verify anything, which is the fail-open shape fix(image_verify): fail closed when the CRC32 integrity path cannot read flash #38, fix(keystore): fail closed when the OTP trust anchor cannot be read #59 and fix(secure-boot): a debug lock that failed must not report a successful boot #82
removed from the boot path.
releaseis excluded deliberately, and the test enforces that the onlyjobs allowed outside the gate are tag-only.
The test is the part that keeps working
tests/unit/test_ci_gate.py(6 tests) parsesci.ymland fails if a job isadded without being wired into the gate.
Verified by mutation:
build-armfromneedsif: always()pyyamlis added to the pytest installer, which had onlypytest pytest-cov.Verification
pytest tests/pytest tests/unit/test_ci_gate.pyctestyaml.safe_loadof the edited workflowBranches from
masterdirectly; unlike the other two repos,masterhere isgreen.
What is still a maintainer action
Settings → Branches → master → Require status checks → add
CI Gate. Thesame PR is open on ebuild (#103) and eos (#121), so the name is identical in all
three.