HYPERFLEET-978 - feat: (1/2) Add PUT command for internal status endpoints …#36
HYPERFLEET-978 - feat: (1/2) Add PUT command for internal status endpoints …#36ma-hill wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
WalkthroughThis PR updates the API from version 1.0.8 to 1.0.9 across specification and service definition files. New PUT endpoints are added for adapter status upsert operations: Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@services/statuses-internal.tsp`:
- Around line 61-62: The NodePoolStatusesInternal interface is missing the
authentication decorator and exposes putNodePoolStatuses without the same guard
as ClusterStatusesInternal; add the `@useAuth`(HyperFleet.BearerAuth) decorator
above the NodePoolStatusesInternal interface declaration so that the
putNodePoolStatuses operation (and any other methods on
NodePoolStatusesInternal) are protected by the same auth guard as
ClusterStatusesInternal.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 0b891817-811c-493a-8739-d54617787301
📒 Files selected for processing (7)
README.mdmain.tspschemas/core/openapi.yamlschemas/core/swagger.yamlschemas/gcp/openapi.yamlschemas/gcp/swagger.yamlservices/statuses-internal.tsp
| @route("/clusters/{cluster_id}/nodepools/{nodepool_id}/statuses") | ||
| interface NodePoolStatusesInternal{ | ||
|
|
||
| interface NodePoolStatusesInternal { |
There was a problem hiding this comment.
Add auth to NodePoolStatusesInternal before shipping new PUT write endpoint.
NodePoolStatusesInternal is missing @useAuth(HyperFleet.BearerAuth) (Line 62), so the new putNodePoolStatuses operation (Line 88-Line 104) is currently exposed without the same auth guard used by ClusterStatusesInternal. This expands unauthenticated write surface for adapter statuses.
Suggested fix
`@route`("/clusters/{cluster_id}/nodepools/{nodepool_id}/statuses")
+@useAuth(HyperFleet.BearerAuth)
interface NodePoolStatusesInternal {Also applies to: 88-104
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@services/statuses-internal.tsp` around lines 61 - 62, The
NodePoolStatusesInternal interface is missing the authentication decorator and
exposes putNodePoolStatuses without the same guard as ClusterStatusesInternal;
add the `@useAuth`(HyperFleet.BearerAuth) decorator above the
NodePoolStatusesInternal interface declaration so that the putNodePoolStatuses
operation (and any other methods on NodePoolStatusesInternal) are protected by
the same auth guard as ClusterStatusesInternal.
| - **`services/clusters.tsp`** - Cluster resource endpoints | ||
| - **`services/statuses.tsp`** - Status resource endpoints (GET only - public API) | ||
| - **`services/statuses-internal.tsp`** - Status write endpoints (POST - internal API, see below) | ||
| - **`services/statuses-internal.tsp`** - Status write endpoints (PUT - internal API, see below) |
There was a problem hiding this comment.
Since the file still contains POST endpoints, we should add it here too. Maybe we can update this in step 2 when the POST is actually removed. Wdyt?
| - **`services/statuses-internal.tsp`** - Status write endpoints (PUT - internal API, see below) | |
| - **`services/statuses-internal.tsp`** - Status write endpoints (POST/PUT - internal API, see below) |
| @path nodepool_id: string, | ||
| @path cluster_id: string, | ||
|
|
||
| @path nodepool_id: string, |
There was a problem hiding this comment.
nit: Missing JSDoc description
| @path nodepool_id: string, | |
| /** | |
| * NodePool ID | |
| */ | |
| @path nodepool_id: string, |
Summary
This change adds the PUT endpoint to the api-spec, which handles the idempotent upserts of statuses coming from the adapter.
Changes in Step 1 of 2:
Endpoints Added to API spec
Update version from 1.0.8 --> 1.0.9
Test Plan
npm build:allJira Issue
Summary by CodeRabbit
New Features
Documentation
Version Update