Polish API contracts for review and gate metadata

swadhinbiswas committed 8 months ago
611aaa9
1 parent 870606d
commit 611aaa9
4 files changed
+8 -3
▼doc/feature_audit.md
+1-1
200
200
| CLI | ✅ | `cli/` package - 21+ commands |
201
201
| Plugin/extension system | ⚠️ | `plugins.ts` infrastructure exists, but basic |
202
202
| Webhook events | ✅ | Full implementation |
203
-| API documentation | ⚠️ | OpenAPI coverage now includes AI callback, review/comment flows, stack approvals/rebase/auto-update/merge routes, PR bulk-merge/auto-merge/checks routes, notifications/email test endpoints, and analytics merge-frequency/workload routes; broader endpoint parity still incomplete |
203
+| API documentation | ⚠️ | OpenAPI coverage now includes AI callback, review/comment flows (including path-scoped comment visibility metadata), stack approvals/rebase/auto-update/merge routes, PR bulk-merge/auto-merge/checks routes, merge-gate reporting metadata, notifications/email test endpoints, and analytics merge-frequency/workload routes; broader endpoint parity still incomplete |
204
204
205
205
## 12. Self-Hosted & Deployment
206
206
| Feature | Status | Implementation Notes |
207
207
▼src/lib/openapi.ts
+3-2
590
590
get: {
591
591
tags: ["Stacks"],
592
592
summary: "Get stack approval status",
593
- description: "Returns stack approval details plus merge readiness blockers for UX dashboards.",
593
+ description: "Returns stack approval details plus merge readiness blockers, including missing-approval and missing-required-reviewer summary metrics.",
594
594
security: [{ bearerAuth: [] }],
595
595
parameters: [
596
596
{ name: "owner", in: "path", required: true, schema: { type: "string" } },
699
699
get: {
700
700
tags: ["Pull Requests"],
701
701
summary: "List PR comments",
702
+ description: "Returns threaded PR comments filtered by path-scoped read permissions, with `hiddenCount` for suppressed comments.",
702
703
security: [{ bearerAuth: [] }],
703
704
parameters: [
704
705
{ name: "owner", in: "path", required: true, schema: { type: "string" } },
1009
1010
get: {
1010
1011
tags: ["CI/CD"],
1011
1012
summary: "List repository merge gates and required checks",
1012
- description: "Returns merge policy config plus a derived report (counts, breakdown, warnings). Optionally evaluates readiness for a specific PR via `pullNumber` query.",
1013
+ description: "Returns merge policy config plus a derived report (counts, breakdown, structured warnings with code/severity/message). Optionally evaluates readiness for a specific PR via `pullNumber` query.",
1013
1014
security: [{ bearerAuth: [] }],
1014
1015
parameters: [
1015
1016
{ name: "owner", in: "path", required: true, schema: { type: "string" } },
1016
1017
▼tests/integration/merge-gates-route.test.ts
+2-0
102
102
expect(body?.data?.report?.mergeGatesTotal).toBe(1);
103
103
expect(body?.data?.report?.warnings).toHaveLength(2);
104
104
expect(body?.data?.report?.warnings?.[0]?.code).toBe("duplicate_required_checks");
105
+ expect(body?.data?.report?.warnings?.[0]?.severity).toBe("warning");
106
+ expect(body?.data?.report?.warnings?.[0]?.message).toContain("Duplicate required checks");
105
107
});
106
108
107
109
it("returns 401 for unauthenticated reads", async () => {
108
110
▼tests/integration/stack-approvals-route.test.ts
+2-0
103
103
approvedPrs: 1,
104
104
pendingPrs: 1,
105
105
totalMissingApprovals: 1,
106
+ totalMissingRequiredReviewerApprovals: 1,
106
107
},
107
108
prs: [],
108
109
});
121
122
expect(body?.data?.canMerge).toBe(false);
122
123
expect(body?.data?.blockers).toHaveLength(1);
123
124
expect(body?.data?.status?.summary?.pendingPrs).toBe(1);
125
+ expect(body?.data?.status?.summary?.totalMissingRequiredReviewerApprovals).toBe(1);
124
126
});
125
127
126
128
it("requests approvals only for reviewers with repository access", async () => {
127
129