From 0be00b24a45790c8004ac8cc4ecb5ab05c2a3047 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 12 Nov 2024 11:57:07 +0000 Subject: [PATCH 1/4] CLOUDP-283505: Allow empty removals --- tools/cli/internal/changelog/outputfilter/squash.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cli/internal/changelog/outputfilter/squash.go b/tools/cli/internal/changelog/outputfilter/squash.go index ea429c26cd..28b7f8d21b 100644 --- a/tools/cli/internal/changelog/outputfilter/squash.go +++ b/tools/cli/internal/changelog/outputfilter/squash.go @@ -11,7 +11,8 @@ import ( var ( // identifierRegex matches text enclosed in single quotes. // Example: it'll match "value" from the string "added the new required request property 'value'". - identifierRegex = regexp.MustCompile(`'([^']+)'`) + // Example: it'll match "" and "/items/dataProcessRegion/region" from the string removed the '' enum value from the '/items/dataProcessRegion/region' response property. + identifierRegex = regexp.MustCompile(`'([^']*)'`) ) type SquashHandler interface { From bb53201d474ff2afeecb577e97edfedad3465098 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 12 Nov 2024 12:01:08 +0000 Subject: [PATCH 2/4] Lint --- tools/cli/internal/changelog/outputfilter/squash.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cli/internal/changelog/outputfilter/squash.go b/tools/cli/internal/changelog/outputfilter/squash.go index 28b7f8d21b..c7205855cd 100644 --- a/tools/cli/internal/changelog/outputfilter/squash.go +++ b/tools/cli/internal/changelog/outputfilter/squash.go @@ -11,7 +11,8 @@ import ( var ( // identifierRegex matches text enclosed in single quotes. // Example: it'll match "value" from the string "added the new required request property 'value'". - // Example: it'll match "" and "/items/dataProcessRegion/region" from the string removed the '' enum value from the '/items/dataProcessRegion/region' response property. + // Example: it'll match "" and "/items/dataProcessRegion/region" from the string + //"removed the '' enum value from the '/items/dataProcessRegion/region' response property". identifierRegex = regexp.MustCompile(`'([^']*)'`) ) From a22c1ab58a78d1628aef4601570a4650aa72c8bc Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 12 Nov 2024 12:02:23 +0000 Subject: [PATCH 3/4] Lint --- tools/cli/internal/changelog/outputfilter/squash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cli/internal/changelog/outputfilter/squash.go b/tools/cli/internal/changelog/outputfilter/squash.go index c7205855cd..75c0c6b635 100644 --- a/tools/cli/internal/changelog/outputfilter/squash.go +++ b/tools/cli/internal/changelog/outputfilter/squash.go @@ -12,7 +12,7 @@ var ( // identifierRegex matches text enclosed in single quotes. // Example: it'll match "value" from the string "added the new required request property 'value'". // Example: it'll match "" and "/items/dataProcessRegion/region" from the string - //"removed the '' enum value from the '/items/dataProcessRegion/region' response property". + // "removed the '' enum value from the '/items/dataProcessRegion/region' response property". identifierRegex = regexp.MustCompile(`'([^']*)'`) ) From 617e426730c95ff27048030f74ae738ed2f43234 Mon Sep 17 00:00:00 2001 From: Bianca Lisle Date: Tue, 12 Nov 2024 12:18:51 +0000 Subject: [PATCH 4/4] Add unit test --- .../internal/changelog/outputfilter/squash_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/cli/internal/changelog/outputfilter/squash_test.go b/tools/cli/internal/changelog/outputfilter/squash_test.go index a530aacb88..147ab6c451 100644 --- a/tools/cli/internal/changelog/outputfilter/squash_test.go +++ b/tools/cli/internal/changelog/outputfilter/squash_test.go @@ -139,6 +139,17 @@ func TestExtractExactValuesOrFail(t *testing.T) { want: []string{"GROUP_USER_ADMIN", "/items/roles/items/"}, wantErr: require.NoError, }, + { + name: "Multiple values with empty entries", + operation: "test", + entry: &OasDiffEntry{ + ID: "response-write-only-property-enum-value-added", + OperationID: "op1", + Text: "added the new '' enum value to the request property '/items/roles/items/'"}, + expectedNumberOfValues: 2, + want: []string{"", "/items/roles/items/"}, + wantErr: require.NoError, + }, { name: "Incorrect number of values", operation: "test",