Skip to content

feat!: removed deprecated SDK fields and bridges - #5615

Merged
brandtkeller merged 17 commits into
mainfrom
remove-deprecated-fields
Nov 8, 2026
Merged

brandtkeller merged 17 commits into
mainfrom
remove-deprecated-fields

Conversation

@AustinAbro321

@AustinAbro321 AustinAbro321 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Description

The v1.0 release gives us an opportunity to remove deprecated sdk fields.

Removed old state fields. Kept a bridge for reading old agent fields which have been replaced by an AgentInfo struct in v0.85.0, but removed the fields from state.

Added an automatic entry to GitServerMode which was introduced in v0.87.0 (should have already had this).

This also removes compatibility with older packages that have a different format. Packages created in v0.50.0 (March 20, 2025) are no longer compatible. (Crane->Oras annotations).

Removed some exported functions that are unused in Zarf and unlikely to be used by SDK consumers

I missed a few deprecated flags in an earlier PR:

  • The --output-directory flag on create which was replaced by --output
  • I originally didn't remove the --signing-key flags from zarf package publish for skeletons, but changed that stance since I realized that they can be signed using zarf package sign

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>
@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

βœ… Deploy Preview for zarf-docs ready!

Name Link
πŸ”¨ Latest commit 9be0daa
πŸ” Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6aee3c2fdba4fc908b490a57
😎 Deploy Preview https://deploy-preview-5615--zarf-docs.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 65.11628% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/cmd/package.go 0.00% 11 Missing ⚠️
src/cmd/viper.go 58.33% 4 Missing and 1 partial ⚠️
src/cmd/dev.go 0.00% 3 Missing ⚠️
src/internal/git/repository.go 0.00% 1 Missing and 1 partial ⚠️
src/pkg/packager/deploy.go 0.00% 2 Missing ⚠️
src/pkg/packager/load/import.go 0.00% 2 Missing ⚠️
src/cmd/connect.go 0.00% 1 Missing ⚠️
src/cmd/zarf_tools.go 50.00% 1 Missing ⚠️
src/pkg/cluster/cluster.go 95.83% 1 Missing ⚠️
src/pkg/packager/assemble/assemble.go 0.00% 0 Missing and 1 partial ⚠️
... and 1 more
Files with missing lines Coverage Ξ”
src/cmd/table.go 76.19% <100.00%> (ΓΈ)
src/internal/agent/operations/patch.go 100.00% <ΓΈ> (+58.62%) ⬆️
src/internal/packager/template/template.go 90.80% <ΓΈ> (-0.11%) ⬇️
src/pkg/component/publish.go 58.02% <100.00%> (ΓΈ)
src/pkg/images/common.go 62.05% <ΓΈ> (+0.88%) ⬆️
src/pkg/images/push.go 50.49% <ΓΈ> (-0.63%) ⬇️
src/pkg/logger/logger.go 55.00% <ΓΈ> (ΓΈ)
src/pkg/message/message.go 93.18% <100.00%> (+3.18%) ⬆️
src/pkg/packager/create.go 59.68% <100.00%> (-0.62%) ⬇️
src/pkg/packager/digest.go 48.43% <100.00%> (ΓΈ)
... and 23 more

... and 3 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 <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>
@AustinAbro321 AustinAbro321 changed the title feat!: remove deprecated SDK fields feat!: remove deprecated SDK fields and bridges Nov 5, 2026
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>
@AustinAbro321 AustinAbro321 changed the title feat!: remove deprecated SDK fields and bridges feat!: removed deprecated SDK fields and bridges Nov 5, 2026
@AustinAbro321
AustinAbro321 marked this pull request as ready for review November 5, 2026 20:31
@AustinAbro321
AustinAbro321 requested review from a team as code owners November 5, 2026 20:31
Signed-off-by: Austin Abro <austinabro321@gmail.com>
Signed-off-by: Austin Abro <austinabro321@gmail.com>

@dwertent dwertent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left a few comments, I hope I didn't miss anything.
The only "blocker" from my pov is the deprecated agentTLS config write

}

if s != nil {
s.Reconcile()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No familiar with the code, but this looks like a behavior change.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A side affect of removing the agentTLS and nodeport fields on state. Now that there are no bridges, there's nothing to reconcile.


s := &state.State{}
err = json.Unmarshal(secret.Data[state.ZarfStateDataKey], s)
// Keep the pre-v0.85 agent fields at the read boundary; saves use only state.State.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe there is a good reason not to remove this deprecated part.
Maybe we should comment why it's not being removed now.
Also, for future reference maybe it's worth documenting the deprecated fields, e.g.

    // Deprecated: AgentInfo is deprecated as of v0.85 and will be removed in a future release.
	// Use state.AgentInfo directly instead.
	AgentInfo *state.AgentInfo `json:"agentInfo"`

	// Deprecated: AgentTLS is maintained only for backwards compatibility with pre-v0.85 states.
	AgentTLS pki.GeneratedPKI `json:"agentTLS"`

	// Deprecated: AgentTLSUserProvided is no longer used internally.
	AgentTLSUserProvided bool `json:"agentTLSUserProvided"`

	// Deprecated: AgentMutationPolicy will be removed in the next major version.
	AgentMutationPolicy state.MutationPolicy `json:"agentMutationPolicy"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See this comment:
#5615 (comment)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Essentially my stance here is that if someone upgrades to v1.0, then they shouldn't downgrade back to pre-v1.0 (in this case v0.84.0 which was before we introduced the struct to replace the agent config). This would be consistent with the stance I'm taking in #5619. Open to being more conservative. Curious on @brandtkeller's thoughts on this approach.

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.

Agree - we need to be noisy about v1.0.0 and compatibility - but I would advocate for the same.

s.GitServer.GitServerMode = state.GitServerModeInternal
} else {
s.RegistryInfo.RegistryMode = state.RegistryModeExternal
s.GitServer.GitServerMode = state.GitServerModeExternal

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just want to make sure this change (renaming RegistryInfo to GitServer) is intentional

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yup, essentially we're deleting a bridge that has been around for a long time (for registry info) and adding one for git server info for a field that was introduced, but did not have it.

This lets us decouple the address from whether the git server is internal in case in the future we are to ever change the address.

Comment thread src/pkg/logger/logger.go
// strLevels maps a string to its Level.
var strLevels = map[string]Level{
// NOTE(mkcp): Map trace to debug for backwards compatibility.
"trace": Debug,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's good to see this is removed :)

tPrinter.Writer = writer
}
_ = tPrinter.WithHasHeader().WithData(table).Render() //nolint:errcheck
_ = pterm.DefaultTable.WithWriter(writer).WithHasHeader().WithData(table).Render() //nolint:errcheck // Table output is best effort, matching the other message printers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the comment

}

func (c remoteReferenceCache) load(ctx context.Context, importURL, arch string, remoteOptions types.RemoteOptions, cachePath string) (loadedComponentConfig, error) {
remote, err := zoci.NewRemoteWithOptions(ctx, importURL, ocispec.Platform{Architecture: arch}, zoci.RemoteClientOptions{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's probably too late for this comment, but it's interesting that we didn't create a package for v1beta1 and instead we are just adding that as a suffix to the file name.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It should be doable in the future, the functions regarding the specific v1beta1 import process are private with a few helper exceptions

Comment thread src/cmd/viper.go

func (r configDecoderRegistry) Decoder(format string) (viper.Decoder, error) {
switch strings.ToLower(format) {
case "yaml", "yml", "toml":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed, if the file has the wrong format, viper will fail and print that the format is not supported.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We are intentionally limiting the formats that we support to yaml and toml whereas by default viper supports things like .env and .json. I did just realize that our help text forzarf dev generate-config is off though.

Comment thread src/pkg/state/state.go
// AgentInfo contains information Zarf uses to configure the agent.
AgentInfo AgentInfo `json:"agentInfo"`
// Deprecated: Use AgentInfo.TLS instead. Kept for backwards compatibility with state JSON written by older Zarf versions.
AgentTLS pki.GeneratedPKI `json:"agentTLS"`

@dwertent dwertent Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ok, now I see the deprecated agent config.
I think we should leave it here with omitempty and deprecated comment and not add it in the code the way we have (#5615 (comment)).

require.Equal(t, expectedIDs[i], component.Name)
}

// Deprecated signing flags remain compatible with this publish flow.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like we changed the comment but the flags remain the same

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We now are signing through zarf package sign instead of zarf package publish (signing through publish is deprecated)


var sha string
// shas for package published 2023-08-08T22:13:51Z
// Digests for dos-games 1.3.0, published January 26, 2026.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: A link to the run that published rather than the date.
Future work/suggestion: maybe we should have a WF once a week/month whatever bumping the packages and publishing a new image (and then overriding the image here), this way, users who have CVE related policies in there clusters can install the demo without problems.

@AustinAbro321 AustinAbro321 Nov 6, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@AustinAbro321 AustinAbro321 Nov 6, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The point of this particular test is to make sure that old Zarf packages work with newer Zarf (hence me having to update this, we actually broke compat with 2023 packages in this PR). But yeah we probably shouldn't use a small user facing example for this test, and instead have a big package that relies on every feature of Zarf so we actually test all the features of the schema / layout.

But yeah a weekly update of our examples would be great, we do not update them nearly enough rn

Signed-off-by: Austin Abro <austinabro321@gmail.com>
@brandtkeller brandtkeller added the v1.0.0 Issues tracking toward Zarf v1.0.0 label Nov 7, 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.

neat to see and well executed - lgtm

@brandtkeller
brandtkeller added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 0cf9039 Nov 8, 2026
42 checks passed
@brandtkeller
brandtkeller deleted the remove-deprecated-fields branch November 8, 2026 03:16
@github-project-automation github-project-automation Bot moved this to Done in Zarf Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v1.0.0 Issues tracking toward Zarf v1.0.0

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants