Repository navigation
style(test): format the webhooks API test black left unformatted - #12997
Conversation
|
Intent: Make the Main Ratchet Audit green again on |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 40071e2 |
|
Base-side blocker, not this PR: the Windows shard red here is |
`test/test_webhooks_api.py` was dropped from `.github/black-baseline.txt` in #12467 without being formatted, so the black ratchet now requires it to be clean and it is not. Every push to main has failed the Main Ratchet Audit since, and the drift is tracked at #12947. Black wants one signature on a single line; that is the whole change. No test logic, no assertion and no baseline entry moves, so the gate goes green with the baseline exactly as #12467 left it. Fixes #12947
0b9901a to
40071e2
Compare
GPT 5.6 Review —
|
Problem / Motivation
Every push to
mainfails the Main Ratchet Audit. Itsratchet-gatesjob reportsnot black-formatted. Run: black --target-version py310 test/test_webhooks_api.pyand
1 new offender(s). Twenty consecutive main pushes are red, and the drift istracked at #12947.
Why it matters
mainis the integrated tree, so this red travels. A PR runs againstmerge(branch, main)and inherits main's state, which is why CONTRIBUTING.md saysto fix ratchet drift on main rather than in someone else's PR. While it stands, the
audit's other five gates keep reporting but the lane's verdict stays failure, so a
second drift landing on top would not change the signal anyone sees.
What changed (motivation → approach → change)
Symptom: the black ratchet demands
test/test_webhooks_api.pybe clean and it isnot.
Root cause is a merge, not an author slip. #12467 graduated the file: it formatted
it and removed its
.github/black-baseline.txtentry, which is the ratchet'sintended shrink direction. Its head
9aa4601be8is consistent, and its black gatewas correctly green there. Between that gate run and the squash merge, #12732 and
#12885 each edited the same file; both left it unformatted, which was free because
the baseline still listed it for them. #12467's merge result therefore carries their
text with the baseline entry already deleted, so the merge commit
f47c56dd9eisthe first tree where the file is both unformatted and unexempt.
Change: format the one line black objects to. Black wants the
test_the_probe_route_still_mints_its_throwaway_credentialsignature on a singleline at the repo's configured width; #12467's merge left it split across three. No
test logic, no assertion and no baseline entry moves, so the gate goes green with
the baseline exactly as #12467 left it.
Backwards compatibility
Compatible: the change is whitespace inside one test's
defline. No productioncode, no public contract, no gate threshold and no baseline entry changes.
Tests
No new test. The gate that catches this class already exists and already caught it
on main; a test asserting one file's formatting would duplicate the gate and rot
the moment the file graduates. Verified by running the gate itself whole-tree:
RATCHET_SCOPE_WHOLE_TREE=1 python3 scripts/check_black_formatting.pynow reportsblack gate passed: nothing in scope is unformatted outside the baseline (972 known-unformatted file(s) still listed), and it fails on the same tree with thiscommit reverted.
Manual verification
N/A — unit coverage sufficient. The affected file's related backend set
(
test/test_webhooks_api.py,test/test_webhooks_event_loop.py,test/test_webhooks_signing.py) passes, plus isort, flake8, comment-history,brand-name, testpaths-coverage and docs-lint.
Related Issues
Fixes #12947
Pattern harvest
Rule candidate: review-prompt
Pattern: a PR that DELETES a black-baseline entry loses that file's exemption at
merge time, so any other PR editing the same file in the interval lands unformatted
text into an unexempt file. Both heads are individually green; only the merge is
red. The repo already models this class as stale green (
green_age.pyasks whetherthe base moved in files this PR also touches), so the narrow rule is: a diff that
removes a baseline entry must have its formatting gate re-judged against fresh
mainbefore merge, not only against the base its CI happened to see.