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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
**/*metric-collection-results.parquet
**/*spectral-output.txt
**/*spectral-report.xml
tools/go.work.sum
4 changes: 2 additions & 2 deletions tools/cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.26
toolchain go1.26.0

require (
github.com/getkin/kin-openapi v0.135.0
github.com/iancoleman/strcase v0.3.0
github.com/oasdiff/kin-openapi v0.136.10
github.com/oasdiff/oasdiff v1.13.1
github.com/oasdiff/oasdiff v1.14.0
github.com/spf13/afero v1.15.0
github.com/spf13/cobra v1.10.2
github.com/stretchr/testify v1.11.1
Expand Down
8 changes: 4 additions & 4 deletions tools/cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6N
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/getkin/kin-openapi v0.135.0 h1:751SjYfbiwqukYuVjwYEIKNfrSwS5YpA7DZnKSwQgtg=
github.com/getkin/kin-openapi v0.135.0/go.mod h1:6dd5FJl6RdX4usBtFBaQhk9q62Yb2J0Mk5IhUO/QqFI=
github.com/go-openapi/jsonpointer v0.22.5 h1:8on/0Yp4uTb9f4XvTrM2+1CPrV05QPZXu+rvu2o9jcA=
github.com/go-openapi/jsonpointer v0.22.5/go.mod h1:gyUR3sCvGSWchA2sUBJGluYMbe1zazrYWIkWPjjMUY0=
github.com/go-openapi/swag/jsonname v0.25.5 h1:8p150i44rv/Drip4vWI3kGi9+4W9TdI3US3uUYSFhSo=
Expand Down Expand Up @@ -33,10 +35,8 @@ github.com/mailru/easyjson v0.9.2 h1:dX8U45hQsZpxd80nLvDGihsQ/OxlvTkVUXH2r/8cb2M
github.com/mailru/easyjson v0.9.2/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw=
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/oasdiff/kin-openapi v0.136.10 h1:3vKm43dfhRvJerEyijS74bLwLxE7ItB0caMJl+IjGA0=
github.com/oasdiff/kin-openapi v0.136.10/go.mod h1:E7LUU2UyOHENK+Mhu7stMOtUA41LJRp5sFAW+L1Ier4=
github.com/oasdiff/oasdiff v1.13.1 h1:mvEv09sUT0V4926Q+1cwurEYvzV/Lj6d54xINIxcvHA=
github.com/oasdiff/oasdiff v1.13.1/go.mod h1:ZUEb4bzuo+fpHWGLO7f+++Vq7oV2IBgVC9KDRn/z3IA=
github.com/oasdiff/oasdiff v1.14.0 h1:R9nDNGHDoBpPUs/TthVDHGsJ63mnlL/vWUo252RRCgo=
github.com/oasdiff/oasdiff v1.14.0/go.mod h1:9Im1HSDZzkao0yWGiy/Crr6cPvUvPBiCRxzVtHtqIKA=
github.com/oasdiff/yaml v0.0.9 h1:zQOvd2UKoozsSsAknnWoDJlSK4lC0mpmjfDsfqNwX48=
github.com/oasdiff/yaml v0.0.9/go.mod h1:8lvhgJG4xiKPj3HN5lDow4jZHPlx1i7dIwzkdAo6oAM=
github.com/oasdiff/yaml3 v0.0.9 h1:rWPrKccrdUm8J0F3sGuU+fuh9+1K/RdJlWF7O/9yw2g=
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/internal/apiversion/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strings"
Comment thread
andreaangiolillo marked this conversation as resolved.
"time"

"github.com/oasdiff/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/openapi3"
Comment thread
andreaangiolillo marked this conversation as resolved.
)

type APIVersion struct {
Expand Down
2 changes: 1 addition & 1 deletion tools/cli/internal/apiversion/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"testing"
"time"

"github.com/oasdiff/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/openapi3"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
19 changes: 11 additions & 8 deletions tools/cli/internal/changelog/outputfilter/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,51 +6,54 @@ const (
)

// squashRequestPropertyEnumValueAdded squashes oasdiff entries with id: "response-property-enum-value-added"
// Message format: "added the new 'DUBLIN_IRL' enum value to the '/items/dataProcessRegion/region' response property".
// Message format (oasdiff v1.14.0+): "added the new `VALUE` enum value to the `/path/to/property`
// response property for the response status `200`".
func squashResponsePropertyEnumValueAdded(entriesGroupedByOperationID map[string][]*OasDiffEntry) ([]*OasDiffEntry, error) {
return squashEntriesByValues(
"response-property-enum-value-added",
entriesGroupedByOperationID,
2,
3,
0,
enumSingularForm,
enumPluralForm,
)
}

// squashResponsePropertyEnumValueRemoved squashes oasdiff entries with id: "response-property-enum-value-removed"
// Message format: "removed the 'DUBLIN_IRL' enum value from the '/items/dataProcessRegion/region' response property".
// Message format (oasdiff v1.14.0+): "removed the `VALUE` enum value from the `/path/to/property`
// response property for the response status `200`".
func squashResponsePropertyEnumValueRemoved(entriesGroupedByOperationID map[string][]*OasDiffEntry) ([]*OasDiffEntry, error) {
return squashEntriesByValues(
"response-property-enum-value-removed",
entriesGroupedByOperationID,
2,
3,
0,
enumSingularForm,
enumPluralForm,
)
}

// squashResponseMediatypeEnumValueRemoved squashes oasdiff entries with id: "response-mediatype-enum-value-removed"
// Message format: "response schema application/json enum value removed from 'DUBLIN_IRL'".
// Message format (oasdiff v1.14.0+): "response schema `application/json` enum value removed `DUBLIN_IRL`".
func squashResponseMediatypeEnumValueRemoved(entriesGroupedByOperationID map[string][]*OasDiffEntry) ([]*OasDiffEntry, error) {
return squashEntriesByValues(
"response-mediatype-enum-value-removed",
entriesGroupedByOperationID,
2,
Comment thread
andreaangiolillo marked this conversation as resolved.
1,
0,
enumSingularForm,
enumPluralForm,
)
}

// squashResponseWriteOnlyPropertyEnumValueAdded squashes oasdiff entries with id: "response-write-only-property-enum-value-added"
// Message format: "added the new 'DUBLIN_IRL' enum value to the '/items/dataProcessRegion/region' response write-only property",.
// Message format (oasdiff v1.14.0+): "added the new `VALUE` enum value to the `/path/to/property`
// response write-only property for the response status `200`".
func squashResponseWriteOnlyPropertyEnumValueAdded(entriesGroupedByOperationID map[string][]*OasDiffEntry) ([]*OasDiffEntry, error) {
return squashEntriesByValues(
"response-write-only-property-enum-value-added",
entriesGroupedByOperationID,
2,
3,
0,
enumSingularForm,
enumPluralForm,
Expand Down
62 changes: 31 additions & 31 deletions tools/cli/internal/changelog/outputfilter/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,161 +19,161 @@ func TestSquash(t *testing.T) {
entries: []*OasDiffEntry{
{
ID: "response-write-only-property-enum-value-added",
Text: "added the new 'DUBLIN_IRL' enum value to the '/items/dataProcessRegion/region' response write-only property",
Text: "added the new `DUBLIN_IRL` enum value to the `/items/dataProcessRegion/region` response write-only property for the response status `200`", //nolint:lll //Test string
Operation: "POST",
OperationID: "CreateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-write-only-property-enum-value-added",
Text: "added the new 'TEST' enum value to the '/items/dataProcessRegion/region' response write-only property",
Text: "added the new `TEST` enum value to the `/items/dataProcessRegion/region` response write-only property for the response status `200`", //nolint:lll //Test string
Operation: "POST",
OperationID: "CreateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-body-enum-value-removed",
Text: "request body enum value removed 'DUBLIN_IRL'",
Text: "request body enum value removed `DUBLIN_IRL`",
Operation: "POST",
OperationID: "CreateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-body-enum-value-removed",
Text: "request body enum value removed 'TEST'",
Text: "request body enum value removed `TEST`",
Operation: "POST",
OperationID: "CreateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-parameter-enum-value-added",
Text: "added the new enum value 'AVAILABLE' from the 'query' request parameter 'status'",
Text: "added the new enum value `AVAILABLE` to the `query` request parameter `status`",
Operation: "GET",
OperationID: "getClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-parameter-enum-value-added",
Text: "added the new enum value 'WAITING' from the 'query' request parameter 'status'",
Text: "added the new enum value `WAITING` to the `query` request parameter `status`",
Operation: "GET",
OperationID: "getClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-parameter-enum-value-removed",
Text: "removed the enum value 'AVAILABLE' from the 'query' request parameter 'status'",
Text: "removed the enum value `AVAILABLE` from the `query` request parameter `status`",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-parameter-enum-value-removed",
Text: "removed the enum value 'WAITING' from the 'query' request parameter 'status'",
Text: "removed the enum value `WAITING` from the `query` request parameter `status`",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-mediatype-enum-value-removed",
Text: "response schema application/json enum value removed from 'DUBLIN_IRL'",
Text: "response schema `application/json` enum value removed `DUBLIN_IRL`",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-mediatype-enum-value-removed",
Text: "response schema application/json enum value removed from 'TEST'",
Text: "response schema `application/json` enum value removed `TEST`",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-property-enum-value-removed",
Text: "removed the 'linearizable' enum value from the 'defaultReadConcern' response property",
Text: "removed the `linearizable` enum value from the `defaultReadConcern` response property",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-property-enum-value-removed",
Text: "removed the 'majority' enum value from the 'defaultReadConcern' response property",
Text: "removed the `majority` enum value from the `defaultReadConcern` response property",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-property-enum-value-removed",
Text: "removed the 'snapshot' enum value from the 'defaultReadConcern' response property",
Text: "removed the `snapshot` enum value from the `defaultReadConcern` response property",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "request-property-enum-value-added",
Text: "added the new 'CREATE_STREAM_PROCESSOR' enum value to the 'actions/items/action' request property",
Text: "added the new `CREATE_STREAM_PROCESSOR` enum value to the `actions/items/action` request property",
Operation: "POST",
OperationID: "createCustomDatabaseRole",
Path: "/api/atlas/v2/groups/{groupId}/customDBRoles/roles",
},
{
ID: "request-property-enum-value-added",
Text: "added the new 'DROP_STREAM_PROCESSOR' enum value to the 'actions/items/action' request property",
Text: "added the new `DROP_STREAM_PROCESSOR` enum value to the `actions/items/action` request property",
Operation: "POST",
OperationID: "createCustomDatabaseRole",
Path: "/api/atlas/v2/groups/{groupId}/customDBRoles/roles",
},
{
ID: "request-property-enum-value-added",
Text: "added the new 'GET_STREAM_PROCESSOR' enum value to the 'actions/items/action' request property",
Text: "added the new `GET_STREAM_PROCESSOR` enum value to the `actions/items/action` request property",
Operation: "POST",
OperationID: "createCustomDatabaseRole",
Path: "/api/atlas/v2/groups/{groupId}/customDBRoles/roles",
},
{
ID: "request-property-enum-value-added",
Text: "added the new 'GET_STREAM_PROCESSOR' enum value to the 'actions/items/action' request property",
Text: "added the new `GET_STREAM_PROCESSOR` enum value to the `actions/items/action` request property",
Operation: "GET",
OperationID: "getCustomDatabaseRole",
Path: "/api/atlas/v2/groups/{groupId}/customDBRoles/roles",
},
{
ID: "response-property-enum-value-removed",
Text: "removed the 'linearizable' enum value from the 'defaultReadConcern' response property",
Text: "removed the `linearizable` enum value from the `defaultReadConcern` response property for the response status `200`",
Operation: "GET",
OperationID: "listConnectgetClusterAdvancedConfigurationedOrgConfigs",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-property-enum-value-removed",
Text: "removed the 'majority' enum value from the 'defaultReadConcern' response property",
Text: "removed the `majority` enum value from the `defaultReadConcern` response property for the response status `200`",
Operation: "GET",
OperationID: "listConnectgetClusterAdvancedConfigurationedOrgConfigs",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-property-enum-value-removed",
Text: "removed the 'snapshot' enum value from the 'defaultReadConcern' response property",
Text: "removed the `snapshot` enum value from the `defaultReadConcern` response property for the response status `200`",
Operation: "GET",
OperationID: "listConnectgetClusterAdvancedConfigurationedOrgConfigs",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-property-enum-value-added",
Text: "added the new 'GLOBAL_EVENT_ADMIN' enum value to the 'items' response property",
Text: "added the new `GLOBAL_EVENT_ADMIN` enum value to the `items` response property for the response status `200`",
Operation: "GET",
OperationID: "listConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
},
{
ID: "response-property-enum-value-added",
Text: "added the new 'ORG_MEMBER' enum value to the 'items' response property",
Text: "added the new `ORG_MEMBER` enum value to the `items` response property for the response status `200`",
Operation: "GET",
OperationID: "listConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
},
{
ID: "response-property-enum-value-added",
Text: "added the new 'ORG_MEMBER' enum value to the 'items' response property",
Text: "added the new `ORG_MEMBER` enum value to the `items` response property for the response status `200`",
Operation: "POST",
OperationID: "setConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
Expand All @@ -182,7 +182,7 @@ func TestSquash(t *testing.T) {
expectedEntries: []*OasDiffEntry{
{
ID: "response-write-only-property-enum-value-added",
Text: "added the new 'DUBLIN_IRL, TEST' enum values to the '/items/dataProcessRegion/region' response write-only property",
Text: "added the new 'DUBLIN_IRL, TEST' enum values to the '/items/dataProcessRegion/region' response write-only property for the response status '200'", //nolint:lll //Test string
Operation: "POST",
OperationID: "CreateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
Expand All @@ -196,7 +196,7 @@ func TestSquash(t *testing.T) {
},
{
ID: "request-parameter-enum-value-added",
Text: "added the new enum values 'AVAILABLE, WAITING' from the 'query' request parameter 'status'",
Text: "added the new enum values 'AVAILABLE, WAITING' to the 'query' request parameter 'status'",
Operation: "GET",
OperationID: "getClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
Expand All @@ -210,7 +210,7 @@ func TestSquash(t *testing.T) {
},
{
ID: "response-mediatype-enum-value-removed",
Text: "response schema application/json enum values removed from 'DUBLIN_IRL, TEST'",
Text: "response schema 'application/json' enum values removed 'DUBLIN_IRL, TEST'",
Operation: "PATCH",
OperationID: "updateClusterAdvancedConfiguration",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
Expand Down Expand Up @@ -238,21 +238,21 @@ func TestSquash(t *testing.T) {
},
{
ID: "response-property-enum-value-removed",
Text: "removed the 'linearizable, majority, snapshot' enum values from the 'defaultReadConcern' response property",
Text: "removed the 'linearizable, majority, snapshot' enum values from the 'defaultReadConcern' response property for the response status '200'", //nolint:lll //Test string
Operation: "GET",
OperationID: "listConnectgetClusterAdvancedConfigurationedOrgConfigs",
Path: "/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/processArgs",
},
{
ID: "response-property-enum-value-added",
Text: "added the new 'GLOBAL_EVENT_ADMIN, ORG_MEMBER' enum values to the 'items' response property",
Text: "added the new 'GLOBAL_EVENT_ADMIN, ORG_MEMBER' enum values to the 'items' response property for the response status '200'",
Operation: "GET",
OperationID: "listConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
},
{
ID: "response-property-enum-value-added",
Text: "added the new 'ORG_MEMBER' enum value to the 'items' response property",
Text: "added the new 'ORG_MEMBER' enum value to the 'items' response property for the response status '200'",
Operation: "POST",
OperationID: "setConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
Expand All @@ -265,8 +265,8 @@ func TestSquash(t *testing.T) {
entries: []*OasDiffEntry{
{
ID: "response-property-enum-value-added",
// # the field is not between apostrophes
Text: "added the new GLOBAL_EVENT_ADMIN enum value to the 'items' response propert",
// # the field is not between backticks
Text: "added the new GLOBAL_EVENT_ADMIN enum value to the `items` response propert",
Operation: "POST",
OperationID: "createConnectedOrgConfigs",
Path: "/api/atlas/v2/federationSettings/{federationSettingsId}/connectedOrgConfigs",
Expand Down
Loading
Loading