Repository navigation
fix(pr-management-stats): keep the parity tests from publishing a gist - #7
Draft
MakerFlyFly wants to merge 2 commits into
Draft
MakerFlyFly wants to merge 2 commits into
MakerFlyFly wants to merge 2 commits into
Conversation
Why: the JSON parity tests call dashboard.main() with publishing enabled, and their stubs cover only data fetching. An authenticated gh can PATCH a real dashboard gist or create a new secret gist while both tests pass. Pass --no-publish to the dashboard invocation only, since reference.main() does not accept it. Replace both publishing entry points with stubs that fail the test if reached, so removing the flag cannot silently regress. Generated-by: Codex (GPT-6)
Why: AssertionError can be caught by an ordinary Exception handler, and the parity test stubs did not cover session-state reads or writes. Use pytest.fail so a reached guard escapes ordinary exception handling. Protect all four gist entry points independently of their current order. Keep the dashboard-only --no-publish flag and the existing JSON assertions. Generated-by: Codex (GPT-6)
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
dashboard.main()with gist publishing enabled, allowing an authenticated developer to overwrite or create a real gist while both tests passed. Pass--no-publishto the dashboard invocation only.gist_scope_available,publish_gist,read_stats_gist_id, andstore_stats_gist_idwithpytest.fail, so the parity tests reject publication and session-state access independently of call order, including under ordinaryexcept Exceptionhandling.Type of change
tools/*/withpyproject.toml)Test plan
Verification applies to the unchanged head c8fdbc05, using a complete Linux checkout with CPython 3.12.12 and pytest 9.1.1.
4556f693with a recordingghreplacement: two PATCH attempts with an existing ID, or gist creation followed by PATCH and state persistence without an ID, while both tests pass. The replacement never delegates to realgh.ghcalls, no session-state changes.--no-publish, including with anexcept Exceptionwrapper around the scope guard, makes both tests fail with the expectedFailed.except Exception, with zero underlying sentinel calls and zeroghcalls. Probe runs preserve source and session state.ruff check,ruff format --check, andmypypass.uv run zizmor --config .zizmor.yml .passes.prek run --all-filespasses, including lychee, all workspace checks, skill-script tests, and spec validation.pre-first-pr-checkreports ready for both commits: zero blocking findings and zero advisory items; the PR-body template is checked.RFC-AI-0004 compliance
Linked issues
Closes #6
Notes for reviewers
The
referenceentry point rejects--no-publish, so only dashboard argv receives it.Each gist entry point is guarded separately; the publish guard protects against future reordering even though the scope guard currently fails first.
Independent follow-ups are tests for
main()publication wiring, a stats-wideghsubprocess guard, removing the tracked legacy.apache-magpie.session-state.json, and explicit UTF-8 for production dashboard HTML reads and writes.Linux UTF-8 success does not imply Windows GBK compatibility; the latter remains a known issue.
This Draft awaits human review.
Was generative AI tooling used to co-author this PR?
Generated-by:trailers.