Skip to content

feat: start and end managment operation endpoints BED-8325#2948

Open
lrfalslev wants to merge 5 commits into
mainfrom
lfalslev/bed-8325
Open

feat: start and end managment operation endpoints BED-8325#2948
lrfalslev wants to merge 5 commits into
mainfrom
lfalslev/bed-8325

Conversation

@lrfalslev

@lrfalslev lrfalslev commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds start and end managment operation endpoints to openapi schema, for BHE pr 1528

Motivation and Context

Resolves BED-8325

Why is this change required? What problem does it solve?

How Has This Been Tested?

Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

Screenshots (optional):

Types of changes

  • Chore (a change that does not modify the application functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Database Migrations

Checklist:

Summary by CodeRabbit

  • New Features
    • Added new client management endpoints to start and end client management operations.
    • Introduced request/response models to expose operation lifecycle details, including status and timing.
    • Added new enums for management operation type and lifecycle status (queued, running, succeeded, failed, canceled).
  • Chores
    • Updated Go module dependency versions.

@lrfalslev lrfalslev self-assigned this Jul 1, 2026
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: d7c273f1-8616-47a1-8739-77b201f467ae

📥 Commits

Reviewing files that changed from the base of the PR and between 6911399 and cb4ebe9.

📒 Files selected for processing (1)
  • packages/go/openapi/doc/openapi.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/go/openapi/doc/openapi.json

📝 Walkthrough

Walkthrough

This PR adds OpenAPI schemas and POST endpoints for client management start/end operations, wires them into the OpenAPI spec and generated JSON, and updates indirect Go module dependencies.

Changes

Client Management Operation API

Layer / File(s) Summary
Schemas and enums
packages/go/openapi/src/schemas/enum.client-management-operation-type.yaml, enum.client-management-operation-status.yaml, model.client-management-operation-start-request.yaml, model.client-management-operation-end-request.yaml, model.client-management-operation.yaml
Defines the operation type and status enums plus the request and response schemas used by the new endpoints.
Start and end path definitions
packages/go/openapi/src/paths/clients.clients.management.start.yaml, clients.clients.management.end.yaml
Adds POST endpoints for starting and ending a client management operation, with request bodies, shared error responses, and 409 conflict examples.
Spec wiring and generated doc
packages/go/openapi/src/openapi.yaml, packages/go/openapi/doc/openapi.json
Registers the new paths under /api/v2 and adds the matching path and component entries to the generated OpenAPI JSON.

Go Module Dependency Bump

Layer / File(s) Summary
Dependency version bumps
go.mod
Updates indirect versions for golang.org/x/oauth2, golang.org/x/net, google.golang.org/genproto/googleapis/rpc, and google.golang.org/grpc.

Estimated code review effort: 2 (Simple) | ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the new start/end management operation endpoints and matches the PR's main change.
Description check ✅ Passed The description follows the template and includes the change summary and BED-8325 reference, but the testing section is not filled out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lfalslev/bed-8325

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
packages/go/openapi/src/schemas/model.client-management-operation-end-request.yaml (1)

17-26: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Consider restricting status to terminal values only.

The end-request status field reuses the full status enum (queued, running, succeeded, failed, canceled). Semantically, ending an operation should only transition it to a terminal state (succeeded, failed, canceled); allowing queued/running here lets clients submit contract-valid but logically invalid end requests, pushing that validation burden onto server code instead of the schema.

Consider introducing a dedicated terminal-status enum (or an inline enum restriction) for this field.

♻️ Proposed narrower enum
+# packages/go/openapi/src/schemas/enum.client-management-operation-terminal-status.yaml
+type: string
+enum:
+  - succeeded
+  - failed
+  - canceled
   status:
-    $ref: './enum.client-management-operation-status.yaml'
+    $ref: './enum.client-management-operation-terminal-status.yaml'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/go/openapi/src/schemas/model.client-management-operation-end-request.yaml`
around lines 17 - 26, Restrict the end-request status schema to terminal values
only: the current model.client-management-operation-end-request.yaml reuses
enum.client-management-operation-status.yaml, which allows non-terminal states.
Update the status property in this schema to use a dedicated terminal-status
enum (or inline enum) containing only succeeded, failed, and canceled, so
ModelClientManagementOperationEndRequest cannot accept queued/running values.
packages/go/openapi/src/paths/clients.clients.management.end.yaml (1)

22-27: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Minor: extra blank line in description vs. start.yaml.

This description has two blank lines between the first sentence and "Note:" (also visible as \n\n\n in the generated openapi.json), while the sibling start.yaml endpoint has only one. Purely cosmetic but worth tidying for consistency.

✏️ Suggested fix
   description: |
     Endpoint for clients to end a management operation and mark the completed time.
 
-
     Note: caller must be a client. For users, this endpoint will return a 403 as
     they are not expected or allowed to call this endpoint.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/go/openapi/src/paths/clients.clients.management.end.yaml` around
lines 22 - 27, The description text for the management end endpoint contains an
extra blank line before the Note section, which makes it inconsistent with the
sibling start endpoint. Update the description in the clients management end
OpenAPI definition so the prose under the description field matches the
formatting used by the corresponding start endpoint, keeping only a single blank
line separation between the sentence and the Note text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/go/openapi/src/paths/clients.clients.management.end.yaml`:
- Around line 22-27: The description text for the management end endpoint
contains an extra blank line before the Note section, which makes it
inconsistent with the sibling start endpoint. Update the description in the
clients management end OpenAPI definition so the prose under the description
field matches the formatting used by the corresponding start endpoint, keeping
only a single blank line separation between the sentence and the Note text.

In
`@packages/go/openapi/src/schemas/model.client-management-operation-end-request.yaml`:
- Around line 17-26: Restrict the end-request status schema to terminal values
only: the current model.client-management-operation-end-request.yaml reuses
enum.client-management-operation-status.yaml, which allows non-terminal states.
Update the status property in this schema to use a dedicated terminal-status
enum (or inline enum) containing only succeeded, failed, and canceled, so
ModelClientManagementOperationEndRequest cannot accept queued/running values.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e2aee720-2b1b-4980-ab51-787adbcbd93a

📥 Commits

Reviewing files that changed from the base of the PR and between 3ef386c and 79fff7a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (10)
  • go.mod
  • packages/go/openapi/doc/openapi.json
  • packages/go/openapi/src/openapi.yaml
  • packages/go/openapi/src/paths/clients.clients.management.end.yaml
  • packages/go/openapi/src/paths/clients.clients.management.start.yaml
  • packages/go/openapi/src/schemas/enum.client-management-operation-status.yaml
  • packages/go/openapi/src/schemas/enum.client-management-operation-type.yaml
  • packages/go/openapi/src/schemas/model.client-management-operation-end-request.yaml
  • packages/go/openapi/src/schemas/model.client-management-operation-start-request.yaml
  • packages/go/openapi/src/schemas/model.client-management-operation.yaml

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.

1 participant