From 17ba7a0a685efbea7b53d73bd8e45800bd769f78 Mon Sep 17 00:00:00 2001 From: Aaron Wirick Date: Fri, 18 Apr 2025 14:56:42 -0700 Subject: [PATCH 1/2] Remove category usage in tests, add deprecation --- internal/provider/scorecard_resource.go | 1 + internal/provider/scorecard_resource_test.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/provider/scorecard_resource.go b/internal/provider/scorecard_resource.go index 4cd366d..4482a08 100644 --- a/internal/provider/scorecard_resource.go +++ b/internal/provider/scorecard_resource.go @@ -141,6 +141,7 @@ func (r *ScorecardResource) Schema(ctx context.Context, req resource.SchemaReque "category": schema.StringAttribute{ 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.", Optional: true, + 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", }, "query": schema.StringAttribute{ MarkdownDescription: "A CQL query that is run against the category; only entities matching this query will be evaluated by the Scorecard.", diff --git a/internal/provider/scorecard_resource_test.go b/internal/provider/scorecard_resource_test.go index 3b80de1..bcf8457 100644 --- a/internal/provider/scorecard_resource_test.go +++ b/internal/provider/scorecard_resource_test.go @@ -127,7 +127,6 @@ resource %[1]q %[2]q { ] } filter = { - category = "SERVICE" query = "owners_is_set" } evaluation = { @@ -220,7 +219,6 @@ func TestAccScorecardResourceComplete(t *testing.T) { resource.TestCheckResourceAttr(stub.ResourceFullName(), "ladder.levels.1.rank", "2"), resource.TestCheckResourceAttr(stub.ResourceFullName(), "ladder.levels.1.color", "#c3c3c3"), - resource.TestCheckResourceAttr(stub.ResourceFullName(), "filter.category", "SERVICE"), resource.TestCheckResourceAttr(stub.ResourceFullName(), "filter.query", "owners_is_set"), resource.TestCheckResourceAttr(stub.ResourceFullName(), "evaluation.window", "24"), From b9e7cbca7437858afd4f31d1dfecbbb93f97873e Mon Sep 17 00:00:00 2001 From: Aaron Wirick Date: Fri, 18 Apr 2025 15:08:33 -0700 Subject: [PATCH 2/2] Run `generate` --- docs/resources/scorecard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/resources/scorecard.md b/docs/resources/scorecard.md index 505a333..54b3aff 100644 --- a/docs/resources/scorecard.md +++ b/docs/resources/scorecard.md @@ -84,5 +84,5 @@ Optional: Optional: -- `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. +- `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. - `query` (String) A CQL query that is run against the category; only entities matching this query will be evaluated by the Scorecard.