Skip to content

Conversation

@AustinAbro321
Copy link
Member

@AustinAbro321 AustinAbro321 commented Nov 20, 2025

Description

Adds the ability to store documentation under the documentation key which is a map[string]string. Stores documentation files in the package by their base filename.

I decided not to include documentation from imported packages. If a user wants documentation from a package they are importing, it should be simple enough to copy that file and import the file separately, and I believe there are situations where documentation for an imported package, wouldn't make sense in the parent package.

Currently this feature does not allow pulling in remote files, I'd be open to adding this in the future if someone presents a use case.

One neat thing I learned is that if a user tries to define the same key twice in a yaml map then we will error, so no additional validation was needed for that.

Related Issue

Fixes #4346

Checklist before merging

Signed-off-by: Austin Abro <[email protected]>
@netlify
Copy link

netlify bot commented Nov 20, 2025

Deploy Preview for zarf-docs canceled.

Name Link
🔨 Latest commit 53265b2
🔍 Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/692f2ee3308e240008d5a3d1

@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 73.60000% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/package.go 77.77% 9 Missing and 3 partials ⚠️
src/pkg/packager/layout/assemble.go 42.10% 8 Missing and 3 partials ⚠️
src/pkg/packager/layout/package.go 74.28% 6 Missing and 3 partials ⚠️
src/pkg/zoci/pull.go 94.11% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/api/v1alpha1/package.go 32.55% <ø> (ø)
src/pkg/zoci/common.go 56.00% <ø> (ø)
src/pkg/zoci/pull.go 61.04% <94.11%> (+3.99%) ⬆️
src/pkg/packager/layout/package.go 58.67% <74.28%> (+1.46%) ⬆️
src/pkg/packager/layout/assemble.go 42.61% <42.10%> (+0.21%) ⬆️
src/cmd/package.go 39.51% <77.77%> (+1.34%) ⬆️

... and 10 files 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.

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
@AustinAbro321 AustinAbro321 marked this pull request as ready for review December 1, 2025 17:44
@AustinAbro321 AustinAbro321 requested review from a team as code owners December 1, 2025 17:44
@AustinAbro321 AustinAbro321 moved this to PR Review in Zarf Dec 1, 2025
@AustinAbro321 AustinAbro321 force-pushed the add-documentation branch 2 times, most recently from 8672668 to 017bb1a Compare December 1, 2025 18:30
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

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

Couple passing thoughts but otherwise clean and straight-forward.

description: Simple example to load classic DOS games into K8s in the airgap
version: 1.2.0

# The documentation key can be utilized to pass information to package consumers
Copy link
Member

Choose a reason for hiding this comment

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

Does this addition warrant bumping the package version (and possibly publishing)?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we had a smoother workflow I think potentially, but currently it requires running a workflow to update the new version then updating our e2e tests that pull this package to use the new version, which can be cumbersome.

return err
}

func validateDocumentation(documentation map[string]string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Reasonable stance to take - though I can imagine we will see few examples in the future.

This stance is based on the storage mechanism in the package based on the assemble logic... Is it worth considering a broader copy strategy that prepends the key in order to establish more uniqueness?

Copy link
Member Author

Choose a reason for hiding this comment

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

My consideration was more so for the user when they get their documents. Keeping them unique makes it so their files are the same name when they read them. Though it is still probably best to prepend the filename with the key.

Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
Signed-off-by: Austin Abro <[email protected]>
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.

Support for zarf package reports/documentation

3 participants