feat: support bin packages parsing#299
Conversation
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
| type yamlPackage struct { | ||
| Name string `yaml:"package"` | ||
| Archive string `yaml:"archive,omitempty"` | ||
| Name string `yaml:"package"` |
There was a problem hiding this comment.
[Note to reviewer]: Out of consistency with the Package type, I am tempted to also rename this field to RealName. However it is not strictly needed for this struct as there is no other "name" in it.
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR introduces “store”-backed packages in release YAML (format v3+), adding store metadata parsing plus a split between a package’s unique identifier vs its archive-visible name.
Changes:
- Add
storesparsing/validation in release YAML and newStoremodel onRelease. - Introduce
Package.RealNamealongsidePackage.Name(unique identifier), and update package parsing/serialization accordingly. - Extend tests to cover store parsing rules and new YAML fields.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/slicer/slicer.go | Uses RealName for archive operations and skips store packages when selecting archives. |
| internal/setup/yaml.go | Parses stores, adds store-related package fields, and derives unique package names via store prefixes. |
| internal/setup/setup.go | Adds Store/Stores types and validates packages’ store references; updates slice loading to key by unique package name. |
| internal/setup/setup_test.go | Updates expected package structures and adds tests for store parsing/validation and YAML formatting. |
| cmd/chisel/cmd_info.go | Copies RealName into package structures created for info selection. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
| return err | ||
| } | ||
|
|
||
| if existing, ok := release.Packages[pkg.Name]; ok { |
There was a problem hiding this comment.
[Note to reviewer]: Before the package parsing we only have the real name. So this check can now only be done after the package parsing because we need the package name.
Signed-off-by: Paul Mars <paul.mars@canonical.com>
| // Store package processing is not yet implemented, so store slices | ||
| // are filtered out from the selection for now. | ||
| var archiveSlices []*setup.Slice | ||
| for _, slice := range options.Selection.Slices { |
There was a problem hiding this comment.
[Note to reviewer]: This must go away in the next PR when actually implementing the fetching of bins from the store. This is less disturbing solution I found, not requiring a refactoring of this function.
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
This PR is the first step to support the
binpackage kind in Chisel.It introduces the
Storeconcept and rework the package naming model so thatPackage.Nameis always a unique identifier across the release, while the newPackage.RealNamefield preserves the bare name of the package needed for package lookups.It adds support for:
storessection inchisel.yamlstoreanddefault-trackfields in slice definition files.The fetching and extraction of the corresponding bins will be implemented in a following PR.