Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/cli/internal/cli/filter/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestSuccessfulFilter_Run(t *testing.T) {
for _, pathItem := range newSpec.Spec.Paths.Map() {
for _, operation := range pathItem.Operations() {
// check extensions are removed at the operation level
require.Nil(t, operation.Extensions)
require.Nil(t, operation.Extensions["x-xgen-owner-team"])
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/internal/openapi/filter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Atlas Admin API OpenAPI specifications are used not only to document REST en
[ExtensionFilter: is a filter that removes the x-xgen-IPA-exception extension from the OpenAPI spec.](../internal/openapi/filter/extension.go?plain=1#L21)
[HiddenEnvsFilter: is a filter that removes paths, operations,](../internal/openapi/filter/hidden_envs.go?plain=1#L28)
[InfoVersioningFilter: Filter that modifies the Info object in the OpenAPI spec with the target version.](../internal/openapi/filter/info.go?plain=1#L23)
[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations](../internal/openapi/filter/operations.go?plain=1#L20)
[OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.](../internal/openapi/filter/operations.go?plain=1#L20)
[TagsFilter: removes tags that are not used in the operations.](../internal/openapi/filter/tags.go?plain=1#L23)
[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)
[VersioningFilter: is a filter that modifies the OpenAPI spec by removing operations and responses](../internal/openapi/filter/versioning.go?plain=1#L25)
3 changes: 1 addition & 2 deletions tools/cli/internal/openapi/filter/operations.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/getkin/kin-openapi/openapi3"
)

// OperationsFilter: is a filter that removes the x-xgen-owner-team and x-xgen-changelog extension from operations.
// OperationsFilter: is a filter that removes the x-xgen-owner-team extension from operations.
type OperationsFilter struct {
oas *openapi3.T
}
Expand All @@ -35,7 +35,6 @@ func (f *OperationsFilter) Apply() error {
for _, operation := range pathItem.Operations() {
if operation.Extensions != nil {
delete(operation.Extensions, "x-xgen-owner-team")
delete(operation.Extensions, "x-xgen-changelog")
Copy link
Collaborator

@andreaangiolillo andreaangiolillo Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this line the fix? Do we plan to include this extension for all the specs? I am wondering if we should keep it only for the latest API version spec but not strong opinion

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, and I plan to keep it in all specs, I added the removal then caused a regression

}
}
}
Expand Down
38 changes: 4 additions & 34 deletions tools/cli/test/data/split/dev/openapi-mms.json
Original file line number Diff line number Diff line change
Expand Up @@ -16292,9 +16292,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-08-02": "If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields"
},
"x-xgen-owner-team": "Atlas Online Archive II"
}
},
Expand Down Expand Up @@ -23654,7 +23651,10 @@
"x-xgen-hidden-env": {
"envs": "qa,prod"
},
"x-xgen-owner-team": "Atlas Serverless II"
"x-xgen-owner-team": "Atlas Serverless II",
"x-xgen-changelog": {
"2025-03-02": "Changelog test entry."
}
},
"patch": {
"tags": ["USS Instances"],
Expand Down Expand Up @@ -26028,9 +26028,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleaning up x-xgen-changelog in most tests, but adding it to one of the endpoints

"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"post": {
Expand Down Expand Up @@ -26099,9 +26096,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
}
},
Expand Down Expand Up @@ -26152,9 +26146,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"post": {
Expand Down Expand Up @@ -26211,9 +26202,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
}
},
Expand Down Expand Up @@ -26276,9 +26264,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"delete": {
Expand Down Expand Up @@ -26345,9 +26330,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"patch": {
Expand Down Expand Up @@ -26428,9 +26410,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
}
},
Expand Down Expand Up @@ -26495,9 +26474,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"delete": {
Expand Down Expand Up @@ -26555,9 +26531,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
},
"patch": {
Expand Down Expand Up @@ -26629,9 +26602,6 @@
"DigestAuth": []
}
],
"x-xgen-changelog": {
"2023-09-11": "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
},
"x-xgen-owner-team": "Atlas Streams"
}
},
Expand Down
3 changes: 3 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2025-01-01.json
Original file line number Diff line number Diff line change
Expand Up @@ -19542,6 +19542,9 @@
"security" : [ {
"DigestAuth" : [ ]
} ],
"x-xgen-changelog": {
"2025-03-02": "Changelog test entry."
},
"summary" : "Remove One USS Instance from One Project",
"tags" : [ "USS Instances" ]
},
Expand Down
2 changes: 2 additions & 0 deletions tools/cli/test/data/split/dev/openapi-v2-2025-01-01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15892,6 +15892,8 @@ paths:
security:
- DigestAuth: []
summary: Remove One USS Instance from One Project
x-xgen-changelog:
"2025-03-02": Changelog test entry.
tags:
- USS Instances
get:
Expand Down
58 changes: 14 additions & 44 deletions tools/cli/test/data/split/dev/openapi-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -6985,10 +6985,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Create One Online Archive",
"tags" : [ "Online Archive" ],
"x-xgen-changelog" : {
"2023-08-02" : "If 'criteria':'DATE' is specified, then you must specify 'DATE' values in partition fields"
}
"tags" : [ "Online Archive" ]
}
},
"/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz" : {
Expand Down Expand Up @@ -18176,10 +18173,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Return All Project Stream Instances",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"post" : {
"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.",
Expand Down Expand Up @@ -18228,10 +18222,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Create One Stream Instance",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
}
},
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}" : {
Expand Down Expand Up @@ -18282,10 +18273,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Delete One Stream Instance",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"get" : {
"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.",
Expand Down Expand Up @@ -18339,10 +18327,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Return One Stream Instance",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"patch" : {
"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.",
Expand Down Expand Up @@ -18405,10 +18390,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Update One Stream Instance",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
}
},
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/auditLogs" : {
Expand Down Expand Up @@ -18537,10 +18519,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Return All Connections Of The Stream Instances",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"post" : {
"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.",
Expand Down Expand Up @@ -18600,10 +18579,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Create One Connection",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
}
},
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/connections/{connectionName}" : {
Expand Down Expand Up @@ -18662,10 +18638,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Delete One Stream Connection",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"get" : {
"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.",
Expand Down Expand Up @@ -18717,10 +18690,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Return One Stream Connection",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
},
"patch" : {
"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.",
Expand Down Expand Up @@ -18791,10 +18761,7 @@
"DigestAuth" : [ ]
} ],
"summary" : "Update One Stream Connection",
"tags" : [ "Streams" ],
"x-xgen-changelog" : {
"2023-09-11" : "The MongoDB Atlas Streams Processing API is now exposed as part of private preview, but is subject to change until GA."
}
"tags" : [ "Streams" ]
}
},
"/api/atlas/v2/groups/{groupId}/streams/{tenantName}/processor" : {
Expand Down Expand Up @@ -19964,6 +19931,9 @@
"security" : [ {
"DigestAuth" : [ ]
} ],
"x-xgen-changelog": {
"2025-03-02": "Changelog test entry."
},
"summary" : "Remove One USS Instance from One Project",
"tags" : [ "USS Instances" ]
},
Expand Down
Loading
Loading