Skip to content

style(test): format the webhooks API test black left unformatted - #12997

Merged
bolichen97 merged 1 commit into
mainfrom
fix/black-ratchet-webhooks-12947
Sep 23, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/black-ratchet-webhooks-12947

Conversation

@bolichen97

Copy link
Copy Markdown
Contributor

Problem / Motivation

Every push to main fails the Main Ratchet Audit. Its ratchet-gates job reports
not black-formatted. Run: black --target-version py310 test/test_webhooks_api.py
and 1 new offender(s). Twenty consecutive main pushes are red, and the drift is
tracked at #12947.

Why it matters

main is the integrated tree, so this red travels. A PR runs against
merge(branch, main) and inherits main's state, which is why CONTRIBUTING.md says
to 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.py be clean and it is
not.

Root cause is a merge, not an author slip. #12467 graduated the file: it formatted
it and removed its .github/black-baseline.txt entry, which is the ratchet's
intended shrink direction. Its head 9aa4601be8 is consistent, and its black gate
was 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 f47c56dd9e is
the 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_credential signature on a single
line 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 def line. No production
code, 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.py now reports
black 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 this
commit 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.py asks whether
the 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
main before merge, not only against the base its CI happened to see.

@bolichen97
bolichen97 requested review from a team and dwu96 September 23, 2026 04:36
@bolichen97

Copy link
Copy Markdown
Contributor Author

Intent: Make the Main Ratchet Audit green again on main by formatting the one
file the black ratchet now requires to be clean, so main's integrated tree stops
reporting drift that reaches every unrelated PR.
Not a goal: changing the ratchet, its baseline, its scope or its worker budget;
touching any test's logic or assertions; addressing the separate lint-lane findings
(the dependency audit that cannot parse its own tool output, or the black step's
wall time) which belong in their own PRs.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 23, 2026
@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 40071e2a2eb352ab9e2afb7b56b47883b00f5624 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 40071e2

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 40071e2a2eb352ab9e2afb7b56b47883b00f5624: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 40071e2a2eb352ab9e2afb7b56b47883b00f5624 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 40071e2

Verdict parsed from the review's SHA-scoped output markers for commit 40071e2a2eb352ab9e2afb7b56b47883b00f5624.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 40071e2a2eb352ab9e2afb7b56b47883b00f5624: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 40071e2a2eb352ab9e2afb7b56b47883b00f5624 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Nothing to check.

[DESIGN-REVIEWED] 40071e2

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

Base-side blocker, not this PR: the Windows shard red here is test_crew_log_exc_info_sites.py failing on nine unvetted exc_info sites that #12757 added to crew_log at 04:35 UTC. Reproduced on an unmodified origin/main worktree, so it reds every open PR, not just this one. Fixed separately in #13007; this PR stays the three-line formatting change.

`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
@bolichen97
bolichen97 force-pushed the fix/black-ratchet-webhooks-12947 branch from 0b9901a to 40071e2 Compare September 23, 2026 08:23
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ⚠️ review incomplete

GPT 5.6 did not produce a complete verdict for 40071e2a2eb352ab9e2afb7b56b47883b00f5624; inspect the workflow logs and re-run it.

This comment is updated in place on each push.

See the GPT 5.6 Review job logs; this commit has no completed GPT verdict.

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 40071e2a2eb352ab9e2afb7b56b47883b00f5624: <one-sentence reason>

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 23, 2026
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 23, 2026
@bolichen97
bolichen97 enabled auto-merge (squash) September 23, 2026 16:53
@bolichen97
bolichen97 merged commit 9493403 into main Sep 23, 2026
139 of 148 checks passed
@bolichen97
bolichen97 deleted the fix/black-ratchet-webhooks-12947 branch September 23, 2026 16:56
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main ratchet drift detected

2 participants