Skip to content

Conversation

@Meulengracht
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 17, 2025 10:38
@github-actions github-actions bot added the Run only one system Only runs spread tests on one system label Dec 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modifies the snap prepare-image command to enforce validation sets that have mode "enforce" even when the --validation=ignore flag is used. Previously, --validation=ignore would skip all validation set checks, but this change ensures that model-enforced validation sets are always validated regardless of this flag.

Key Changes:

  • Modified CheckValidationSets to accept a modelEnforcedOnly parameter that filters validation sets based on their enforcement mode
  • Updated the prepare-image workflow to pass modelEnforcedOnly=true when --validation=ignore is specified
  • Added comprehensive integration test to verify the new behavior

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
seed/seedwriter/writer.go Added modelEnforcedOnly parameter to validation set checking functions to filter by enforcement mode
image/image_linux.go Modified to check enforced validation sets even when --validation=ignore is used
tests/main/prepare-image-validation-sets-fails-on-ignore/task.yaml Integration test verifying prepare-image fails with enforced validation sets despite --validation=ignore
tests/main/prepare-image-validation-sets-fails-on-ignore/asserts/vs-bar.json Test assertion defining a validation set requiring test-snapd-sh at revision 13
tests/main/prepare-image-validation-sets-fails-on-ignore/asserts/core-20.json Test model assertion with enforced validation set reference

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// specified validation set. Info for all seed snaps must have been derived prior
// to this call.
func (w *Writer) CheckValidationSets() error {
func (w *Writer) CheckValidationSets(modelEnforcedOnly bool) error {
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The function signature of CheckValidationSets has been changed to accept a modelEnforcedOnly parameter, but the existing test calls in seed/seedwriter/writer_test.go (lines 4376, 4479, 4588, 4658, 5003) have not been updated to pass this new parameter. This will cause compilation errors. All existing calls should be updated to pass false as the parameter value to maintain the current test behavior.

Copilot uses AI. Check for mistakes.
fakestore new-snap-revision --dir "${STORE_DIR}" "$SNAP_PATH" --snap-rev-json snap-"$SNAP_NAME"-rev.json
}
echo Download snaps needed for the the model
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

Typo: "the the model" should be "the model"

Suggested change
echo Download snaps needed for the the model
echo Download snaps needed for the model

Copilot uses AI. Check for mistakes.
Comment on lines 891 to 892
// run validation-set checks, this is also done by store but
// we double-check for the seed.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The comment should be updated to clarify that when --validation=ignore is used, only model-enforced validation sets are checked, while all validation sets are checked otherwise. This is important to document the new behavior introduced by this change.

Suggested change
// run validation-set checks, this is also done by store but
// we double-check for the seed.
// Run validation-set checks; this is also done by the store but we
// double-check for the seed. When --validation=ignore is used, only
// model-enforced validation sets are checked; otherwise all validation
// sets are checked.

Copilot uses AI. Check for mistakes.

// CheckValidationSets validates all snaps that are to be seeded against any
// specified validation set. Info for all seed snaps must have been derived prior
// to this call.
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

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

The function documentation should be updated to describe the new modelEnforcedOnly parameter. It should explain that when true, only validation sets with enforce mode are checked, while when false, all validation sets are checked.

Suggested change
// to this call.
// to this call. When modelEnforcedOnly is true, only validation sets with
// enforce mode are checked; when false, all validation sets are checked.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Wed Dec 17 10:49:40 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/20299948768

No spread failures reported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Run only one system Only runs spread tests on one system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant