Repository navigation
fix(security-management): honor zero-day issue-sync settings - #1911
Merged
potiuk merged 3 commits intoOct 30, 2026
Merged
Conversation
Use the configured day count even when it is zero. Only missing or null values should use the disclosure-window, grace-period and reporter-timeout defaults; a zero grace period is explicitly documented by the template. Cover the CLI's zero values, defaults, numeric strings, positive values, calendar-day boundaries and label/message guards. Regenerate the packaged security-management source so plugin installations receive the same fix. Generated-by: Codex (gpt-6.1-sol)
Exercise all three issue-sync day settings through the CLI with empty strings, lists and objects, checking the JSON refusal and exit code 2 without depending on Python's exact conversion-error wording. Pin false-to-zero coercion with concrete disclosure dates and reporter staleness results. These compatibility cases retain the existing int() conversion policy and require no production-code changes. Generated-by: Codex (gpt-6.1-sol)
This was referenced Oct 30, 2026
issue-import already rejects a window_days that is not positive and uses 90, which the reporter's receipt then promises; read it the same way in issue-sync, so the two skills agree. An explicit 0 still holds for grace_period_days and timeout_days. Drop the test that pinned False being read as 0: the settings are integers, and that coercion is a side effect of int(). Generated-by: Claude Opus 5
potiuk
approved these changes
Oct 30, 2026
potiuk
left a comment
Member
There was a problem hiding this comment.
Honouring an explicit 0 for grace_period_days and timeout_days is right, and the tests fail on the old code. Rather than send it back for two small points, I pushed a fixup commit (7aa8c78) to your branch:
issue_sync/state.py(and the plugin copy): a non-positivewindow_daysnow falls back to 90. issue-import reads the samedisclosure_governance.window_daysand already rejects anything that isn't positive (issue_import/governance.py:88), so the reporter's receipt promises 90 days; with0read literally here, issue-sync would have flagged every tracker as overdue from day one. Thewindow_dayscases intest_disclosure_configured_daysnow expect the default (plus a-1case), andtest_zero_grace_period_preserves_day_boundaryuses a 1-day window for its short-window boundary.tests/test_issue_sync_state.py: droppedtest_issue_sync_coerces_false_day_input_to_zero. The settings are integers, andFalsebecoming0is a side effect ofint(), not behaviour to pin.
Please pull before pushing again.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
Contributing guide.
1 task done
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
window_days,grace_period_daysandtimeout_days; only missing or null settings use the existing 90/14/14 defaults.2026-04-15to2026-04-01, while preserving strict calendar-day expiry and the announcement/reporter-turn guards.magpie-security-toolssource so plugin installations receive the same repair.Type of change
tools/security-management) and its generated plugin sourceTest plan
6fafad25b1b1bc239c8863d09d757fa3cf71d72a; verify corrected CLI output for grace periods 0/1/14, a zero window and a zero reporter timeout.prek run --all-files --skip workspace-pytestpasses, including lychee, Ruff, formatting, mypy and generated-plugin consistency.prek run workspace-pytest --from-ref origin/main --to-ref HEAD --verbosepasses: 114 + 758 = 872 tests across two applicable members.pre-first-pr-check: A–E pass, zero blocking or advisory categories.git range-diffconfirms both reviewed patches are unchanged on the new base.Validation used an isolated Linux checkout, Python 3.12.12, uv and the locked prek 0.5.6.
RFC-AI-0004 compliance
Linked issues
Closes #1910
Notes for reviewers
The settings are documented as integers. Supplied values now reach
int()unless they are null: empty strings/lists/objects produce the existing JSON refusal with exit code 2, and false converts to zero. The tests pin those coercion results without depending on Python-version-specific exception wording. Negative-value validation and issue-import's separate positive-window policy are outside this repair.Suggested labels:
bug,family:tools,capability:fix,substrate:analytics.Generative AI disclosure
Codex (gpt-6.1-sol) assisted with the implementation, regression tests and this description. The contributor reviewed the final diff, validation results and compatibility behavior, and authorized this upstream submission.