feat: start and end managment operation endpoints BED-8325#2948
feat: start and end managment operation endpoints BED-8325#2948lrfalslev wants to merge 5 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis 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. ChangesClient Management Operation API
Go Module Dependency Bump
Estimated code review effort: 2 (Simple) | ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
packages/go/openapi/src/schemas/model.client-management-operation-end-request.yaml (1)
17-26: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winConsider restricting
statusto terminal values only.The end-request
statusfield 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); allowingqueued/runninghere 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 + - canceledstatus: - $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 valueMinor: 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\nin the generatedopenapi.json), while the siblingstart.yamlendpoint 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
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (10)
go.modpackages/go/openapi/doc/openapi.jsonpackages/go/openapi/src/openapi.yamlpackages/go/openapi/src/paths/clients.clients.management.end.yamlpackages/go/openapi/src/paths/clients.clients.management.start.yamlpackages/go/openapi/src/schemas/enum.client-management-operation-status.yamlpackages/go/openapi/src/schemas/enum.client-management-operation-type.yamlpackages/go/openapi/src/schemas/model.client-management-operation-end-request.yamlpackages/go/openapi/src/schemas/model.client-management-operation-start-request.yamlpackages/go/openapi/src/schemas/model.client-management-operation.yaml
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
Checklist:
Summary by CodeRabbit