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

o/snapstate: include store url in snap setup and auxinfo stored on disk #15040

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

olivercalder
Copy link
Member

@olivercalder olivercalder commented Feb 6, 2025

This is a follow-up to f2c208e, which added the "store-url" field to snap auxinfo. However, the caller of keepAuxStoreInfo never actually set the StoreURL field, so the auxinfo stored to disk continued to be lacking it.

Other related commits are eee4a0e, which set up cmd/snap to look for store URL in the local snap's auxinfo, and 25ca263, which included store URL in the store request.

To see evidence of the store URL currently being missing from local snap info, see the following (assuming snapd and jq are installed):

# get snap info from the store (where the field exists)
snap debug api '/v2/find?name=snapd' | jq '.result.[0]' | grep '"store-url"'
# get store info for locally-installed snapd (where it's missing)
snap debug api '/v2/snaps/snapd' | jq '.result' | grep '"store-url"'
# check the cached auxinfo for snapd (missing here)
cat /var/cache/snapd/aux/PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4.json | jq | grep '"store-info"'

In contrast, top-level "media" and "website" fields are always present:

# get snap info from the store
snap debug api '/v2/find?name=snapd' | jq '.result.[0]' | grep '"media"'
snap debug api '/v2/find?name=snapd' | jq '.result.[0]' | grep '"website"'
# get store info for locally-installed snapd
snap debug api '/v2/snaps/snapd' | jq '.result' | grep '"media"'
snap debug api '/v2/snaps/snapd' | jq '.result' | grep '"website"'
# check the cached auxinfo for snapd
cat /var/cache/snapd/aux/PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4.json | jq | grep '"media"'
cat /var/cache/snapd/aux/PMrrV4ml8uWuEUDBT8dSGnKUYbevVhc4.json | jq | grep '"website"'

This work is tracked internally by https://warthogs.atlassian.net/browse/SNAPDENG-34480

This is a follow-up to f2c208e, which
added the "store-url" field to snap auxinfo. However, the caller of
keepAuxStoreInfo never actually set the `StoreURL` field, so the auxinfo
stored to disk continued to be lacking it.

Other related commits are eee4a0e,
which set up `cmd/snap` to look for store URL in the local snap's
auxinfo, and 25ca263, which included
store URL in the store request.

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
Copy link

codecov bot commented Feb 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@72b960e). Learn more about missing BASE report.
Report is 179 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #15040   +/-   ##
=========================================
  Coverage          ?   78.02%           
=========================================
  Files             ?     1138           
  Lines             ?   153226           
  Branches          ?        0           
=========================================
  Hits              ?   119558           
  Misses            ?    26303           
  Partials          ?     7365           
Flag Coverage Δ
unittests 78.02% <100.00%> (?)

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

github-actions bot commented Feb 7, 2025

Fri Feb 7 17:42:53 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13189031878

Failures:

Preparing:

  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-tumbleweed-64
  • openstack:opensuse-15.6-64
  • openstack:opensuse-15.6-64
  • openstack:opensuse-15.6-64
  • openstack:opensuse-15.6-64
  • openstack:opensuse-15.6-64
  • openstack:opensuse-15.6-64

Executing:

  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-strict-enforced
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-serial-port
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-self-manage
  • google:ubuntu-25.04-64:tests/main/cgroup-devices-v2
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-required-or-optional
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-helper
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups:kmsg
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups:uinput

Restoring:

  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-strict-enforced

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

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.

Thanks!

@olivercalder olivercalder merged commit 2fcecfb into canonical:master Feb 7, 2025
64 of 67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants