Skip to content

Commit 3fb6ddd

Browse files
authored
CLOUDP-305830: stop filtering x-xgen-changelog from versioned files (#540)
1 parent ab71aa9 commit 3fb6ddd

File tree

10 files changed

+39
-192
lines changed

10 files changed

+39
-192
lines changed

tools/cli/internal/cli/filter/filter_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestSuccessfulFilter_Run(t *testing.T) {
4747
for _, pathItem := range newSpec.Spec.Paths.Map() {
4848
for _, operation := range pathItem.Operations() {
4949
// check extensions are removed at the operation level
50-
require.Nil(t, operation.Extensions)
50+
require.Nil(t, operation.Extensions["x-xgen-owner-team"])
5151
}
5252
}
5353
}

tools/cli/internal/openapi/filter/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The Atlas Admin API OpenAPI specifications are used not only to document REST en
1111
[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec.](../internal/openapi/filter/extension.go?plain=1#L21)
1212
[HiddenEnvsFilter: is a filter that removes paths, operations,](../internal/openapi/filter/hidden_envs.go?plain=1#L28)
1313
[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](../internal/openapi/filter/info.go?plain=1#L23)
14-
[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations](../internal/openapi/filter/operations.go?plain=1#L20)
14+
[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](../internal/openapi/filter/operations.go?plain=1#L20)
1515
[TagsFilter: removes tags that are not used in the operations.](../internal/openapi/filter/tags.go?plain=1#L23)
1616
[VersioningExtensionFilter: is a filter that updates the x-sunset and x-xgen-version extensions to a date string](../internal/openapi/filter/versioning_extension.go?plain=1#L25)
1717
[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](../internal/openapi/filter/versioning.go?plain=1#L25)

tools/cli/internal/openapi/filter/operations.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"github.com/getkin/kin-openapi/openapi3"
1818
)
1919

20-
// OperationsFilter: is a filter that removes the x-xgen-owner-team and x-xgen-changelog extension from operations.
20+
// OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.
2121
type OperationsFilter struct {
2222
oas *openapi3.T
2323
}
@@ -35,7 +35,6 @@ func (f *OperationsFilter) Apply() error {
3535
for _, operation := range pathItem.Operations() {
3636
if operation.Extensions != nil {
3737
delete(operation.Extensions, "x-xgen-owner-team")
38-
delete(operation.Extensions, "x-xgen-changelog")
3938
}
4039
}
4140
}

tools/cli/test/data/split/dev/openapi-mms.json

+4-34
Original file line numberDiff line numberDiff line change
@@ -16292,9 +16292,6 @@
1629216292
"DigestAuth": []
1629316293
}
1629416294
],
16295-
"x-xgen-changelog": {
16296-
"2023-08-02": "If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields"
16297-
},
1629816295
"x-xgen-owner-team": "Atlas Online Archive II"
1629916296
}
1630016297
},
@@ -23654,7 +23651,10 @@
2365423651
"x-xgen-hidden-env": {
2365523652
"envs": "qa,prod"
2365623653
},
23657-
"x-xgen-owner-team": "Atlas Serverless II"
23654+
"x-xgen-owner-team": "Atlas Serverless II",
23655+
"x-xgen-changelog": {
23656+
"2025-03-02": "Changelog test entry."
23657+
}
2365823658
},
2365923659
"patch": {
2366023660
"tags": ["USS Instances"],
@@ -26028,9 +26028,6 @@
2602826028
"DigestAuth": []
2602926029
}
2603026030
],
26031-
"x-xgen-changelog": {
26032-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26033-
},
2603426031
"x-xgen-owner-team": "Atlas Streams"
2603526032
},
2603626033
"post": {
@@ -26099,9 +26096,6 @@
2609926096
"DigestAuth": []
2610026097
}
2610126098
],
26102-
"x-xgen-changelog": {
26103-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26104-
},
2610526099
"x-xgen-owner-team": "Atlas Streams"
2610626100
}
2610726101
},
@@ -26152,9 +26146,6 @@
2615226146
"DigestAuth": []
2615326147
}
2615426148
],
26155-
"x-xgen-changelog": {
26156-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26157-
},
2615826149
"x-xgen-owner-team": "Atlas Streams"
2615926150
},
2616026151
"post": {
@@ -26211,9 +26202,6 @@
2621126202
"DigestAuth": []
2621226203
}
2621326204
],
26214-
"x-xgen-changelog": {
26215-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26216-
},
2621726205
"x-xgen-owner-team": "Atlas Streams"
2621826206
}
2621926207
},
@@ -26276,9 +26264,6 @@
2627626264
"DigestAuth": []
2627726265
}
2627826266
],
26279-
"x-xgen-changelog": {
26280-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26281-
},
2628226267
"x-xgen-owner-team": "Atlas Streams"
2628326268
},
2628426269
"delete": {
@@ -26345,9 +26330,6 @@
2634526330
"DigestAuth": []
2634626331
}
2634726332
],
26348-
"x-xgen-changelog": {
26349-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26350-
},
2635126333
"x-xgen-owner-team": "Atlas Streams"
2635226334
},
2635326335
"patch": {
@@ -26428,9 +26410,6 @@
2642826410
"DigestAuth": []
2642926411
}
2643026412
],
26431-
"x-xgen-changelog": {
26432-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26433-
},
2643426413
"x-xgen-owner-team": "Atlas Streams"
2643526414
}
2643626415
},
@@ -26495,9 +26474,6 @@
2649526474
"DigestAuth": []
2649626475
}
2649726476
],
26498-
"x-xgen-changelog": {
26499-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26500-
},
2650126477
"x-xgen-owner-team": "Atlas Streams"
2650226478
},
2650326479
"delete": {
@@ -26555,9 +26531,6 @@
2655526531
"DigestAuth": []
2655626532
}
2655726533
],
26558-
"x-xgen-changelog": {
26559-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26560-
},
2656126534
"x-xgen-owner-team": "Atlas Streams"
2656226535
},
2656326536
"patch": {
@@ -26629,9 +26602,6 @@
2662926602
"DigestAuth": []
2663026603
}
2663126604
],
26632-
"x-xgen-changelog": {
26633-
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
26634-
},
2663526605
"x-xgen-owner-team": "Atlas Streams"
2663626606
}
2663726607
},

tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json

+3
Original file line numberDiff line numberDiff line change
@@ -19542,6 +19542,9 @@
1954219542
"security" : [ {
1954319543
"DigestAuth" : [ ]
1954419544
} ],
19545+
"x-xgen-changelog": {
19546+
"2025-03-02": "Changelog test entry."
19547+
},
1954519548
"summary" : "Remove One USS Instance from One Project",
1954619549
"tags" : [ "USS Instances" ]
1954719550
},

tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -15892,6 +15892,8 @@ paths:
1589215892
security:
1589315893
- DigestAuth: []
1589415894
summary: Remove One USS Instance from One Project
15895+
x-xgen-changelog:
15896+
"2025-03-02": Changelog test entry.
1589515897
tags:
1589615898
- USS Instances
1589715899
get:

tools/cli/test/data/split/dev/openapi-v2.json

+14-44
Original file line numberDiff line numberDiff line change
@@ -6985,10 +6985,7 @@
69856985
"DigestAuth" : [ ]
69866986
} ],
69876987
"summary" : "Create One Online Archive",
6988-
"tags" : [ "Online Archive" ],
6989-
"x-xgen-changelog" : {
6990-
"2023-08-02" : "If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields"
6991-
}
6988+
"tags" : [ "Online Archive" ]
69926989
}
69936990
},
69946991
"/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz" : {
@@ -18176,10 +18173,7 @@
1817618173
"DigestAuth" : [ ]
1817718174
} ],
1817818175
"summary" : "Return All Project Stream Instances",
18179-
"tags" : [ "Streams" ],
18180-
"x-xgen-changelog" : {
18181-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18182-
}
18176+
"tags" : [ "Streams" ]
1818318177
},
1818418178
"post" : {
1818518179
"description" : "Creates one stream instance in the specified project. To use this resource, the requesting API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role.",
@@ -18228,10 +18222,7 @@
1822818222
"DigestAuth" : [ ]
1822918223
} ],
1823018224
"summary" : "Create One Stream Instance",
18231-
"tags" : [ "Streams" ],
18232-
"x-xgen-changelog" : {
18233-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18234-
}
18225+
"tags" : [ "Streams" ]
1823518226
}
1823618227
},
1823718228
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}" : {
@@ -18282,10 +18273,7 @@
1828218273
"DigestAuth" : [ ]
1828318274
} ],
1828418275
"summary" : "Delete One Stream Instance",
18285-
"tags" : [ "Streams" ],
18286-
"x-xgen-changelog" : {
18287-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18288-
}
18276+
"tags" : [ "Streams" ]
1828918277
},
1829018278
"get" : {
1829118279
"description" : "Returns the details of one stream instance within the specified project. To use this resource, the requesting API Key must have the Project Data Access roles, Project Owner role or Project Stream Processing Owner role.",
@@ -18339,10 +18327,7 @@
1833918327
"DigestAuth" : [ ]
1834018328
} ],
1834118329
"summary" : "Return One Stream Instance",
18342-
"tags" : [ "Streams" ],
18343-
"x-xgen-changelog" : {
18344-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18345-
}
18330+
"tags" : [ "Streams" ]
1834618331
},
1834718332
"patch" : {
1834818333
"description" : "Update one stream instance in the specified project. To use this resource, the requesting API Key must have the Project Data Access Admin role, Project Owner role or Project Stream Processing Owner role.",
@@ -18405,10 +18390,7 @@
1840518390
"DigestAuth" : [ ]
1840618391
} ],
1840718392
"summary" : "Update One Stream Instance",
18408-
"tags" : [ "Streams" ],
18409-
"x-xgen-changelog" : {
18410-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18411-
}
18393+
"tags" : [ "Streams" ]
1841218394
}
1841318395
},
1841418396
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs" : {
@@ -18537,10 +18519,7 @@
1853718519
"DigestAuth" : [ ]
1853818520
} ],
1853918521
"summary" : "Return All Connections Of The Stream Instances",
18540-
"tags" : [ "Streams" ],
18541-
"x-xgen-changelog" : {
18542-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18543-
}
18522+
"tags" : [ "Streams" ]
1854418523
},
1854518524
"post" : {
1854618525
"description" : "Creates one connection for a stream instance in the specified project. To use this resource, the requesting API Key must have the Project Owner or Project Stream Processing Owner role.",
@@ -18600,10 +18579,7 @@
1860018579
"DigestAuth" : [ ]
1860118580
} ],
1860218581
"summary" : "Create One Connection",
18603-
"tags" : [ "Streams" ],
18604-
"x-xgen-changelog" : {
18605-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18606-
}
18582+
"tags" : [ "Streams" ]
1860718583
}
1860818584
},
1860918585
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" : {
@@ -18662,10 +18638,7 @@
1866218638
"DigestAuth" : [ ]
1866318639
} ],
1866418640
"summary" : "Delete One Stream Connection",
18665-
"tags" : [ "Streams" ],
18666-
"x-xgen-changelog" : {
18667-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18668-
}
18641+
"tags" : [ "Streams" ]
1866918642
},
1867018643
"get" : {
1867118644
"description" : "Returns the details of one stream connection within the specified stream instance. To use this resource, the requesting API Key must have the Project Read Only role.",
@@ -18717,10 +18690,7 @@
1871718690
"DigestAuth" : [ ]
1871818691
} ],
1871918692
"summary" : "Return One Stream Connection",
18720-
"tags" : [ "Streams" ],
18721-
"x-xgen-changelog" : {
18722-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18723-
}
18693+
"tags" : [ "Streams" ]
1872418694
},
1872518695
"patch" : {
1872618696
"description" : "Update one connection for the specified stream instance in the specified project. To use this resource, the requesting API Key must have the Project Owner role or Project Stream Processing Owner role.",
@@ -18791,10 +18761,7 @@
1879118761
"DigestAuth" : [ ]
1879218762
} ],
1879318763
"summary" : "Update One Stream Connection",
18794-
"tags" : [ "Streams" ],
18795-
"x-xgen-changelog" : {
18796-
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
18797-
}
18764+
"tags" : [ "Streams" ]
1879818765
}
1879918766
},
1880018767
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor" : {
@@ -19964,6 +19931,9 @@
1996419931
"security" : [ {
1996519932
"DigestAuth" : [ ]
1996619933
} ],
19934+
"x-xgen-changelog": {
19935+
"2025-03-02": "Changelog test entry."
19936+
},
1996719937
"summary" : "Remove One USS Instance from One Project",
1996819938
"tags" : [ "USS Instances" ]
1996919939
},

0 commit comments

Comments
 (0)