build providers: improve handling in snap logic
Metadata
Current evaluation
Merged. Improved snap provider logic by cleaning up channel warnings, removing unnecessary sudo calls, and silencing noisy refresh hold commands. Approved, passed CI, and modified 5 files (+131/-73 lines).
Suggested action: —
No scores available.
Issue body
Cleanup up the channel warning when the
SNAPCRAFT_BUILD_ENVIRONMENT_CHANNEL_SNAPCRAFT is not set.
Removed unnecessary use of sudo, given that the providers all run as
root.
Silenced the call on holds for refreshes as it is unnecessarily noisy
and adds little value to users.
LP: #1820864
Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `./runtests.sh static`?
- [x] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Improved snap provider logic by cleaning up channel warnings, removing unnecessary sudo calls, and silencing noisy refresh hold commands. Approved, passed CI, and modified 5 files (+131/-73 lines). | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged improvements to snap build provider logic. Changes clean up channel warnings, remove unnecessary sudo calls, and silence noisy refresh holds. Resolves LP #1820864. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged updates to snap logic for build providers. Changes clean up channel warnings, remove unnecessary sudo calls, and silence noisy refresh holds. Successfully merged after passing unit tests. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3146 build providers: snap sw to channels if injecting | snapcraft | merged | Merged fix that prevents automatic channel switching to latest/stable when injecting snaps with revision assertions during build provider setup. Approved by reviewer, passed CI, and integrated. | |
| #2773 build providers: inject snapd snap for latest feature availability | snapcraft | merged | Merged changes that inject the snapd snap into build providers instead of core, improving feature availability and reducing size. Approved by reviewer, passed CI, and modified 4 files (+59/-12 lines). | |
| #3184 build providers: check revision before switching | snapcraft | merged | Merged a fix adding a revision check before channel switching in build providers. Resolves incorrect switching behavior caused by snapd changes. Approved by reviewer, passed CI, and merged. | |
| #2309 snap: improve early base detection logic | snapcraft | merged | Merged. Resolved early base detection failure in build providers by updating logic to account for snapcraft's non-project directory execution. Approved by reviewer, passed CI, and merged with minimal changes. | |
| #3102 build providers: prevent snap refreshing in build environment | snapcraft | merged | Merged to prevent snap refreshing in the build environment by holding refresh for one day. Adjusted per reviewer feedback to avoid incomplete manifests and address versioning string comparisons. Approved and merged. | |
| #4096 meta: disallow Snap channel in default_provider | snapcraft | merged | Merged into main after two approvals. Added validation to disallow Snap channels in default_provider, including a legacy check and unit tests. Passed CI with 100% diff coverage. | |
| #3039 build providers: setup initial apt source configuration | snapcraft | merged | Merged refactoring centralizing snapcraft initialization in the base provider and adding apt source configuration via environment flags. Fixed a file permission error and streamlined installation. Approved and merged after CI checks. | |
| #2174 build_providers: inject snaps when running from a snap | snapcraft | merged | Merged. Updates build providers to inject snapcraft and its base from the host when running inside the snapcraft snap, ensuring parity with non-snap environments. Approved by reviewer and passed CI checks. | |
| #3130 build providers: don't show an error if there are no auto-refresh changes | snapcraft | merged | Merged a fix suppressing a false snap watch error when no auto-refresh changes exist. Adding a question mark to the change type ensures a success exit code. Approved by reviewers and passed CI. | |
| #2647 build providers: catch LXD socket error | snapcraft | merged | Merged to catch LXD socket errors in build providers, resolving SNAPCRAFT-WA. Approved by reviewer, passed CI checks, and integrated with a 14-line addition and 6-line deletion across three files. Minor test coverage decrease noted but did not block merge. |