Skip to content

Commit 12391d9

Browse files
darkeriossssMichaelMraka
authored andcommitted
RHINENG-15783: remove baselines api
1 parent fa5baeb commit 12391d9

24 files changed

Lines changed: 182 additions & 3843 deletions

base/deprecations/deprecations.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package deprecations
22

33
import (
44
"app/base/utils"
5-
"strings"
65
"time"
76

87
"github.com/gin-gonic/gin"
@@ -22,15 +21,3 @@ func DeprecateLimit() Deprecation {
2221
},
2322
}
2423
}
25-
26-
// Deprecate baselines api
27-
func DeprecateBaselines() Deprecation {
28-
return apiDeprecation{
29-
deprecationTimestamp: time.Date(2025, 3, 1, 0, 0, 0, 0, time.UTC),
30-
message: "baselines are deprecated - https://access.redhat.com/articles/7097146",
31-
shouldDeprecate: func(c *gin.Context) bool {
32-
handlerName := c.HandlerName()
33-
return strings.Contains(strings.ToLower(handlerName), "baseline")
34-
},
35-
}
36-
}

docs/docs.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ type openapiData struct {
3232
}
3333

3434
type EndpointsConfig struct {
35-
EnableBaselines bool
3635
EnableTemplates bool
3736
}
3837

@@ -81,10 +80,6 @@ func filterOpenAPI(config EndpointsConfig, inputOpenapiPath, outputOpenapiPath s
8180

8281
filteredPaths := openapi3.Paths{}
8382
for path := range sw.Paths.Map() {
84-
if !config.EnableBaselines && strings.Contains(path, "/baselines") {
85-
removedPaths++
86-
continue
87-
}
8883
if !config.EnableTemplates && strings.Contains(path, "/templates") {
8984
removedPaths++
9085
continue

docs/docs_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@ func TestValidateOpenAPI3DocStr(t *testing.T) {
1919

2020
func TestFilterOpenAPIPaths1(t *testing.T) {
2121
nRemovedPaths := filterOpenAPI(EndpointsConfig{
22-
EnableBaselines: true,
2322
EnableTemplates: true,
2423
}, openAPIPath, "/tmp/openapi-filter-test.json")
2524
assert.Equal(t, 0, nRemovedPaths)
2625
}
2726

2827
func TestFilterOpenAPIPaths2(t *testing.T) {
2928
nRemovedPaths := filterOpenAPI(EndpointsConfig{
30-
EnableBaselines: false,
3129
EnableTemplates: false,
3230
}, openAPIPath, "/tmp/openapi-filter-test.json")
33-
assert.Equal(t, 12, nRemovedPaths)
31+
assert.Equal(t, 6, nRemovedPaths)
3432
}

0 commit comments

Comments
 (0)