diff --git a/docs/3-create-a-zarf-package/4-zarf-schema.md b/docs/3-create-a-zarf-package/4-zarf-schema.md index 1c17047ce2..b0659ede67 100644 --- a/docs/3-create-a-zarf-package/4-zarf-schema.md +++ b/docs/3-create-a-zarf-package/4-zarf-schema.md @@ -760,22 +760,6 @@ Must be one of: -
- - group - -  -
- -**Description:** Create a user selector field based on all components in the same group - -| | | -| -------- | -------- | -| **Type** | `string` | - -
-
-
import diff --git a/src/pkg/packager/deprecated/common.go b/src/pkg/packager/deprecated/common.go index 57474d047e..fdffb3ba71 100644 --- a/src/pkg/packager/deprecated/common.go +++ b/src/pkg/packager/deprecated/common.go @@ -5,6 +5,7 @@ package deprecated import ( + "fmt" "strings" "slices" @@ -67,6 +68,11 @@ func MigrateComponent(build types.ZarfBuildData, component types.ZarfComponent) } } + // Show a warning if the component contains a group as that has been deprecated and will be removed. + if component.Group != "" { + warnings = append(warnings, fmt.Sprintf("Component %s is using group which has been deprecated and will be removed in v1.0.0. Please migrate to another solution.", component.Name)) + } + // Future migrations here. return migratedComponent, warnings } diff --git a/src/test/e2e/01_component_choice_test.go b/src/test/e2e/01_component_choice_test.go index d22a16a5a0..9d5030b0c8 100644 --- a/src/test/e2e/01_component_choice_test.go +++ b/src/test/e2e/01_component_choice_test.go @@ -28,6 +28,7 @@ func TestComponentChoice(t *testing.T) { // We currently don't have a pattern to actually test the interactive prompt, so just testing automation for now stdOut, stdErr, err := e2e.Zarf("package", "deploy", path, "--components=first-choice,second-choice", "--confirm") require.Error(t, err, stdOut, stdErr) + require.Contains(t, stdErr, "Component first-choice is using group which has been deprecated", "output should show a warning for group being deprecated.") // Deploy a single choice and expect success stdOut, stdErr, err = e2e.Zarf("package", "deploy", path, "--components=first-choice", "--confirm") diff --git a/src/types/component.go b/src/types/component.go index b6d13055f7..89b8e00111 100644 --- a/src/types/component.go +++ b/src/types/component.go @@ -29,7 +29,7 @@ type ZarfComponent struct { // Key to match other components to produce a user selector field, used to create a BOOLEAN XOR for a set of components // Note: ignores default and required flags - Group string `json:"group,omitempty" jsonschema:"description=Create a user selector field based on all components in the same group"` + Group string `json:"group,omitempty" jsonschema:"description=[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0.,deprecated=true"` // (Deprecated) Path to cosign public key for signed online resources DeprecatedCosignKeyPath string `json:"cosignKeyPath,omitempty" jsonschema:"description=[Deprecated] Specify a path to a public key to validate signed online resources. This will be removed in Zarf v1.0.0.,deprecated=true"` diff --git a/src/ui/lib/api-types.ts b/src/ui/lib/api-types.ts index 63b4f1bd57..808d7e9ec5 100644 --- a/src/ui/lib/api-types.ts +++ b/src/ui/lib/api-types.ts @@ -310,7 +310,8 @@ export interface ZarfComponent { */ files?: ZarfFile[]; /** - * Create a user selector field based on all components in the same group + * [Deprecated] Create a user selector field based on all components in the same group. This + * will be removed in Zarf v1.0.0. */ group?: string; /** diff --git a/zarf.schema.json b/zarf.schema.json index 8b895b6bd8..483c37ea02 100644 --- a/zarf.schema.json +++ b/zarf.schema.json @@ -249,7 +249,7 @@ }, "group": { "type": "string", - "description": "Create a user selector field based on all components in the same group" + "description": "[Deprecated] Create a user selector field based on all components in the same group. This will be removed in Zarf v1.0.0." }, "cosignKeyPath": { "type": "string",