feat: make suites mandatory in archive config#161
Merged
niemeyer merged 4 commits intocanonical:mainfrom Oct 14, 2024
Merged
Conversation
rebornplusplus
suggested changes
Oct 4, 2024
rebornplusplus
left a comment
There was a problem hiding this comment.
Thanks for the PR!
Please note that some other packages (main and slicer) have tests without the archives.<archive>.suites field. We need to update those too.
I can't trigger the CI, but the unit tests are failing actually (ran locally):
$ go test ./... -count=
1
? github.com/canonical/chisel/cmd [no test files]
? github.com/canonical/chisel/internal/archive/testarchive [no test files]
----------------------------------------------------------------------
FAIL: cmd_info_test.go:209: ChiselSuite.TestInfoCommand
Summary: A single slice inspection
cmd_info_test.go:230:
c.Assert(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"chisel.yaml: archive \"ubuntu\" missing suites field"} ("chisel.yaml: archive \"ubuntu\" missing suites field")
OOPS: 2 passed, 1 FAILED
--- FAIL: Test (0.01s)
FAIL
FAIL github.com/canonical/chisel/cmd/chisel 0.028s
ok github.com/canonical/chisel/internal/archive 0.193s
ok github.com/canonical/chisel/internal/cache 0.014s
ok github.com/canonical/chisel/internal/control 0.006s
? github.com/canonical/chisel/internal/deb/chrorder [no test files]
ok github.com/canonical/chisel/internal/deb 0.067s
ok github.com/canonical/chisel/internal/fsutil 0.033s
ok github.com/canonical/chisel/internal/jsonwall 0.007s
ok github.com/canonical/chisel/internal/manifest 0.013s
ok github.com/canonical/chisel/internal/pgputil 0.024s
ok github.com/canonical/chisel/internal/scripts 0.041s
ok github.com/canonical/chisel/internal/setup 17.924s
----------------------------------------------------------------------
FAIL: slicer_test.go:1090: S.TestRun
Summary: Basic slicing
slicer_test.go:1092:
// Run tests for format chisel-v1.
runSlicerTests(c, slicerTests)
slicer_test.go:1136:
c.Assert(err, IsNil)
... value *errors.errorString = &errors.errorString{s:"chisel.yaml: archive \"ubuntu\" missing suites field"} ("chisel.yaml: archive \"ubuntu\" missing suites field")
OOPS: 2 passed, 1 FAILED
--- FAIL: Test (0.01s)
FAIL
FAIL github.com/canonical/chisel/internal/slicer 0.100s
ok github.com/canonical/chisel/internal/strdist 0.007s
ok github.com/canonical/chisel/internal/testutil 12.272s
FAIL
letFunny
reviewed
Oct 7, 2024
Collaborator
letFunny
left a comment
There was a problem hiding this comment.
Looks good to me. We need to discuss if we want to remove the defaults or configure them properly, probably the former.
niemeyer
approved these changes
Oct 14, 2024
Contributor
niemeyer
left a comment
There was a problem hiding this comment.
This looks reasonable, thanks for the suggestion. We need to discuss the possible removal of the version field as well, which was used for assuming details before. But we'll do it separately.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the
suitesattribute of archives in thechisel.yamlmandatory. All other attributes are already mandatory (version, components and keys).There was an old fallback logic which would set
suitesto the release adjective if left unset, but this logic was only configured for 4 ubuntu releases, one of which (bionic) is no longer supported by chisel, and all other three have their suites properly configured in theirchisel.yamlalready, so this piece of logic never triggers (focal, jammy, kinetic).