Repository navigation
fix(ci): Security Posture reads every page of alerts - #84
Merged
Merged
Conversation
The code scanning API returns at most a hundred alerts per call, and the gate read one page of each of its four lists. cookieradar met it on 2026-11-13 (cookieradar #70): 123 open alerts on a pull request and 142 on main, three exceptions past the hundredth read as matching nothing, and the gate failed on a product whose every alert was explained. An unexplained alert past the hundredth would not have been seen at all. This repository had 49 open on main on 2026-11-15. Each read now goes through `gh api --paginate --slurp` and joins the pages; a failed read still fails. The step and its tests are cookieradar's, which were byte-identical here before the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging this PR will not alter performance1 warning
Comparing |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.



What
The four reads of code scanning alerts in
security-posture.yml(open and closed on the ref under review, open and closed on main) go throughgh api --paginate --slurp, and the pages are joined into one list. A failed read still fails, so an unreadable list is not taken for an empty one.Why
The API returns at most a hundred alerts per call, and the gate read only the first page. cookieradar met it on 2026-11-13 (maksimtech/cookieradar#70): a pull request with 123 open alerts and main with 142. Three exceptions whose findings sat past the hundredth read as "matching nothing", and the gate failed on a product whose every alert was explained. Read the other way, an unexplained alert past the hundredth would not have been seen.
This repository had 49 open alerts on main on 2026-11-15, so the gate has not met the limit yet. The fix comes before it does.
How it was checked
tests/test_security_posture_workflow.pywere byte-identical to cookieradar's before its fix, so both are ported unchanged.ghthat answers in two pages, and refuse to run if the realghwould be reached.🤖 Generated with Claude Code