Skip to content

feat: add service overrides state to build response#203

Merged
vigneshrajsb merged 1 commit into
mainfrom
vb/add-build-service-overrides-get
May 12, 2026
Merged

feat: add service overrides state to build response#203
vigneshrajsb merged 1 commit into
mainfrom
vb/add-build-service-overrides-get

Conversation

@vigneshrajsb
Copy link
Copy Markdown
Contributor

@vigneshrajsb vigneshrajsb commented May 8, 2026

Summary

  • Adds computed service override edit state to GET /api/v2/builds/{uuid} by annotating each returned deploys[] item with serviceOverride.
  • Removes the separate GET /api/v2/builds/{uuid}/services operation because the UI can now build the edit form from the existing build detail response.
  • Keeps PATCH /api/v2/builds/{uuid}/services as the targeted mutation endpoint and aligns the request field name to name.
  • Keeps service override display/group/editability logic server-side so the UI does not need to duplicate PR-comment behavior.

API Shape

GET build request

GET /api/v2/builds/demo-build-123456

GET build response excerpt

{
  "data": {
    "uuid": "demo-build-123456",
    "deploys": [
      {
        "uuid": "api-demo-build-123456",
        "status": "deployed",
        "statusMessage": null,
        "active": true,
        "branchName": "feature/api",
        "publicUrl": "https://api-demo.example.test",
        "updatedAt": "2026-05-08T12:00:00.000Z",
        "deployable": {
          "name": "api",
          "type": "github"
        },
        "serviceOverride": {
          "name": "api",
          "branchOrExternalUrl": "feature/api",
          "group": "default",
          "editable": true
        }
      },
      {
        "uuid": "api-cache-demo-build-123456",
        "status": "pending",
        "statusMessage": null,
        "active": true,
        "deployable": {
          "name": "api-cache",
          "type": "github"
        },
        "serviceOverride": null
      }
    ]
  }
}

PATCH services request

PATCH /api/v2/builds/demo-build-123456/services
Content-Type: application/json
{
  "serviceOverrides": [
    {
      "name": "api",
      "active": false,
      "branchOrExternalUrl": "feature/api"
    }
  ]
}

PATCH services response

{
  "data": {
    "serviceOverrides": [
      {
        "name": "api",
        "active": false,
        "branchOrExternalUrl": "feature/api",
        "status": "pending",
        "statusMessage": null,
        "updatedAt": "2026-05-08T12:05:00.000Z",
        "group": "default",
        "editable": true
      }
    ],
    "queued": true
  }
}

Implementation Notes

  • deploy.serviceOverride is nullable. null means the deploy is still part of the build response, but should not render as an editable service override row.
  • The nested object intentionally contains only edit-form metadata: name, branchOrExternalUrl, group, and editable.
  • Raw deploy state remains on the deploy row: active, status, statusMessage, updatedAt, branchName, and publicUrl.
  • PATCH still accepts whole-form submissions. Display-only rows may submit unchanged branchOrExternalUrl, but changed display-only values return 400.

Validation

  • pnpm test -- src/server/services/__tests__/build.test.ts src/server/services/__tests__/override.test.ts src/shared/openApiSpec.test.ts
  • pnpm run lint
  • git diff --check

pnpm run ts-check still fails on existing repo-wide TypeScript issues outside this change.

@vigneshrajsb vigneshrajsb changed the title [codex] Add build service override state endpoint feat: add build service override state endpoint May 8, 2026
@vigneshrajsb vigneshrajsb force-pushed the vb/add-build-service-overrides-get branch 2 times, most recently from bc96484 to 085c17c Compare May 11, 2026 23:04
@vigneshrajsb vigneshrajsb changed the title feat: add build service override state endpoint [codex] Add service override state to build response May 11, 2026
@vigneshrajsb vigneshrajsb changed the title [codex] Add service override state to build response feat: add service overrides state to build response May 11, 2026
@vigneshrajsb vigneshrajsb marked this pull request as ready for review May 11, 2026 23:07
@vigneshrajsb vigneshrajsb requested a review from a team as a code owner May 11, 2026 23:07
Comment thread docs/build-service-overrides-reviewer.html Outdated
@vigneshrajsb vigneshrajsb force-pushed the vb/add-build-service-overrides-get branch from 085c17c to b32707e Compare May 12, 2026 17:03
@vigneshrajsb vigneshrajsb merged commit ba1e8d7 into main May 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants