-
Notifications
You must be signed in to change notification settings - Fork 582
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
many: add Provenance field to ComponentInfo #14067
many: add Provenance field to ComponentInfo #14067
Conversation
@@ -346,7 +346,7 @@ func (s *packSuite) TestDebArchitecture(c *C) { | |||
c.Check(pack.DebArchitecture(&snap.Info{Architectures: nil}), Equals, "all") | |||
} | |||
|
|||
func (s *packSuite) TestPackSimple(c *C) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these names got swapped accidentally at some point, TestPackSimple
was testing packing a component, and TestPackComponentSimple
was testing packing a snap.
8672d10
to
3e86fb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, did a pass, we need to validate with naming.ValidateProvenance in the validation code for components
// NewComponentInfo creates a new ComponentInfo. | ||
func NewComponentInfo(cref naming.ComponentRef, ctype ComponentType, version, summary, description string, csi *ComponentSideInfo) *ComponentInfo { | ||
func NewComponentInfo(cref naming.ComponentRef, ctype ComponentType, version, summary, description, provenance string, csi *ComponentSideInfo) *ComponentInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with so many arguments it's getting a bit unclear whether this is more readable than &struct{}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do agree, yeah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, test question though
@@ -55,6 +55,7 @@ type: test | |||
version: 1.0 | |||
summary: short description | |||
description: long description | |||
provenance: prov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we still have tests here where this is empty but validates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, TestReadComponentInfoMinimal
covers that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Add a
Provenance
tosnap.ComponentInfo
. This allowssnap pack
to work with components that define a provenance in theircomponent.yaml
file.