From 87f76aa0559681d3e6383640d621f45916bb001a Mon Sep 17 00:00:00 2001 From: Levon Tikoyan Date: Thu, 18 Dec 2025 18:41:58 -0500 Subject: [PATCH] Return additional deploy data --- src/server/services/build.ts | 2 +- src/shared/openApiSpec.ts | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/server/services/build.ts b/src/server/services/build.ts index 50178557..d748aae1 100644 --- a/src/server/services/build.ts +++ b/src/server/services/build.ts @@ -179,7 +179,7 @@ export default class BuildService extends BaseService { b.select('id', 'title', 'fullName', 'githubLogin', 'pullRequestNumber', 'branchName', 'status', 'labels'); }) .modifyGraph('deploys', (b) => { - b.select('id', 'uuid', 'status', 'active', 'deployableId'); + b.select('id', 'uuid', 'status', 'active', 'deployableId', 'branchName', 'publicUrl'); }) .modifyGraph('deploys.deployable', (b) => { b.select('name'); diff --git a/src/shared/openApiSpec.ts b/src/shared/openApiSpec.ts index 63edc99f..ca982af1 100644 --- a/src/shared/openApiSpec.ts +++ b/src/shared/openApiSpec.ts @@ -1,5 +1,5 @@ import { OAS3Options } from 'swagger-jsdoc'; -import { BuildStatus } from './constants'; +import { BuildStatus, DeployStatus } from './constants'; export const openApiSpecificationForV2Api: OAS3Options = { definition: { @@ -142,6 +142,14 @@ export const openApiSpecificationForV2Api: OAS3Options = { required: ['name'], }, + /** + * @description Enum for deploy statuses. + */ + DeployStatus: { + type: 'string', + enum: Object.values(DeployStatus), + }, + /** * @description A Deploy associated with a Build. */ @@ -150,8 +158,10 @@ export const openApiSpecificationForV2Api: OAS3Options = { properties: { id: { type: 'integer' }, uuid: { type: 'string', example: 'deploy-uuid' }, - status: { type: 'string', example: 'active' }, + status: { $ref: '#/components/schemas/DeployStatus' }, active: { type: 'boolean', example: true }, + branchName: { type: 'string', example: 'main' }, + publicUrl: { type: 'string', example: 'http://myapp.example.com' }, deployableId: { type: 'integer' }, deployable: { $ref: '#/components/schemas/Deployable' }, },