Skip to content

feat: support bin packages parsing#299

Open
upils wants to merge 35 commits into
canonical:mainfrom
upils:bin-slices
Open

feat: support bin packages parsing#299
upils wants to merge 35 commits into
canonical:mainfrom
upils:bin-slices

Conversation

@upils

@upils upils commented May 27, 2026

Copy link
Copy Markdown
Collaborator
  • Have you signed the CLA?

This PR is the first step to support the bin package kind in Chisel.

It introduces the Store concept and rework the package naming model so that Package.Name is always a unique identifier across the release, while the new Package.RealName field preserves the bare name of the package needed for package lookups.

It adds support for:

  • a stores section in chisel.yaml
  • a store and default-track fields in slice definition files.

The fetching and extraction of the corresponding bins will be implemented in a following PR.

upils and others added 5 commits May 27, 2026 16:06
Signed-off-by: Paul Mars <paul.mars@canonical.com>
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>
@upils upils added the Priority Look at me first label May 29, 2026
upils added 21 commits June 1, 2026 16:26
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>
Comment thread internal/setup/yaml.go
type yamlPackage struct {
Name string `yaml:"package"`
Archive string `yaml:"archive,omitempty"`
Name string `yaml:"package"`

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

upils added 2 commits June 16, 2026 15:23
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
@upils upils requested a review from Copilot June 16, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 stores parsing/validation in release YAML and new Store model on Release.
  • Introduce Package.RealName alongside Package.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.

Comment thread internal/slicer/slicer.go Outdated
Comment thread internal/setup/yaml.go Outdated
Comment thread cmd/chisel/cmd_info.go Outdated
upils added 4 commits June 17, 2026 08:13
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>
Comment thread internal/setup/setup.go
return err
}

if existing, ok := release.Packages[pkg.Name]; ok {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[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>
Comment thread internal/slicer/slicer.go
// 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 {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

@upils upils requested a review from Copilot June 17, 2026 09:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Comment thread internal/slicer/slicer_test.go
Signed-off-by: Paul Mars <paul.mars@canonical.com>
@upils upils requested a review from letFunny June 17, 2026 09:42
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority Look at me first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants