Skip to content

feat: add validation for api package - #5393

Merged
AustinAbro321 merged 99 commits into
mainfrom
add-validation-for-api-package
Sep 30, 2026
Merged

AustinAbro321 merged 99 commits into
mainfrom
add-validation-for-api-package

Conversation

@AustinAbro321

@AustinAbro321 AustinAbro321 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Description

Adds validation for cross schema types. I didn't add correctness validation for the fields such as which fields are required. I would be open to adding it if there is a request, but all built packages will go through the validation flow and I'd expect SDK users to go through the versioned API flows, which by nature can have higher fidelity validation.

Annotations were changed to not be set by v1beta1 metadata fields during conversion to be more in line with the model

Also sneaking in adding back the selector and target to api.Package, something I missed initially but I think makes for a cleaner runtime model.

Related Issue

Fixes #5383

Checklist before merging

Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
@netlify

netlify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit e4649db
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6abd1ac2fa1281000888997c

Signed-off-by: Austin Abro <austinabro321@gmail.com>
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.10526% with 50 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/api/validation.go 67.59% 24 Missing and 11 partials ⚠️
src/pkg/packager/assemble/assemble.go 14.28% 4 Missing and 2 partials ⚠️
src/internal/pkgcfg/pkgcfg.go 40.00% 2 Missing and 1 partial ⚠️
src/pkg/cluster/zarf.go 40.00% 2 Missing and 1 partial ⚠️
src/pkg/packager/remove.go 0.00% 3 Missing ⚠️
Files with missing lines Coverage Δ
src/internal/api/v1alpha1/convert.go 99.87% <100.00%> (+<0.01%) ⬆️
src/internal/api/v1beta1/convert.go 100.00% <100.00%> (ø)
src/pkg/packager/layout/package.go 69.66% <100.00%> (+0.14%) ⬆️
src/internal/pkgcfg/pkgcfg.go 80.14% <40.00%> (-1.68%) ⬇️
src/pkg/cluster/zarf.go 30.90% <40.00%> (-0.43%) ⬇️
src/pkg/packager/remove.go 0.00% <0.00%> (ø)
src/pkg/packager/assemble/assemble.go 51.72% <14.28%> (-0.36%) ⬇️
src/api/validation.go 67.59% <67.59%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

AustinAbro321 and others added 4 commits September 24, 2026 12:27
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
@AustinAbro321
AustinAbro321 marked this pull request as ready for review September 24, 2026 17:06
@AustinAbro321
AustinAbro321 requested review from a team as code owners September 24, 2026 17:06
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>

@brandtkeller brandtkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One core question and then a few random comments otherwise ready to approve.

Comment thread src/api/validation.go Resolved
Comment thread src/api/validation.go Resolved
Comment thread src/pkg/packager/remove.go Resolved
@github-project-automation github-project-automation Bot moved this to In progress in Zarf Sep 30, 2026

@brandtkeller brandtkeller left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@AustinAbro321
AustinAbro321 added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit cebc6ee Sep 30, 2026
31 checks passed
@AustinAbro321
AustinAbro321 deleted the add-validation-for-api-package branch September 30, 2026 20:19
sei-pearl pushed a commit to sei-pearl/zarf that referenced this pull request Oct 1, 2026
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Introduce validation for api.Package

2 participants