Skip to content

Commit 8ce95c7

Browse files
authored
Remove category usage in tests, add deprecation (#49)
This was addressed in #45 but regressed in #46 after changes to the acceptance testing flow. Category is deprecated in the Cortex API and the provider will need an update to adopt the newer filtering approach. In the meantime, we just remove the feature from acceptance testing and mark it as deprecated.
1 parent 13e9e42 commit 8ce95c7

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

docs/resources/scorecard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,5 @@ Optional:
8484

8585
Optional:
8686

87-
- `category` (String) By default, Scorecards are evaluated against all services. You can specify the category as RESOURCE to evaluate a Scorecard against resources or DOMAIN to evaluate a Scorecard against domains.
87+
- `category` (String, Deprecated) By default, Scorecards are evaluated against all services. You can specify the category as RESOURCE to evaluate a Scorecard against resources or DOMAIN to evaluate a Scorecard against domains.
8888
- `query` (String) A CQL query that is run against the category; only entities matching this query will be evaluated by the Scorecard.

internal/provider/scorecard_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ func (r *ScorecardResource) Schema(ctx context.Context, req resource.SchemaReque
141141
"category": schema.StringAttribute{
142142
MarkdownDescription: "By default, Scorecards are evaluated against all services. You can specify the category as RESOURCE to evaluate a Scorecard against resources or DOMAIN to evaluate a Scorecard against domains.",
143143
Optional: true,
144+
DeprecationMessage: "`category` is deprecated and will be removed in a future release. Forthcoming filters will use the include/exclude functionality that is more commonly used",
144145
},
145146
"query": schema.StringAttribute{
146147
MarkdownDescription: "A CQL query that is run against the category; only entities matching this query will be evaluated by the Scorecard.",

internal/provider/scorecard_resource_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ resource %[1]q %[2]q {
127127
]
128128
}
129129
filter = {
130-
category = "SERVICE"
131130
query = "owners_is_set"
132131
}
133132
evaluation = {
@@ -220,7 +219,6 @@ func TestAccScorecardResourceComplete(t *testing.T) {
220219
resource.TestCheckResourceAttr(stub.ResourceFullName(), "ladder.levels.1.rank", "2"),
221220
resource.TestCheckResourceAttr(stub.ResourceFullName(), "ladder.levels.1.color", "#c3c3c3"),
222221

223-
resource.TestCheckResourceAttr(stub.ResourceFullName(), "filter.category", "SERVICE"),
224222
resource.TestCheckResourceAttr(stub.ResourceFullName(), "filter.query", "owners_is_set"),
225223

226224
resource.TestCheckResourceAttr(stub.ResourceFullName(), "evaluation.window", "24"),

0 commit comments

Comments
 (0)