-
Notifications
You must be signed in to change notification settings - Fork 598
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
snap, snap/pack: add pack validation for default-configure hook #13097
snap, snap/pack: add pack validation for default-configure hook #13097
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. @@ Coverage Diff @@
## master #13097 +/- ##
=======================================
Coverage 78.80% 78.80%
=======================================
Files 1011 1011
Lines 125673 125691 +18
=======================================
+ Hits 99032 99056 +24
+ Misses 20433 20429 -4
+ Partials 6208 6206 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
e08eaea
to
f3de965
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.
Thanks, I think this looks super nice :)
@ernestl do you need to merge master to fix golangci-lint issues? |
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.
direction looks reasonable, some wonderings
f3de965
to
f4f85e9
Compare
Yes this was required, I realise it was not ideal to rebase, my apologies. |
@@ -117,15 +117,16 @@ func loadAndValidate(sourceDir string) (*snap.Info, error) { | |||
if err != nil { | |||
return nil, err | |||
} | |||
snap.AddImplicitHooksFromContainer(info, container) |
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 attempted approach to create /internal helpers and share code with ReadInfoFromSnapFile, but concluded it would not look/work nice. As far as I can see not possible without exporting new function, so exporting AddImplicitHooksFromContainer seems like an ok trade-off.
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.
thanks
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
…nical#13097) * snap/pack: enhance snap pack to validate all container info * snap: enhanced snap info validation to flag default-configure without configure hook * snap: fixed implicit hook test * snap, snap/pack: added unit tests * snap/pack: add additional unit tests * snap: revert back to not using ReadInfoFromSnapFile
…nical#13097) * snap/pack: enhance snap pack to validate all container info * snap: enhanced snap info validation to flag default-configure without configure hook * snap: fixed implicit hook test * snap, snap/pack: added unit tests * snap/pack: add additional unit tests * snap: revert back to not using ReadInfoFromSnapFile
Additional to PR-12701, to address this comment.
As a temporary measure checkConfigureHooks was added which extends checkSnap that is called from doMountSnap
The requirement is to have a similar check in place in:
This PR proposes to achieve this by:
addImplicitHooksFromContainer
and use inloadAndValidate
to populate missing implicit hooks to enable validation.Further consideration:
doMountSnap
handler checkSnap uses snap.ReadInfoFromMountPoint which unlike its counterpartsnap.ReadInfoFromSnapFile
does not have a snap.Validation step included. This means without the temporary measure in place, we would loose the check at that stage.Propose to extend test to include repack of some of the most complicated snaps we have, including essential snaps.