Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail fast when handling incompatible package #1760

Closed
timblaktu opened this issue May 31, 2023 · 1 comment · Fixed by #1909
Closed

Fail fast when handling incompatible package #1760

timblaktu opened this issue May 31, 2023 · 1 comment · Fixed by #1909
Assignees
Labels
enhancement ✨ New feature or request ga Issues tracking toward Zarf 1.0
Milestone

Comments

@timblaktu
Copy link

timblaktu commented May 31, 2023

Is your feature request related to a problem? Please describe.

zarf package deploying a package that was zarf package created with a version of zarf that uses/used a different packaging format, can cause deploy-time errors related to the breaking schema change. These sorts of indirect errors can be some of the hardest to diagnose. This feature request aims to save users/developers time by catching these earlier and providing explicit clear feedback.

Describe the solution you'd like

As early as possible, zarf package deploy pkg.zst will glean the zarf version used to create pkg.zst, compare that to the running zarf version, and if the delta includes known breaking schema change(s), emit an informative ERROR and exit 1 immediately.

This presupposes that zarf release process uses something like semver, which makes it trivial to check for a breaking transition using arithmetic. If this is not the case, perhaps now would be the time to better define its versioning scheme and compatibility guarantees.

Describe alternatives you've considered

Since we found this in CI originally, we considered implementing this check ourselves in the pipeline steps.

Additional context

@lucasrod16 discovered this to be the cause of some errors UDS team was seeing in zarf-package-big-bang CI. Specifically, our deploy pipeline was using 0.26.4 to deploy a package built with v0.27.0. The 0.27.0 release notes clearly highlight the breaking change:

Internal package structure changes will require packages built with v0.27.0 to be deployed with v0.27.0 or higher by @Noxsios in #1469 and by @Racer159 #1696

Previously built packages are still compatible with v0.27.0, only newly created packages will require the higher version

We would love to have seen zarf deploy instead fail fast with something like:

ERROR: `zarf` v0.26.4 cannot `deploy` a package created with `zarf` v0.27.0 due to a breaking change.

...perhaps followed with some guidance and a built-in reminder about zarf's versioning scheme and compatibility guarantees:

Zarf uses a variant of semver and cannot guarantee inter-operability between instances with different major or minor versions.

..or whatever is appropriate for the actual versioning/compatibility contract zarf prescribes.

@timblaktu timblaktu added the enhancement ✨ New feature or request label May 31, 2023
@Racer159 Racer159 added the ga Issues tracking toward Zarf 1.0 label May 31, 2023
@Racer159
Copy link
Contributor

Added the ga label to this

Right now we do breakages on minors even though that is not part of semver because we are not yet GA. We could add a warning when a minor version bump is detected though minors are not guaranteed at this time to have breaking changes (see v0.23.x -> v0.24.x).

What may be a better solution for now is to add a "minimumVersion" field to the build information that Zarf can check and fail on if it is less than that version.

@Racer159 Racer159 changed the title fail fast when handling incompatible package Fail fast when handling incompatible package Jun 6, 2023
@Racer159 Racer159 modified the milestones: (2023.07.04), (2023.07.18) Jun 24, 2023
@lucasrod16 lucasrod16 self-assigned this Jul 18, 2023
@Racer159 Racer159 modified the milestones: (2023.07.18), (2023.08.01) Jul 20, 2023
Racer159 added a commit that referenced this issue Aug 2, 2023
## Description

- Adds the latest version of Zarf with no breaking package structure
changes to build metadata in packages on `package create`

- Validates the running Zarf CLI version is not less (older) than the
last non-breaking version in a package on `package deploy`. Zarf will
throw a warning to the user if the CLI version is older than the last
non-breaking version to warn before deploying packages that are
potentially affected by breaking changes.

## Related Issue

Fixes #1760


## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [x] Test, docs, adr added or updated as needed
- [x] [Contributor Guide
Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request ga Issues tracking toward Zarf 1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants