Skip to content

test(webhooks): drop the case the contract tests already pin - #394

Merged
Vivswan merged 1 commit into
mainfrom
wt/r2s-webhooks
Sep 22, 2026
Merged

Vivswan merged 1 commit into
mainfrom
wt/r2s-webhooks

Conversation

@Vivswan

@Vivswan Vivswan commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Before

$ grep -cE '^\s*test(\.each)?\(' src/sections/webhooks/*.test.ts
webhooks.test.ts:10

After

$ grep -cE '^\s*test(\.each)?\(' src/sections/webhooks/*.test.ts
webhooks.test.ts:9

The two typed tables (test.each<...>, the schema table and the plans-nothing table) are not matched by that grep; both stay.

How

One case leaves src/sections/webhooks/webhooks.test.ts.
It was put under a mutant on today's main before it went: the mutant reddens the deleted case and its named pin together, so nothing the case held is lost.

  • The read port exposes exactly the list role in its denied posture.
    The runtime assertion restates the endpoint table; the port's derivation is pinned once for every section by the canonical read-port case in test/sections/contract.test.ts.
    Mutant: src/sections/contract/plan.ts binds every route into the port regardless of method.
    Red: this case and the branches read-port case that stays.

No source changes.

Proof

  • bun test src/sections/webhooks 15 pass; bun run typecheck and bun run knip green.
  • bun run test:e2e --sections webhooks 13/13 passed.
  • The full suite runs in this PR's CI.

Line accounting

Test-only: 0 additions, 11 deletions in one file.

Kept

Two cases slated for deletion as scenario twins stay, each after its census came back green.

  • A changed config.url is a new identity: a create plus a kept undeclared note, or a delete under _undeclared:delete.
    Mutant: src/sections/webhooks/index.ts spells the undeclared action KEEP it instead of DELETE it.
    Red: only this case's note assertion.
    Green: all thirteen webhooks scenarios (webhooks-undeclared-keep-note matches the note through to have apply only) and every test under test/sections.
  • Executing the plan against the mock fragment converges: the re-plan carries only the secret-bearing config PATCHes.
    Mutant: the mock's stored hook config drops the secret (storedHookConfig in test/e2e/mock/support.ts).
    Red: only this case's final-state assertion that both hooks store the resolved secret.
    Green: all thirteen webhooks scenarios, including webhooks-apply-converges, and the mock tests.

Every other case in the directory is untouched.

Reviewer note
  • Landing order: this PR lands after the test/sections change that adds the canonical read-port case for every section.
  • Codex rounds: 3. Round 1 found the convergence case's stored-secret assertion pinned nowhere else; round 2 found the changed-url case's action wording pinned nowhere else. Both cases were restored with their mutants recorded above. Round 3 converged.
  • Copilot: deletions only; a comment earns a change only if it names a concrete lost assertion with no other pin.

BEGIN_COMMIT_OVERRIDE
test(webhooks): drop the case the contract tests already pin

The read-port shape case restates the endpoint table at runtime; the canonical read-port case in the contract tests pins the port's derivation for every section.
The changed-url identity case stays: its note assertion is the only pin of the section's undeclared action wording.
The convergence twin stays: its final-state assertion is the only pin that the resolved secret lands in the stored hook config.
Test-only; no source changes.
END_COMMIT_OVERRIDE

The read-port shape case restates the endpoint table at runtime; the canonical read-port case in the contract tests pins the port's derivation for every section.
The changed-url identity case stays: its note assertion is the only pin of the section's undeclared action wording.
The convergence twin stays: its final-state assertion is the only pin that the resolved secret lands in the stored hook config.
Test-only; no source changes.
Copilot AI balanced review requested due to automatic review settings September 21, 2026 23:34
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

File size check

0 over a hard cap (fails), 31 warning(s).

File Size Tier Cap
.github/scripts/release-pipeline.ts:6 156 chars warn 150
.github/scripts/release-pipeline.ts:468 151 chars warn 150
.github/scripts/release-pipeline.ts:1417 153 chars warn 150
.github/scripts/release-pipeline.ts:1 30 comment lines (header) warn 25
.github/scripts/release-pipeline.ts:464 14 comment lines warn 10
.github/workflows/post-green.yml:27 153 chars warn 150
.github/workflows/post-green.yml:140 16 comment lines warn 10
docs/upgrading/v2-to-v3.md 1257 lines warn 1040
src/engine/layers.ts:217 157 chars warn 150
src/flows/settings-write.ts:142 159 chars warn 150
src/flows/settings-write.ts:30 11 comment lines warn 10
src/flows/snapshot.ts:189 13 comment lines warn 10
src/github/secret-scan.ts:42 11 comment lines warn 10
src/schema.ts:186 153 chars warn 150
src/schema.ts:197 176 chars warn 150
src/sections/contract/errors.ts:14 14 comment lines warn 10
src/sections/contract/module.ts:963 185 chars warn 150
src/sections/contract/module.ts:627 12 comment lines warn 10
src/sections/contract/module.ts:897 12 comment lines warn 10
src/sections/secret_scanning_custom_patterns/compilable-form.ts:382 161 chars warn 150
src/sections/shared/roles.ts:43 13 comment lines warn 10
src/types.ts:16 156 chars warn 150
test/docs/guides.test.ts:451 155 chars warn 150
test/e2e/generators.ts 2639 lines warn 2560
test/e2e/generators.ts:1709 166 chars warn 150
test/e2e/generators.ts:1863 161 chars warn 150
test/e2e/generators.ts:1672 12 comment lines warn 10
test/engine/execute.test.ts:617 152 chars warn 150
test/flows/merge-parity.test.ts:63 164 chars warn 150
test/scripts/auto-fix-allowlist.test.ts:8 12 comment lines warn 10
test/scripts/gen-docs.test.ts:588 155 chars warn 150

Split the file, wrap the line, shorten or exempt the comment, or list the path in .file-size-allow.local with a # reason.

5 managed file(s) skipped; repo-platform owns them.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The deletion removes duplicated coverage without changing runtime behavior or losing a uniquely tested assertion.

Review effort: Balanced
Findings: None

What changed in this PR

Removes a redundant webhooks read-port test already covered by contract-level tests.

Changes:

  • Deletes one duplicated test case.
  • Leaves production code and unique webhooks assertions unchanged.
File Description
src/​sections/​webhooks/​webhooks.test.ts Removes the redundant read-port shape test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Vivswan
Vivswan marked this pull request as ready for review September 22, 2026 00:23
@Vivswan
Vivswan merged commit ca67033 into main Sep 22, 2026
34 checks passed
@Vivswan
Vivswan deleted the wt/r2s-webhooks branch September 22, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-green Owner approved: merge once every gate is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants