Skip to content

Commit a91d387

Browse files
CLOUDP-300050: validate spec on update PRs (#3654)
1 parent ab09aa4 commit a91d387

File tree

11 files changed

+8819
-86
lines changed

11 files changed

+8819
-86
lines changed

internal/api/commands.go

Lines changed: 72 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
14161416
OperationID: `getAtlasSearchDeployment`,
14171417
Version: `2024-05-30`,
14181418
Params: map[string]string{
1419-
`orgId`: `123`,
1419+
`clusterName`: `input:clusterName`,
1420+
`groupId`: `input:groupId`,
14201421
},
14211422
},
14221423
Expect: &WatcherExpectProperties{
@@ -1644,7 +1645,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
16441645
OperationID: `getAtlasSearchDeployment`,
16451646
Version: `2024-05-30`,
16461647
Params: map[string]string{
1647-
`orgId`: `123`,
1648+
`clusterName`: `input:clusterName`,
1649+
`groupId`: `input:groupId`,
16481650
},
16491651
},
16501652
Expect: &WatcherExpectProperties{
@@ -2559,7 +2561,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
25592561
OperationID: `getAtlasSearchDeployment`,
25602562
Version: `2024-05-30`,
25612563
Params: map[string]string{
2562-
`orgId`: `123`,
2564+
`clusterName`: `input:clusterName`,
2565+
`groupId`: `input:groupId`,
25632566
},
25642567
},
25652568
Expect: &WatcherExpectProperties{
@@ -3094,7 +3097,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
30943097
OperationID: `getBackupExportJob`,
30953098
Version: `2023-01-01`,
30963099
Params: map[string]string{
3097-
`orgId`: `123`,
3100+
`clusterName`: `input:clusterName`,
3101+
`exportId`: `body:$.id`,
3102+
`groupId`: `input:groupId`,
30983103
},
30993104
},
31003105
Expect: &WatcherExpectProperties{
@@ -3521,7 +3526,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
35213526
OperationID: `getReplicaSetBackup`,
35223527
Version: `2023-01-01`,
35233528
Params: map[string]string{
3524-
`orgId`: `123`,
3529+
`clusterName`: `input:clusterName`,
3530+
`groupId`: `input:groupId`,
3531+
`snapshotId`: `input:snapshotId`,
35253532
},
35263533
},
35273534
Expect: &WatcherExpectProperties{
@@ -3670,7 +3677,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
36703677
OperationID: `getDataProtectionSettings`,
36713678
Version: `2023-10-01`,
36723679
Params: map[string]string{
3673-
`orgId`: `123`,
3680+
`groupId`: `input:groupId`,
36743681
},
36753682
},
36763683
Expect: &WatcherExpectProperties{
@@ -5076,7 +5083,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
50765083
OperationID: `getReplicaSetBackup`,
50775084
Version: `2023-01-01`,
50785085
Params: map[string]string{
5079-
`orgId`: `123`,
5086+
`clusterName`: `input:clusterName`,
5087+
`groupId`: `input:groupId`,
5088+
`snapshotId`: `body:$.id`,
50805089
},
50815090
},
50825091
Expect: &WatcherExpectProperties{
@@ -5237,7 +5246,7 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
52375246
OperationID: `getDataProtectionSettings`,
52385247
Version: `2023-10-01`,
52395248
Params: map[string]string{
5240-
`orgId`: `123`,
5249+
`groupId`: `input:groupId`,
52415250
},
52425251
},
52435252
Expect: &WatcherExpectProperties{
@@ -5332,7 +5341,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
53325341
OperationID: `getReplicaSetBackup`,
53335342
Version: `2023-01-01`,
53345343
Params: map[string]string{
5335-
`orgId`: `123`,
5344+
`clusterName`: `input:clusterName`,
5345+
`groupId`: `input:groupId`,
5346+
`snapshotId`: `input:snapshotId`,
53365347
},
53375348
},
53385349
Expect: &WatcherExpectProperties{
@@ -6476,9 +6487,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
64766487
Watcher: &WatcherProperties{
64776488
Get: WatcherGetProperties{
64786489
OperationID: `getCluster`,
6479-
Version: `2024-10-23`,
6490+
Version: `2024-08-05`,
64806491
Params: map[string]string{
6481-
`orgId`: `123`,
6492+
`clusterName`: `body:$.name`,
6493+
`groupId`: `body:$.groupId`,
64826494
},
64836495
},
64846496
Expect: &WatcherExpectProperties{
@@ -6581,9 +6593,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
65816593
Watcher: &WatcherProperties{
65826594
Get: WatcherGetProperties{
65836595
OperationID: `getCluster`,
6584-
Version: `2024-10-23`,
6596+
Version: `2024-08-05`,
65856597
Params: map[string]string{
6586-
`orgId`: `123`,
6598+
`clusterName`: `input:clusterName`,
6599+
`groupId`: `input:groupId`,
65876600
},
65886601
},
65896602
Expect: &WatcherExpectProperties{
@@ -7305,7 +7318,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
73057318
OperationID: `getSampleDatasetLoadStatus`,
73067319
Version: `2023-01-01`,
73077320
Params: map[string]string{
7308-
`orgId`: `123`,
7321+
`groupId`: `input:groupId`,
7322+
`sampleDatasetId`: `body:$.id`,
73097323
},
73107324
},
73117325
Expect: &WatcherExpectProperties{
@@ -7689,9 +7703,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
76897703
Watcher: &WatcherProperties{
76907704
Get: WatcherGetProperties{
76917705
OperationID: `getCluster`,
7692-
Version: `2024-10-23`,
7706+
Version: `2024-08-05`,
76937707
Params: map[string]string{
7694-
`orgId`: `123`,
7708+
`clusterName`: `input:clusterName`,
7709+
`groupId`: `input:groupId`,
76957710
},
76967711
},
76977712
Expect: &WatcherExpectProperties{
@@ -9973,7 +9988,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
99739988
OperationID: `getPipeline`,
99749989
Version: `2023-01-01`,
99759990
Params: map[string]string{
9976-
`orgId`: `123`,
9991+
`groupId`: `input:groupId`,
9992+
`pipelineName`: `body:$.name`,
99779993
},
99789994
},
99799995
Expect: &WatcherExpectProperties{
@@ -10048,7 +10064,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1004810064
OperationID: `getPipeline`,
1004910065
Version: `2023-01-01`,
1005010066
Params: map[string]string{
10051-
`orgId`: `123`,
10067+
`groupId`: `input:groupId`,
10068+
`pipelineName`: `input:pipelineName`,
1005210069
},
1005310070
},
1005410071
Expect: &WatcherExpectProperties{
@@ -10879,7 +10896,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1087910896
OperationID: `getPipeline`,
1088010897
Version: `2023-01-01`,
1088110898
Params: map[string]string{
10882-
`orgId`: `123`,
10899+
`groupId`: `input:groupId`,
10900+
`pipelineName`: `input:pipelineName`,
1088310901
},
1088410902
},
1088510903
Expect: &WatcherExpectProperties{
@@ -13410,7 +13428,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1341013428
OperationID: `getFlexCluster`,
1341113429
Version: `2024-11-13`,
1341213430
Params: map[string]string{
13413-
`orgId`: `123`,
13431+
`groupId`: `input:groupId`,
13432+
`name`: `body:$.name`,
1341413433
},
1341513434
},
1341613435
Expect: &WatcherExpectProperties{
@@ -13496,7 +13515,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1349613515
OperationID: `getFlexCluster`,
1349713516
Version: `2024-11-13`,
1349813517
Params: map[string]string{
13499-
`orgId`: `123`,
13518+
`groupId`: `input:groupId`,
13519+
`name`: `input:name`,
1350013520
},
1350113521
},
1350213522
Expect: &WatcherExpectProperties{
@@ -13733,7 +13753,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1373313753
OperationID: `getFlexCluster`,
1373413754
Version: `2024-11-13`,
1373513755
Params: map[string]string{
13736-
`orgId`: `123`,
13756+
`groupId`: `input:groupId`,
13757+
`name`: `input:name`,
1373713758
},
1373813759
},
1373913760
Expect: &WatcherExpectProperties{
@@ -13882,7 +13903,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1388213903
OperationID: `getFlexBackupRestoreJob`,
1388313904
Version: `2024-11-13`,
1388413905
Params: map[string]string{
13885-
`orgId`: `123`,
13906+
`groupId`: `input:groupId`,
13907+
`name`: `input:name`,
13908+
`restoreJobId`: `body:$.id`,
1388613909
},
1388713910
},
1388813911
Expect: &WatcherExpectProperties{
@@ -15578,7 +15601,8 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
1557815601
OperationID: `getLdapConfigurationStatus`,
1557915602
Version: `2023-01-01`,
1558015603
Params: map[string]string{
15581-
`orgId`: `123`,
15604+
`groupId`: `input:groupId`,
15605+
`requestId`: `body:$.requestId`,
1558215606
},
1558315607
},
1558415608
Expect: &WatcherExpectProperties{
@@ -20153,7 +20177,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2015320177
OperationID: `getOnlineArchive`,
2015420178
Version: `2023-01-01`,
2015520179
Params: map[string]string{
20156-
`orgId`: `123`,
20180+
`archiveId`: `body:$.id`,
20181+
`clusterName`: `input:clusterName`,
20182+
`groupId`: `input:groupId`,
2015720183
},
2015820184
},
2015920185
Expect: &WatcherExpectProperties{
@@ -20252,7 +20278,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2025220278
OperationID: `getOnlineArchive`,
2025320279
Version: `2023-01-01`,
2025420280
Params: map[string]string{
20255-
`orgId`: `123`,
20281+
`archiveId`: `input:archiveId`,
20282+
`clusterName`: `input:clusterName`,
20283+
`groupId`: `input:groupId`,
2025620284
},
2025720285
},
2025820286
Expect: &WatcherExpectProperties{
@@ -20607,7 +20635,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2060720635
OperationID: `getOnlineArchive`,
2060820636
Version: `2023-01-01`,
2060920637
Params: map[string]string{
20610-
`orgId`: `123`,
20638+
`archiveId`: `input:archiveId`,
20639+
`clusterName`: `input:clusterName`,
20640+
`groupId`: `input:groupId`,
2061120641
},
2061220642
},
2061320643
Expect: &WatcherExpectProperties{
@@ -22898,7 +22928,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2289822928
OperationID: `getPrivateEndpointService`,
2289922929
Version: `2023-01-01`,
2290022930
Params: map[string]string{
22901-
`orgId`: `123`,
22931+
`cloudProvider`: `body:$.cloudProvider`,
22932+
`endpointServiceId`: `body:$.id`,
22933+
`groupId`: `input:groupId`,
2290222934
},
2290322935
},
2290422936
Expect: &WatcherExpectProperties{
@@ -23082,7 +23114,9 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2308223114
OperationID: `getPrivateEndpointService`,
2308323115
Version: `2023-01-01`,
2308423116
Params: map[string]string{
23085-
`orgId`: `123`,
23117+
`cloudProvider`: `body:$.cloudProvider`,
23118+
`endpointServiceId`: `body:$.id`,
23119+
`groupId`: `input:groupId`,
2308623120
},
2308723121
},
2308823122
Expect: &WatcherExpectProperties{
@@ -27478,9 +27512,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2747827512
Watcher: &WatcherProperties{
2747927513
Get: WatcherGetProperties{
2748027514
OperationID: `getFlexCluster`,
27481-
Version: `2023-01-01`,
27515+
Version: `2024-11-13`,
2748227516
Params: map[string]string{
27483-
`orgId`: `123`,
27517+
`groupId`: `input:groupId`,
27518+
`name`: `body:$.name`,
2748427519
},
2748527520
},
2748627521
Expect: &WatcherExpectProperties{
@@ -27566,9 +27601,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2756627601
Watcher: &WatcherProperties{
2756727602
Get: WatcherGetProperties{
2756827603
OperationID: `getFlexCluster`,
27569-
Version: `2023-01-01`,
27604+
Version: `2024-11-13`,
2757027605
Params: map[string]string{
27571-
`orgId`: `123`,
27606+
`groupId`: `input:groupId`,
27607+
`name`: `input:name`,
2757227608
},
2757327609
},
2757427610
Expect: &WatcherExpectProperties{
@@ -27812,9 +27848,10 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
2781227848
Watcher: &WatcherProperties{
2781327849
Get: WatcherGetProperties{
2781427850
OperationID: `getFlexCluster`,
27815-
Version: `2023-01-01`,
27851+
Version: `2024-11-13`,
2781627852
Params: map[string]string{
27817-
`orgId`: `123`,
27853+
`groupId`: `input:groupId`,
27854+
`name`: `input:name`,
2781827855
},
2781927856
},
2782027857
Expect: &WatcherExpectProperties{

tools/api-generator/.snapshots/04-spec-with-overrides.yaml.snapshot

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,6 @@ var Commands = GroupedAndSortedCommands{
9595
},
9696
},
9797
},
98-
Watcher: &WatcherProperties{
99-
Get: WatcherGetProperties{
100-
OperationID: `getCluster`,
101-
Version: `2023-02-01`,
102-
Params: map[string]string{
103-
`orgId`: `123`,
104-
},
105-
},
106-
Expect: &WatcherExpectProperties{
107-
HTTPCode: 200, //nolint
108-
Match: &WatcherMatchProperties{
109-
Path: `$.stateName`,
110-
Values: []string{
111-
`IDLE`,
112-
},
113-
},
114-
},
115-
},
11698
},
11799
},
118100
},

tools/api-generator/.snapshots/06-spec-with-cli-specific-extensions.yaml.snapshot

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ NOTE: Groups and projects are synonymous terms. Your group id is the same as you
101101
},
102102
},
103103
},
104-
Watcher: &WatcherProperties{
105-
Get: WatcherGetProperties{
106-
OperationID: `getCluster`,
107-
Version: ``,
108-
Params: map[string]string{
109-
`orgId`: `123`,
110-
},
111-
},
112-
Expect: nil,
113-
},
114104
},
115105
},
116106
},

0 commit comments

Comments
 (0)