Skip to content

Conversation

@mkcp
Copy link
Contributor

@mkcp mkcp commented Oct 9, 2025

Description

This PR adds support for json schema validation of values both at create and deploy time.

More tangetially, it also adds in a schema check on the v1alpha1 struct for ZarfChartValue mappings, ensuring they start with a ., are provided as . segmented sections, and are all valid characters for use in a golang string map.

Once #4268 is ready, I think it would make sense to do a schema validate there as well. Remove doesn't have access to the package value schema contents yet so adding it to remove would be more a of future concern.

Related Issue

Fixes #4225
Relates to #3946

Checklist before merging

mkcp added 30 commits September 29, 2025 13:12
Signed-off-by: Kit Patella <[email protected]>
…flags to package create,deploy and inspect cmds with --set

Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
…n using zarf to helm values mappings

Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
Signed-off-by: Kit Patella <[email protected]>
@mkcp mkcp changed the title feat(values): add schema validation at create and deploy time, tests, and example feat(values): add schema validation Oct 9, 2025
@mkcp mkcp marked this pull request as ready for review October 9, 2025 18:11
@mkcp mkcp requested review from a team as code owners October 9, 2025 18:11
Base automatically changed from mkcp/values to main October 16, 2025 20:17
mkcp added 2 commits October 22, 2025 16:57
Resolved merge conflicts across multiple files:
- src/api/v1alpha1/package.go: Updated schema comment
- src/api/v1alpha1/component.go: Kept jsonschema patterns
- src/internal/template/template.go: Used main's security improvements
- src/internal/feature/feature.go: Merged RegistryProxy and Values features
- src/internal/value/value.go: Added schema validation support
- src/cmd/package.go: Merged deploy options and values parsing
- src/pkg/packager/actions/actions.go: Merged template check and setValue handling
- src/pkg/packager/deploy.go: Added schema validation and ValuesDir paths
- src/pkg/packager/layout/assemble.go: Updated cosign v3, added schema file copying
- zarf.schema.json: Accepted main's version (to be regenerated)

Schema validation features preserved:
- Values.Validate() method with JSON schema support
- SchemaValidationError type
- Schema file copying during package assembly
- Values directory structure support
Signed-off-by: Kit Patella <[email protected]>
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 03c43c3
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/691e36e761f57600078f4cbe

@brandtkeller brandtkeller moved this to PR Review in Zarf Oct 24, 2025
@mkcp mkcp moved this from PR Review to In progress in Zarf Oct 27, 2025
@mkcp mkcp marked this pull request as draft October 27, 2025 15:25
@mkcp mkcp marked this pull request as ready for review October 30, 2025 15:59
Copy link
Member

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly a question of create vs deploy "required" enforcement

@mkcp mkcp moved this from In progress to PR Review in Zarf Nov 4, 2025
AustinAbro321
AustinAbro321 previously approved these changes Nov 5, 2025
Copy link
Member

@AustinAbro321 AustinAbro321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: PR Review

Development

Successfully merging this pull request may close these issues.

Implement JSON Schema validation for values files

3 participants