Repository navigation
A Security run on a repository with issues turned off audits and skips fixing (#2094) - #2125
Merged
Merged
Conversation
…s fixing (#2094) A repository with GitHub issues turned off cannot hold a Security fix Ticket. With fixing allowed, the Security run now reads has_issues before selecting a pending fix: when off, it starts no publishing session, lets the reproduced finding hold off no audit, and ends successfully saying why. fix-findings and the security-audit suppression gate do the same. A failed or malformed metadata read still fails the run.
… 0015 amendment
…awaits; new-audit and metadata-error regressions
Main enabled clippy::wildcard_enum_match_arm, which rejects the catch-all arm #2094 added in security::run.
Merged
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
On a repository with GitHub issues turned off, a Security run with fixing allowed spent a
security-fix-publishingSession, then failed atgh issue list … has disabled issues. The cause: nothing checked the repository could hold a Security fix Ticket before publication tried to list and create issues.When fixing is allowed, the run now reads
has_issuesbefore it selects a pending fix:findings recorded(exit 0). It starts no publishing Session and creates no issue or fix link. The reproduced finding no longer suppresses the audit. On an unchanged Base, a repeat run is the usual quiet skip.fix-findingsreadshas_issuesonly once a finding awaits a fix. If issues are off, the Step succeeds and says why.security-audit/reproduce-findings"awaits an allowed fix" skip no longer fires when issues are off.GitHub::has_issuesreadsgh api repos/{repo}. A missing or non-boolhas_issuesis anInvalidResponseerror.tests/fakes/gh.rsgains ahas_issuesstate, default on. When it is false,gh issue listandgh issue createfail as gh does.docs/guide.mdand the regenerated manual.site/index.html,site/how-it-works/,site/architecture/.Evidence
Execution evidence
ca8065f4, with the new fake and test):cargo test --test security_run a_repository_with_issues_off_audits_and_skips_fixing_without_a_publishing_sessioncargo test --test process issues_are_turned_off: both new Custom-path testsFAILED.Security run: findings recorded, and its body carries the skip line.findings_a_new_audit_reproduces_are_not_fixed_when_issues_are_off(single and Spec-sized).malformed_issues_metadata_fails_before_the_audit.security::tests:issues_turned_off_*(single and Spec, unchanged Base) andan_unreadable_issues_setting_fails_before_work_and_report_only_runs_skip_it.tests/process:fixing_is_skipped_without_a_session_when_issues_are_turned_off,issues_turned_off_with_nothing_to_fix_reports_no_skip,malformed_issues_metadata_fails_the_fix_step_before_any_sessionanda_record_awaiting_a_fix_skips_no_audit_when_issues_are_turned_off.scripts/affected-tests main→PASS npm test --prefix site,PASS cargo test(922s).tests/processfindings::fixing_dispatches_each_reproduced_finding_and_keeps_unreproduced_findings_privatefailed in an earlier full run. It also fails 5 of 6 times with this branch'ssrc/andtests/fakes/reverted, so the cause is upstream, not this change. When two fixes publish within one second, the second publishing session's whole-second window counts the first fix's issue Keeping the PR mergeable: merge the Base branch and conflict Repair #8: "created public issue(s) outside the staged path: Keeping the PR mergeable: merge the Base branch and conflict Repair #8". No open issue tracks it.Visual evidence
None needed: the site edits are one-sentence text changes to hand-written pages, with no layout change.
Merge Danger
Door: two-way
Blast Radius: narrow
Only Security runs and Security finding Steps with fixing allowed are affected. They now make one extra
gh api repos/{repo}read; if that read fails, the run fails before its audit, where before it would have gone on.Unaddressed findings
Standards
fix-findingsnow reads only when a fix awaits, matching the audit Step (src/processes/findings.rs, insidewhile let Some(..) = records.take_next_fix()).fixingbeforeprocesses::security::run.has_issuessetting").fixing_skipped: Option<String>is a primitive. The one reason now comes from a single constructor,security::issues_turned_off, which also owns the prefix (finding 2). A new type would add no behaviour.repos/{repo}read in advisories.rs. The two reads are separate and read different fields. Sharing them would put metadata-error coupling into private-record storage selection, which is outside A Security run on a repository with issues turned off fails at Security fix publishing #2094.tests/security_run.rs(lines 2838, 4828, 5482).Spec
cargo test --bin thirdshift security::tests::a_failed_audit_still_says_why_fixing_was_skippeddoes not compile (no method named audit_error,no variant … SecurityRun found for enum command::Ending).Account::of_failure).Review coverage
Both reviewers read every changed file.
site/docs/index.htmlis generated output, excluded by both reviewers onnpm run docs:check --prefix siteexiting 0. The review ran at 3ff6b2f; the later fix commits address its findings.Closes #2094
Built with claude 2.1.314 · opus · default effort
Security review outcome
No unaddressed introduced findings.