Skip to content

Commit e9a3736

Browse files
committed
HYPERFLEET-1024 fix: resolve spectral warnings, set to fail on warnings
1 parent e286c57 commit e9a3736

10 files changed

Lines changed: 174 additions & 12 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Lint OpenAPI schemas
4343
run: |
44-
node_modules/.bin/spectral lint schemas/core/openapi.yaml schemas/gcp/openapi.yaml --format github-actions
44+
npx spectral lint schemas/core/openapi.yaml schemas/gcp/openapi.yaml --format github-actions --fail-severity warn
4545
4646
- name: Check version bump
4747
env:

.spectral.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
extends: ["spectral:oas"]
2+
overrides:
3+
- files:
4+
- "schemas/core/openapi.yaml#/components/schemas/BearerAuth"
5+
- "schemas/gcp/openapi.yaml#/components/schemas/BearerAuth"
6+
rules:
7+
oas3-unused-component: off

schemas/core/openapi.yaml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@ info:
1313
**Architecture**: Simple CRUD only, no business logic, no event creation.
1414
Sentinel operator handles all orchestration logic.
1515
Adapters handle the specifics of managing spec
16-
tags: []
16+
tags:
17+
- name: Clusters
18+
- name: Cluster statuses
19+
- name: NodePool statuses
20+
- name: NodePools
1721
paths:
1822
/api/hyperfleet/v1/clusters:
1923
get:
2024
operationId: getClusters
2125
summary: List clusters
26+
description: Returns a list of all clusters.
2227
parameters:
2328
- $ref: '#/components/parameters/SearchParams'
2429
- $ref: '#/components/parameters/QueryParams.page'
@@ -40,6 +45,8 @@ paths:
4045
application/problem+json:
4146
schema:
4247
$ref: '#/components/schemas/Error'
48+
tags:
49+
- Clusters
4350
security:
4451
- BearerAuth: []
4552
post:
@@ -67,6 +74,8 @@ paths:
6774
application/problem+json:
6875
schema:
6976
$ref: '#/components/schemas/Error'
77+
tags:
78+
- Clusters
7079
requestBody:
7180
required: true
7281
content:
@@ -79,6 +88,7 @@ paths:
7988
get:
8089
operationId: getClusterById
8190
summary: Get cluster by ID
91+
description: Returns a single cluster by its ID.
8292
parameters:
8393
- $ref: '#/components/parameters/SearchParams'
8494
- name: cluster_id
@@ -101,6 +111,8 @@ paths:
101111
application/problem+json:
102112
schema:
103113
$ref: '#/components/schemas/Error'
114+
tags:
115+
- Clusters
104116
security:
105117
- BearerAuth: []
106118
patch:
@@ -133,6 +145,8 @@ paths:
133145
application/problem+json:
134146
schema:
135147
$ref: '#/components/schemas/Error'
148+
tags:
149+
- Clusters
136150
requestBody:
137151
required: true
138152
content:
@@ -229,6 +243,8 @@ paths:
229243
application/problem+json:
230244
schema:
231245
$ref: '#/components/schemas/Error'
246+
tags:
247+
- Clusters
232248
security:
233249
- BearerAuth: []
234250
/api/hyperfleet/v1/clusters/{cluster_id}/nodepools:
@@ -263,6 +279,8 @@ paths:
263279
application/problem+json:
264280
schema:
265281
$ref: '#/components/schemas/Error'
282+
tags:
283+
- NodePools
266284
security:
267285
- BearerAuth: []
268286
post:
@@ -293,6 +311,8 @@ paths:
293311
application/problem+json:
294312
schema:
295313
$ref: '#/components/schemas/Error'
314+
tags:
315+
- NodePools
296316
requestBody:
297317
required: true
298318
content:
@@ -334,6 +354,8 @@ paths:
334354
application/problem+json:
335355
schema:
336356
$ref: '#/components/schemas/Error'
357+
tags:
358+
- NodePools
337359
security:
338360
- BearerAuth: []
339361
delete:
@@ -434,6 +456,8 @@ paths:
434456
application/problem+json:
435457
schema:
436458
$ref: '#/components/schemas/Error'
459+
tags:
460+
- NodePools
437461
security:
438462
- BearerAuth: []
439463
patch:
@@ -472,6 +496,8 @@ paths:
472496
application/problem+json:
473497
schema:
474498
$ref: '#/components/schemas/Error'
499+
tags:
500+
- NodePools
475501
requestBody:
476502
required: true
477503
content:
@@ -516,6 +542,8 @@ paths:
516542
description: The server cannot find the requested resource.
517543
'409':
518544
description: The request conflicts with the current state of the server.
545+
tags:
546+
- NodePool statuses
519547
requestBody:
520548
required: true
521549
content:
@@ -527,6 +555,7 @@ paths:
527555
put:
528556
operationId: putNodePoolStatuses
529557
summary: Adapter creates or updates resource nodepool status
558+
description: Idempotent upsert of an adapter status for this nodepool. Use instead of POST when the adapter name is known upfront.
530559
parameters:
531560
- name: cluster_id
532561
in: path
@@ -553,6 +582,8 @@ paths:
553582
description: The server cannot find the requested resource.
554583
'409':
555584
description: The request conflicts with the current state of the server.
585+
tags:
586+
- NodePool statuses
556587
requestBody:
557588
required: true
558589
content:
@@ -597,6 +628,8 @@ paths:
597628
application/problem+json:
598629
schema:
599630
$ref: '#/components/schemas/Error'
631+
tags:
632+
- NodePool statuses
600633
/api/hyperfleet/v1/clusters/{cluster_id}/statuses:
601634
post:
602635
operationId: postClusterStatuses
@@ -627,6 +660,8 @@ paths:
627660
description: The server cannot find the requested resource.
628661
'409':
629662
description: The request conflicts with the current state of the server.
663+
tags:
664+
- Cluster statuses
630665
requestBody:
631666
required: true
632667
content:
@@ -638,6 +673,7 @@ paths:
638673
put:
639674
operationId: putClusterStatuses
640675
summary: Adapter creates or updates resource cluster status
676+
description: Idempotent upsert of an adapter status for this cluster. Use instead of POST when the adapter name is known upfront.
641677
parameters:
642678
- name: cluster_id
643679
in: path
@@ -658,6 +694,8 @@ paths:
658694
description: The server cannot find the requested resource.
659695
'409':
660696
description: The request conflicts with the current state of the server.
697+
tags:
698+
- Cluster statuses
661699
requestBody:
662700
required: true
663701
content:
@@ -693,6 +731,8 @@ paths:
693731
description: The server could not understand the request due to invalid syntax.
694732
'404':
695733
description: The server cannot find the requested resource.
734+
tags:
735+
- Cluster statuses
696736
security:
697737
- BearerAuth: []
698738
/api/hyperfleet/v1/nodepools:
@@ -721,6 +761,8 @@ paths:
721761
application/problem+json:
722762
schema:
723763
$ref: '#/components/schemas/Error'
764+
tags:
765+
- NodePools
724766
security:
725767
- BearerAuth: []
726768
components:

schemas/core/swagger.yaml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ paths:
7474
$ref: '#/definitions/Error'
7575
security:
7676
- BearerAuth: []
77+
tags:
78+
- Clusters
79+
description: Returns a list of all clusters.
7780
operationId: getClusters
7881
summary: List clusters
7982
post:
@@ -103,6 +106,8 @@ paths:
103106
$ref: '#/definitions/Error'
104107
security:
105108
- BearerAuth: []
109+
tags:
110+
- Clusters
106111
description: >-
107112
Create a new cluster resource.
108113
@@ -215,6 +220,8 @@ paths:
215220
$ref: '#/definitions/Error'
216221
security:
217222
- BearerAuth: []
223+
tags:
224+
- Clusters
218225
description: >-
219226
Marks the cluster for deletion by setting deleted_time to the current
220227
time, cascades to its nodepools.
@@ -255,6 +262,9 @@ paths:
255262
$ref: '#/definitions/Error'
256263
security:
257264
- BearerAuth: []
265+
tags:
266+
- Clusters
267+
description: Returns a single cluster by its ID.
258268
operationId: getClusterById
259269
summary: Get cluster by ID
260270
patch:
@@ -291,6 +301,8 @@ paths:
291301
$ref: '#/definitions/Error'
292302
security:
293303
- BearerAuth: []
304+
tags:
305+
- Clusters
294306
description: Patch a specific cluster by ID
295307
operationId: patchClusterById
296308
summary: Patch cluster by ID
@@ -351,6 +363,8 @@ paths:
351363
$ref: '#/definitions/Error'
352364
security:
353365
- BearerAuth: []
366+
tags:
367+
- NodePools
354368
description: Returns the list of all nodepools for a cluster
355369
operationId: getNodePoolsByClusterId
356370
summary: List all nodepools for cluster
@@ -388,6 +402,8 @@ paths:
388402
$ref: '#/definitions/Error'
389403
security:
390404
- BearerAuth: []
405+
tags:
406+
- NodePools
391407
description: Create a NodePool for a cluster
392408
operationId: createNodePool
393409
summary: Create nodepool
@@ -501,6 +517,8 @@ paths:
501517
$ref: '#/definitions/Error'
502518
security:
503519
- BearerAuth: []
520+
tags:
521+
- NodePools
504522
description: >-
505523
Marks the nodepool for deletion by setting deleted_time and deleted_by.
506524
Does not affect the parent cluster.
@@ -536,6 +554,8 @@ paths:
536554
$ref: '#/definitions/Error'
537555
security:
538556
- BearerAuth: []
557+
tags:
558+
- NodePools
539559
description: Returns specific nodepool
540560
operationId: getNodePoolById
541561
summary: Get nodepool by ID
@@ -578,6 +598,8 @@ paths:
578598
$ref: '#/definitions/Error'
579599
security:
580600
- BearerAuth: []
601+
tags:
602+
- NodePools
581603
description: Patch a specific nodepool within a cluster
582604
operationId: patchNodePoolById
583605
summary: Patch nodepool by ID
@@ -640,6 +662,8 @@ paths:
640662
description: An unexpected error response.
641663
schema:
642664
$ref: '#/definitions/Error'
665+
tags:
666+
- NodePool statuses
643667
description: Returns adapter status reports for this nodepool
644668
operationId: getNodePoolsStatuses
645669
summary: List all adapter statuses for nodepools
@@ -679,6 +703,8 @@ paths:
679703
description: The request conflicts with the current state of the server.
680704
security:
681705
- BearerAuth: []
706+
tags:
707+
- NodePool statuses
682708
description: >-
683709
Adapter creates or updates its status report for this nodepool.
684710
@@ -727,6 +753,11 @@ paths:
727753
description: The request conflicts with the current state of the server.
728754
security:
729755
- BearerAuth: []
756+
tags:
757+
- NodePool statuses
758+
description: >-
759+
Idempotent upsert of an adapter status for this nodepool. Use instead of
760+
POST when the adapter name is known upfront.
730761
operationId: putNodePoolStatuses
731762
summary: Adapter creates or updates resource nodepool status
732763
'/api/hyperfleet/v1/clusters/{cluster_id}/statuses':
@@ -783,6 +814,8 @@ paths:
783814
description: The server cannot find the requested resource.
784815
security:
785816
- BearerAuth: []
817+
tags:
818+
- Cluster statuses
786819
description: Returns adapter status reports for this cluster
787820
operationId: getClusterStatuses
788821
summary: List all adapter statuses for cluster
@@ -817,6 +850,8 @@ paths:
817850
description: The request conflicts with the current state of the server.
818851
security:
819852
- BearerAuth: []
853+
tags:
854+
- Cluster statuses
820855
description: >-
821856
Adapter creates or updates its status report for this cluster.
822857
@@ -860,6 +895,11 @@ paths:
860895
description: The request conflicts with the current state of the server.
861896
security:
862897
- BearerAuth: []
898+
tags:
899+
- Cluster statuses
900+
description: >-
901+
Idempotent upsert of an adapter status for this cluster. Use instead of
902+
POST when the adapter name is known upfront.
863903
operationId: putClusterStatuses
864904
summary: Adapter creates or updates resource cluster status
865905
/api/hyperfleet/v1/nodepools:
@@ -914,6 +954,8 @@ paths:
914954
$ref: '#/definitions/Error'
915955
security:
916956
- BearerAuth: []
957+
tags:
958+
- NodePools
917959
description: Returns the list of all nodepools
918960
operationId: getNodePools
919961
summary: List all nodepools for cluster
@@ -1973,7 +2015,11 @@ securityDefinitions:
19732015
in: header
19742016
name: Authorization
19752017
type: apiKey
1976-
tags: []
2018+
tags:
2019+
- name: Clusters
2020+
- name: Cluster statuses
2021+
- name: NodePool statuses
2022+
- name: NodePools
19772023
x-components:
19782024
parameters:
19792025
QueryParams.order:

0 commit comments

Comments
 (0)