Skip to content
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

daemon: fetch validation sets before checking refresh candidates #14907

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

miguelpires
Copy link
Contributor

snap refresh --list didn't report snaps that would be refreshed with a snap refresh because it, unlike the actual refresh, didn't refresh the validation sets which could make new snap revisions available. This change fetches new validation sets (without tracking them) before checking for refreshable snaps

`snap refresh --list` didn't report snaps that would be refreshed with a
`snap refresh` because it, unlike the latter, didn't refresh validation
sets which could make new snap revisions available.
This change fetches new validation sets (without tracking them) before
checking for refreshable snaps.

Signed-off-by: Miguel Pires <[email protected]>
@github-actions github-actions bot added the Needs Documentation -auto- Label automatically added which indicates the change needs documentation label Jan 7, 2025
@miguelpires miguelpires requested a review from bboozzoo January 7, 2025 16:44
@miguelpires
Copy link
Contributor Author

miguelpires commented Jan 7, 2025

@pedronis this PR adds a side-effect to snap refresh --list so that we don't have to add code to fetch assertions w/o committing them and make the refresh candidate checking code aware of arbitrary validation sets that aren't in the DB. I think it's a fair trade-off for a much less complex implementation but since that was a concern you had, I'm just pinging you here so you can veto it if you disagree

Copy link
Member

@andrewphelpsj andrewphelpsj left a comment

Choose a reason for hiding this comment

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

Thank you!

overlord/assertstate/assertstate.go Outdated Show resolved Hide resolved
overlord/assertstate/assertstate.go Show resolved Hide resolved
Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 75.47170% with 13 lines in your changes missing coverage. Please review.

Project coverage is 78.22%. Comparing base (24a0034) to head (2c18d84).
Report is 92 commits behind head on master.

Files with missing lines Patch % Lines
overlord/assertstate/assertstate.go 83.33% 4 Missing and 3 partials ⚠️
daemon/api_find.go 45.45% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #14907      +/-   ##
==========================================
+ Coverage   78.20%   78.22%   +0.02%     
==========================================
  Files        1151     1158       +7     
  Lines      151396   152944    +1548     
==========================================
+ Hits       118402   119645    +1243     
- Misses      25662    25912     +250     
- Partials     7332     7387      +55     
Flag Coverage Δ
unittests 78.22% <75.47%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

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

LGTM

@miguelpires
Copy link
Contributor Author

miguelpires commented Jan 8, 2025

Failures:

openstack:fedora-41-64: cannot allocate new Openstack server jan081602-652568: server status is ERROR
openstack:centos-9-64: ... same
ubuntu-20.04-64:tests/unit/go:clang known issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Documentation -auto- Label automatically added which indicates the change needs documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants