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: add some metadata to help with component remodeling #14939

Conversation

andrewphelpsj
Copy link
Member

This change adds a field to SnapSetup for tracking if a SnapSetup comes from a task set that only deals with components.

Additionally, this adds an edge that points to the snap setup task that is created by many of the functions in snapstate. Since a task set might contain many snap-setup tasks, but we really only want to find one (especially now that a snap-setup task needs to carry a component-setup-tasks), we use this edge to pick the one that will have all the fields needed to help with remodeling.

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 91.42857% with 6 lines in your changes missing coverage. Please review.

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

Files with missing lines Patch % Lines
overlord/snapstate/component.go 90.62% 2 Missing and 1 partial ⚠️
overlord/snapstate/snapstate.go 91.42% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #14939   +/-   ##
=========================================
  Coverage          ?   78.27%           
=========================================
  Files             ?     1157           
  Lines             ?   153506           
  Branches          ?        0           
=========================================
  Hits              ?   120161           
  Misses            ?    25940           
  Partials          ?     7405           
Flag Coverage Δ
unittests 78.27% <91.42%> (?)

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 Jan 16, 2025

Thu Jan 23 21:54:02 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/12934412470

Failures:

Preparing:

  • openstack:debian-sid-64:tests/main/
  • 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:tests/main/

Executing:

  • openstack:centos-9-64:tests/main/degraded
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-retry
  • openstack:opensuse-tumbleweed-64:tests/main/snap-refresh-hold
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:close_mid_restart
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-gating
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-gating-from-snap
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh:parallel
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:close
  • openstack:opensuse-tumbleweed-64:tests/main/auto-refresh-pre-download:ignore
  • openstack:opensuse-tumbleweed-64:tests/main/refresh-app-awareness-notify
  • google-arm:ubuntu-20.04-arm-64:tests/main/auto-refresh-gating

Restoring:

  • openstack:debian-sid-64:tests/unit/
  • openstack:debian-sid-64:tests/unit/
  • 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-tumbleweed-64:tests/main/refresh-app-awareness-notify
  • openstack:opensuse-tumbleweed-64:tests/main/interfaces-snapd-control-with-manage
  • openstack:opensuse-tumbleweed-64:tests/main/
  • openstack:opensuse-tumbleweed-64

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

thanks, comment/question


// ComponentExclusiveSetup is set if this SnapSetup exists only to deal with
// components, and not the snap itself.
ComponentExclusiveSetup bool `json:"component-exclusive-setup,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

shouldn't we s/Setup/Operation/ ? the snap setup still describes a snap but the operation it is involved with touches only components? can you point in the description of this where this is going to be consulted in the larger PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

thanks

Copy link
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@andrewphelpsj andrewphelpsj force-pushed the add-metadata-for-component-remodel branch from 9173c13 to 585ee25 Compare January 22, 2025 14:21
…mponent-setup when installing a snap with components

This indicates to ifacestate's setup-profiles handler that the
setup-profiles should operate on a snap and a set of components, rather
than a single component.
@andrewphelpsj andrewphelpsj force-pushed the add-metadata-for-component-remodel branch from 585ee25 to 92729a4 Compare January 23, 2025 17:11
@andrewphelpsj andrewphelpsj merged commit 19821c8 into canonical:master Jan 23, 2025
59 of 63 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