Skip to content

refactor!: chart naming and expose other useful library functions - #5107

Open
Racer159 wants to merge 14 commits into
zarf-dev:mainfrom
Racer159:chore/expose-more-library-functions
Open

refactor!: chart naming and expose other useful library functions#5107
Racer159 wants to merge 14 commits into
zarf-dev:mainfrom
Racer159:chore/expose-more-library-functions

Conversation

@Racer159

@Racer159 Racer159 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

This exposes some additional functions to help library users normalize logic with Zarf. These changes include:

  1. Extract chart/values pathing into the layout package so that others can use it - this also disambiguates the layout/naming responsibilities between helm and layout making layout the package that defines it for Zarf packages.
  2. Expose the ResolvePlainHTTP logic so that callers can match how Zarf determines this if they want to interact with the Zarf registry directly.
  3. Expose CRCTag on its own so that callers can resolve the canonical tag name Zarf uses when pushing images to the registry (without needing to strip it from the full registry transform).
  4. Expose ServiceInfoFromNodePortURL so that callers can follow the same logic Zarf uses to interpret what K8s service is tied to a nodeport URL.
  5. Refactor AssembleLayers and associated functions to use content.Fetcher from ORAS to allow other implementers of that interface (e.g. Zarf's layout) to be used there.

Caution

Breaking library changes:

  1. cluster.Registry{Server,Client}TLSSecret and cluster.RegistrySecret{CA,Cert,Key}Path
    moved to state
    . Values are byte-identical; only the package changed.
  2. layout.PackageChart signature changed:
    (ctx, chart, packagePath, chartPath, valuesFilePath, cachePath string, remoteOpts) ->
    (ctx, chart, packagePath string, paths ChartPaths, cachePath string, remoteOpts).
    Two path strings collapsed into one ChartPaths - requires some changes but should also
    break compilers to highlight the change.
  3. layout.AssemblePackage (and associated functions) moved to assemble.AssemblePackage

Related Issue

Fixes #4047
Fixes #4518
Relates to #5096
Relates to #5097

Checklist before merging

@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploy Preview for zarf-docs canceled.

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

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.04839% with 47 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pkg/zoci/pull.go 63.63% 10 Missing and 2 partials ⚠️
src/pkg/packager/layout/oci.go 61.53% 10 Missing ⚠️
src/cmd/dev.go 0.00% 6 Missing ⚠️
src/pkg/packager/assemble/assemble.go 91.11% 3 Missing and 1 partial ⚠️
src/pkg/zoci/fetch.go 60.00% 3 Missing and 1 partial ⚠️
src/pkg/images/push.go 66.66% 1 Missing and 1 partial ⚠️
src/pkg/packager/assemble/sbom.go 60.00% 2 Missing ⚠️
src/pkg/packager/dev.go 0.00% 2 Missing ⚠️
src/pkg/packager/inspect.go 66.66% 0 Missing and 2 partials ⚠️
src/pkg/cluster/tunnel.go 91.66% 1 Missing ⚠️
... and 2 more
Files with missing lines Coverage Δ
src/internal/agent/hooks/flux-helmrepo.go 73.91% <100.00%> (ø)
src/internal/agent/hooks/flux-ocirepo.go 81.75% <100.00%> (ø)
src/internal/dns/dns.go 85.36% <100.00%> (-3.10%) ⬇️
src/internal/packager/helm/chart.go 1.14% <100.00%> (ø)
src/internal/packager/helm/common.go 40.44% <100.00%> (-4.11%) ⬇️
src/internal/packager/helm/repo.go 60.23% <100.00%> (-0.12%) ⬇️
src/pkg/cluster/cluster.go 50.58% <100.00%> (-1.44%) ⬇️
src/pkg/cluster/secrets.go 61.98% <100.00%> (ø)
src/pkg/images/pull.go 46.36% <100.00%> (ø)
src/pkg/packager/create.go 54.08% <100.00%> (ø)
... and 18 more

... 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.

@Racer159
Racer159 force-pushed the chore/expose-more-library-functions branch from 29af83c to 9000b66 Compare July 24, 2026 01:14
Racer159 added 2 commits July 24, 2026 18:53
Signed-off-by: Wayne Starr <me@racer159.com>
…ePortURL

Signed-off-by: Wayne Starr <me@racer159.com>
@Racer159
Racer159 force-pushed the chore/expose-more-library-functions branch from 3ec9679 to 7dc7965 Compare July 25, 2026 01:36
@Racer159
Racer159 marked this pull request as ready for review July 27, 2026 17:16
@Racer159
Racer159 requested review from a team as code owners July 27, 2026 17:16

@AustinAbro321 AustinAbro321 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.

Overall design mostly looks good, as well as a few QOL fixes. Requesting changes on the Helm interface

Comment thread src/pkg/packager/layout/layout.go Outdated
Comment thread src/internal/packager/helm/common.go Outdated
@github-project-automation github-project-automation Bot moved this to In progress in Zarf Jul 27, 2026
@AustinAbro321

Copy link
Copy Markdown
Member

@Racer159 Could you rename this PR to begin with "refactor" instead of Chore. Also if there are any breaking changes to public exported function signatures, please call them out in the description and add a ! to refactor.

@Racer159 Racer159 changed the title chore: refactor chart naming and expose other useful library functions refactor: chart naming and expose other useful library functions Jul 27, 2026
Signed-off-by: Wayne Starr <me@racer159.com>
@Racer159 Racer159 changed the title refactor: chart naming and expose other useful library functions refactor!: chart naming and expose other useful library functions Jul 27, 2026
Racer159 and others added 3 commits July 27, 2026 15:27
Signed-off-by: Wayne Starr <me@racer159.com>
Signed-off-by: Wayne Starr <me@racer159.com>
@Racer159
Racer159 force-pushed the chore/expose-more-library-functions branch from e415266 to 3df4592 Compare July 27, 2026 22:12
@Racer159
Racer159 requested a review from AustinAbro321 July 28, 2026 05:19

@AustinAbro321 AustinAbro321 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.

Some minor asks, design looks good

Comment thread src/pkg/packager/assemble/assemble_external_test.go Outdated
Comment thread src/pkg/packager/layout/package_test.go
Racer159 and others added 2 commits July 28, 2026 10:09
@Racer159
Racer159 requested a review from AustinAbro321 July 28, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

2 participants