Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 245 additions & 0 deletions apps/loopover-ui/public/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -14856,6 +14856,129 @@
"recommendation",
"summary"
]
},
"ValidateLinkedIssueRequest": {
"type": "object",
"properties": {
"issueNumber": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"plannedChange": {
"type": "object",
"properties": {
"title": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"changedFiles": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300
},
"maxItems": 200
},
"contributorLogin": {
"type": "string",
"minLength": 1,
"maxLength": 100
}
}
}
},
"required": [
"issueNumber"
]
},
"ValidateLinkedIssueResponse": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"repoFullName": {
"type": "string"
},
"issueNumber": {
"type": "number"
},
"found": {
"type": "boolean"
},
"multiplierStatus": {
"type": "string"
},
"multiplierWouldApply": {
"type": "boolean"
},
"blockingReason": {
"type": "string"
},
"reasons": {
"nullable": true
},
"report": {
"nullable": true
}
}
},
"CheckBeforeStartRequest": {
"type": "object",
"properties": {
"issueNumber": {
"type": "integer",
"minimum": 0,
"exclusiveMinimum": true
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"plannedPaths": {
"type": "array",
"items": {
"type": "string",
"maxLength": 300
},
"maxItems": 200
}
}
},
"CheckBeforeStartResponse": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"repoFullName": {
"type": "string"
},
"found": {
"type": "boolean"
},
"claimStatus": {
"type": "string"
},
"duplicateClusterRisk": {
"type": "string"
},
"recommendation": {
"type": "string"
},
"reasons": {
"nullable": true
},
"blockers": {
"nullable": true
},
"report": {
"nullable": true
}
}
}
},
"parameters": {},
Expand Down Expand Up @@ -19370,6 +19493,128 @@
}
]
}
},
"/v1/repos/{owner}/{repo}/validate-linked-issue": {
"post": {
"summary": "Validate a planned linked-issue claim before opening a PR",
"parameters": [
{
"schema": {
"type": "string"
},
"required": true,
"name": "owner",
"in": "path"
},
{
"schema": {
"type": "string"
},
"required": true,
"name": "repo",
"in": "path"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLinkedIssueRequest"
}
}
}
},
"responses": {
"200": {
"description": "Linked-issue validation report (mirrors loopover_validate_linked_issue)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ValidateLinkedIssueResponse"
}
}
}
},
"400": {
"description": "Invalid validate-linked-issue request body"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Session lacks access to this repository"
}
},
"security": [
{
"LoopOverBearer": []
},
{
"LoopOverSessionCookie": []
}
]
}
},
"/v1/repos/{owner}/{repo}/check-before-start": {
"post": {
"summary": "Pre-start claim and duplicate-cluster check for planned work",
"parameters": [
{
"schema": {
"type": "string"
},
"required": true,
"name": "owner",
"in": "path"
},
{
"schema": {
"type": "string"
},
"required": true,
"name": "repo",
"in": "path"
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckBeforeStartRequest"
}
}
}
},
"responses": {
"200": {
"description": "Pre-start check report (mirrors loopover_check_before_start)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CheckBeforeStartResponse"
}
}
}
},
"400": {
"description": "Invalid check-before-start request body"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Session lacks access to this repository"
}
},
"security": [
{
"LoopOverBearer": []
},
{
"LoopOverSessionCookie": []
}
]
}
}
},
"servers": [
Expand Down
52 changes: 52 additions & 0 deletions src/openapi/schemas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { z } from "zod";
import { MAX_REVIEW_NAG_COOLDOWN_DAYS } from "../settings/agent-actions";
import { MAX_CONTRIBUTOR_OPEN_ITEM_CAP } from "../types";
import { PREFLIGHT_LIMITS } from "../signals/preflight-limits";
import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";

extendZodWithOpenApi(z);
Expand Down Expand Up @@ -1926,6 +1927,57 @@ export const GateConfigEffectiveResponseSchema = z
})
.openapi("GateConfigEffectiveResponse");

// Request/response parity with validateLinkedIssueShape + validateLinkedIssueOutputSchema (#9304).
export const ValidateLinkedIssueRequestSchema = z
.object({
issueNumber: z.number().int().positive(),
plannedChange: z
.object({
title: z.string().min(1).max(PREFLIGHT_LIMITS.titleChars).optional(),
changedFiles: z.array(z.string().max(PREFLIGHT_LIMITS.changedFileChars)).max(PREFLIGHT_LIMITS.changedFiles).optional(),
contributorLogin: z.string().min(1).max(PREFLIGHT_LIMITS.contributorLoginChars).optional(),
})
.optional(),
})
.openapi("ValidateLinkedIssueRequest");

export const ValidateLinkedIssueResponseSchema = z
.object({
status: z.string().optional(),
repoFullName: z.string().optional(),
issueNumber: z.number().optional(),
found: z.boolean().optional(),
multiplierStatus: z.string().optional(),
multiplierWouldApply: z.boolean().optional(),
blockingReason: z.string().optional(),
reasons: z.unknown().optional(),
report: z.unknown().optional(),
})
.openapi("ValidateLinkedIssueResponse");

// Request/response parity with checkBeforeStartShape + checkBeforeStartOutputSchema (#9304).
export const CheckBeforeStartRequestSchema = z
.object({
issueNumber: z.number().int().positive().optional(),
title: z.string().min(1).max(PREFLIGHT_LIMITS.titleChars).optional(),
plannedPaths: z.array(z.string().max(PREFLIGHT_LIMITS.changedFileChars)).max(PREFLIGHT_LIMITS.changedFiles).optional(),
})
.openapi("CheckBeforeStartRequest");

export const CheckBeforeStartResponseSchema = z
.object({
status: z.string().optional(),
repoFullName: z.string().optional(),
found: z.boolean().optional(),
claimStatus: z.string().optional(),
duplicateClusterRisk: z.string().optional(),
recommendation: z.string().optional(),
reasons: z.unknown().optional(),
blockers: z.unknown().optional(),
report: z.unknown().optional(),
})
.openapi("CheckBeforeStartResponse");

export const BurdenForecastSchema = z
.object({
repoFullName: z.string(),
Expand Down
Loading
Loading