CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(gate): harden baseSha to GateTest's strict receiver contract #5624

MergedXSccantynz wants to mergefix/gatetest-base-sha-contractmainopened 20h ago2/2 tasks
ccantynzcommented 20h ago

Summary

  • GateTest's receiver (gatetest@528e2ad7) 400s the entire push event on a malformed baseSha — nothing queued. Omitting is safe (whole-repo enforcement, "base unknown"); malformed silently loses the push. Strictly worse.
  • New gateTestBaseShaField() is the only place allowed to build the field: 40-hex only, case-normalised to lowercase, never all-zeros (git's null oldSha), never === sha (receiver treats it as no base anyway). Anything else → field omitted entirely.
  • Both payloads (async push notify + blocking merge-gate scan) go through it.
  • On an accepted push notify, logs GateTest's eventId so the scan-queue row can be traced from our logs without DB access on their side.

Test plan

  • 3 new contract tests (malformed omitted, lowercased, baseSha === sha omitted) — 8 pass in gatetest-base-sha.test.ts
  • Availability suite green, bun build clean
ccantynzAI Reviewcommented 20h ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 20h ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts