Repository navigation
Fix(gating): Accept a recent publisher run - #363
ModeSevenIndustrialSolutions merged 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Publisher transport failures can raise NetworkError after retries, aborting the organisation report instead of falling back to the sample; handling and a regression test are needed.
1 open issue
What changed in this PR
Adds recent successful publisher runs as organisation-support evidence, preventing clean fuzzing results from being missed by repository sampling.
Changes:
- Adds configurable publisher workflows with defaults and validation.
- Checks publisher runs before sampling, leaving Scorecard unchanged.
- Documents the new evidence layer and adds regression coverage.
| File | Description |
|---|---|
| tests/test_gating.py | Tests publisher evidence, precedence and fallback. |
| tests/test_config.py | Tests defaults, overrides and validation. |
| tests/test_collect.py | Extends the collection fake client. |
| tests/test_client.py | Tests publisher responses and query parameters. |
| tests/test_cli.py | Mocks publisher reads. |
| src/github_security_report/gating.py | Adds concurrent publisher probes before sampling. |
| src/github_security_report/config/schema.py | Defines allowed publisher configuration keys. |
| src/github_security_report/config/models.py | Adds publisher defaults and model field. |
| src/github_security_report/config/key_notes.py | Describes the new configuration key. |
| src/github_security_report/config/blocks.py | Validates and merges publisher entries. |
| src/github_security_report/config/__init__.py | Exports publisher constants. |
| src/github_security_report/collect/protocols.py | Declares the publisher-read interface. |
| src/github_security_report/collect/org.py | Passes publisher configuration into gating. |
| src/github_security_report/client/org_reads.py | Queries recent successful publisher runs. |
| docs/org-scan-setup.md | Documents evidence order and configuration. |
| docs/adr/0009-fuzzing.md | Updates the fuzz-support decision rationale. |
Review effort: Balanced
878f13b to
cc2504f
Compare
cc2504f to
11895e6
Compare
There was a problem hiding this comment.
🤖 Antagonistic review by agent: 1 finding(s) for the human reviewer.
The publisher evidence layer preserves the existing fallbacks, but its date-only filter accepts runs older than the documented seven-day window.
Antagonistic round 1 of 3. Revision requested from Code Monkey.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
11895e6 to
f5b0daa
Compare
Feature gating decided fuzz support by sampling luck. A clean fuzz run uploads an analysis and no alert, and no ruleset requires a fuzz workflow, so the only evidence left was a 10-repository spread sample. With eight fuzzed repositories in 139, the sample can miss every one, and archiving a repository shifts it: the Fuzzing section of the lfreleng-actions report disappeared although the central fuzz job runs green every day. Add a deterministic layer between ruleset evidence and the sample: a successful run, in the last seven days, of the organisation workflow that publishes the signal's SARIF. The new report.publisher_workflows key maps zizmor, aislop and fuzz to "<repository>:<workflow file>", defaulting to the reference publishers in the organisation's .github repository. A configured mapping merges into the default and an empty string turns an entry off. The client reads the workflow's successful runs, and any non-200, malformed body or transport failure is no evidence, so the signal falls through to the sample as before. Rejected credentials and a spent rate limit still abort the run. Scorecard runs per repository and gets no publisher probe. Document the layer and key in the setup guide and ADR-0009. Review: a transport failure that exhausted the retries raised NetworkError from the publisher probe and aborted the organisation report, as quiet=True only lowers logging. The probe now catches NetworkError and returns no evidence, re-raising AuthError and RateLimitError as the pattern inventory read does. A regression test covers a connection failure and a 401. Review: the entry check refused valid workflow file names such as "fuzz nightly.yaml" or "fuzz#nightly.yaml", which match the documented form, and aborted configuration loading. The check now takes any single-segment name ending .yml or .yaml with no "/" or ":" and no control character, and the client percent-encodes the file name as one path segment, as workflow_state does. Tests cover both names and the encoded request path. Review: the run filter sent the cutoff's date alone, so a run from earlier on the cutoff day, up to a day past the seven-day window, counted as support. The filter now carries the full UTC timestamp, and the probe also requires the newest run's created_at to fall at or after the cutoff. Client tests cover a run one second before the cutoff on the same date and a run without a timestamp. Review: a run's created_at without a UTC offset, such as "2026-12-01T00:00:00", parsed as a naive datetime, and comparing it with the aware cutoff raised TypeError and aborted the organisation report. The probe now treats such a timestamp as no evidence. A client test covers the response. Co-authored-by: Copilot <[email protected]> Signed-off-by: lf-releng-code-monkey-bot[bot] <332050256+lf-releng-code-monkey-bot[bot]@users.noreply.github.com>
f5b0daa to
f57e292
Compare
There was a problem hiding this comment.
🤖 Antagonistic review by agent: no line-level findings; the summary below is the verdict.
The publisher-evidence layer appears sound and preserves the existing gating fallbacks. No actionable defects found in the diff or dependent code.
Antagonistic round 2 of 3.
Automated antagonistic review by lf-releng-antagonistic-review-bot[bot] using model gpt-6-astra; see the run. This is not a human review and never an approval: a maintainer must still review and approve this pull request.
fc1c179
into
lfreleng-actions:main

Closes #362
Authored by an AI agent; human review required
claude-opus-5.5via GitHub Copilot CLI28da64f30fb3f9e4b65de5344fd3ae6b254e00cauv run pytest -q tests/test_client.py -k publisher # without fixuv run pytest -quv run ruff check .uv run ruff format --check .python3 /home/runner/work/github-code-monkey-bot/github-code-monkey-bot/monkey-assets/scripts/message_check.py 28da64f30fb3f9e4b65de5344fd3ae6b254e00cagit log --raw --format=%h 28da64f30fb3f9e4b65de5344fd3ae6b254e00ca..HEADprek run --files docs/adr/0009-fuzzing.md docs/org-scan-setup.md src/github_security_report/client/org_reads.py src/github_security_report/collect/org.py src/github_security_report/collect/protocols.pThe
github-code-monkey-botworkflow opened this pull request.Nobody has merged it; a maintainer must review it first.
Review findings on this pull request are answered by a later revision round of this workflow, up to ten rounds per antagonistic review round; after that a maintainer, or the next antagonistic review, takes on any finding that remains, and a maintainer reviews every round before merge.
Round 4 of revision, on its base.
Fixes #362.
Feature gating decided fuzz support by sampling luck. A clean fuzz run uploads an analysis and no alert, and no ruleset requires a fuzz workflow. That left a 10-repository spread sample as the only evidence, and it could miss all eight fuzzed repositories in 139. This pull request adds a deterministic layer between ruleset evidence and the sample: a successful run, in the last seven days, of the organisation workflow that publishes the signal's SARIF.
report.publisher_workflowsmapszizmor,aislopandfuzzto"<repository>:<workflow file>". It defaults to the publishers in the organisation's.githubrepository, merges likeruleset_workflows, and an empty string turns an entry off.publisher_recent_successreads the workflow's newest successful run at or after the cutoff. A non-200, a malformed body, a timestamp without a UTC offset or a transport failure is no evidence. Rejected credentials and a spent rate limit still abort.This round
Copilot found that a run
created_atwithout a UTC offset (2026-12-01T00:00:00) parsed as a naive datetime. Comparing it with the aware cutoff raisedTypeErrorand aborted the report. The probe now treats such a timestamp as no evidence, and a new client test covers it. The test fails without the fix and passes with it.Checks run
uv run pytest(2015 passed),ruff check,ruff format --check, the commit message check, andprek runover every changed file (mypy, basedpyright and aislop included) all exit 0. No hook was skipped.