Skip to content

o/snapstate: fix validation set checking when removing components#16670

Open
Rnfudge02 wants to merge 2 commits intocanonical:masterfrom
Rnfudge02:validation-set-component-fix
Open

o/snapstate: fix validation set checking when removing components#16670
Rnfudge02 wants to merge 2 commits intocanonical:masterfrom
Rnfudge02:validation-set-component-fix

Conversation

@Rnfudge02
Copy link
Contributor

No description provided.

@Rnfudge02 Rnfudge02 self-assigned this Feb 25, 2026
@Rnfudge02 Rnfudge02 requested a review from natibek February 25, 2026 12:17
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Fri Feb 27 14:16:19 UTC 2026
The following results are from: https://github.com/canonical/snapd/actions/runs/22487078189

Failures:

Preparing:

  • openstack:ubuntu-20.04-64:tests/main/interfaces-iscsi-initiator

Executing:

  • openstack:ubuntu-core-18-64:tests/core/remodel-base
  • openstack:ubuntu-core-18-64:tests/main/snap-debug-raa
  • openstack:ubuntu-core-24-64:tests/core/writablepaths
  • openstack:ubuntu-20.04-64:tests/main/interface-allow-auto-connection:false

Restoring:

  • openstack:ubuntu-core-18-64:tests/core/remodel-base
  • openstack:ubuntu-core-18-64:tests/core/
  • openstack:ubuntu-core-18-64:
  • openstack:ubuntu-core-18-64:tests/main/snap-debug-raa

Skipped tests from snapd-testing-skip

  • openstack:ubuntu-24.04-64:tests/main/i18n

Copy link
Contributor

@natibek natibek 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, could you add a test for this scenario: "snap required, component not required, component removal should be allowed"

@codecov
Copy link

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.53%. Comparing base (372614c) to head (d379395).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #16670      +/-   ##
==========================================
- Coverage   77.61%   77.53%   -0.08%     
==========================================
  Files        1348     1359      +11     
  Lines      187068   187317     +249     
  Branches     2446     2446              
==========================================
+ Hits       145185   145232      +47     
- Misses      33109    33306     +197     
- Partials     8774     8779       +5     
Flag Coverage Δ
unittests 77.53% <100.00%> (-0.08%) ⬇️

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

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

Nice, LGTM, thanks! Good to have a test which checks that a component which is not included in the validation set can be removed. Maybe if there's a way to have a component included but not required, could be good to have a test that that can be removed too?

"presence": "required",
"components": map[string]any{
enforcedCompName: map[string]any{
"presence": "required",
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to have another component here for which presence is not required? And test that it can be removed?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is possible. Good idea.

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! Adding that other test case is a good idea.

@Rnfudge02 Rnfudge02 force-pushed the validation-set-component-fix branch from fee526d to d379395 Compare February 27, 2026 12:55
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.

4 participants