Repository navigation
fix(pr-management-stats): keep the parity tests from publishing a gist - #1603
Open
MakerFlyFly wants to merge 1 commit into
Open
MakerFlyFly wants to merge 1 commit into
MakerFlyFly wants to merge 1 commit 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. Guard gist authentication, publication and session-state reads/writes with pytest.fail, so ordinary exception handlers cannot swallow a reached guard and the checks do not depend on main's current call order. 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 dashboard only.gist_scope_available,publish_gist,read_stats_gist_id, andstore_stats_gist_idwithpytest.fail; ordinaryexcept Exceptionhandling cannot swallow a reached guard, and protection is independent of call order.Type of change
tools/*/withpyproject.toml)Test plan
Fresh validation on upstream baseline
dadb315caa8b881fc1d2195bef03223dac25915a, Linux/CPython 3.12.12 and pytest 9.1.1.ghreplacement, before the fix: the parity tests pass but PATCH an existing gist twice; without session state, they create, PATCH, and record a fake ID. The replacement never invokes realgh.ghcalls and no session-state changes.--no-publish, including with an ordinary exception wrapper around the scope guard, makes both tests fail with expectedFailedoutcomes.except Exception, with zero underlying sentinel calls and zeroghcalls. Probe runs preserve source and state.prek run --all-filespasses, including lychee, workspace checks, skill-script tests and spec validation.pre-first-pr-checkreports ready with zero blocking findings and zero advisory items; the PR template has been checked.RFC-AI-0004 compliance
Linked issues
Closes #1602
Notes for reviewers
The
referenceparser rejects--no-publish, so only dashboard argv receives it.Each entry is guarded separately to protect against future changes in call order.
Publication-wiring tests, a stats-wide
ghguard, removing the tracked legacy state, and explicit UTF-8 for production HTML reads/writes are independent follow-ups.Linux UTF-8 validation does not imply Windows GBK compatibility; the latter remains a known issue.
Suggested labels:
bug,family:pr-management,capability:stats.Was generative AI tooling used to co-author this PR?
Generated-by:; the approved source is unchanged.