← Back to issue list

meta: ensure Snap's `assumes` is initialized as a set

View original Github issue

Metadata

Project
snapcraft
Number
#2796
Type
pull request
State
merged
Author
cjp256
Labels
Created
Updated
Closed

Current evaluation

Merged fix for SNAPCRAFT-16C that converts the assumes configuration from a list to a set during initialization. This resolves a runtime exception when using command-chain by ensuring the add method functions correctly. Includes updated unit tests.

Suggested action:

No scores available.

Issue body

When reading the config data dictionary, convert the list to a set. The `assumes` property is defined as a set in Snap meta, but derives from a list in the the snap meta. This causes an exception when using `command-chain`, but `command-chain` is not already in the `assumes` (due to the use of Snap's usage of `.add()` on the set, which is not available for lists). Add a test for coverage/verification. Signed-off-by: Chris Patterson <chris.patterson@canonical.com> - [ ] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `./runtests.sh static`? - [ ] Have you successfully run `./runtests.sh tests/unit`? -----

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged fix for SNAPCRAFT-16C that converts the assumes configuration from a list to a set during initialization. This resolves a runtime exception when using command-chain by ensuring the add method functions correctly. Includes updated unit tests.
qwen3.6-35b-a3b-mtp-q6 Merged. Converts the assumes property from a list to a set during config parsing to prevent AttributeError when using command-chain, which calls set add methods. Includes updated unit tests and resolves SNAPCRAFT-16C.
qwen3.6-35b-a3b-mtp-q6 Merged. Converts the assumes property from a list to a set during config parsing, preventing command-chain exceptions. Includes updated unit tests and resolves SNAPCRAFT-16C.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2879 [3.9-backport] meta: ensure Snap's `assumes` is initialized as a set snapcraft merged Merged backport to 3.9 resolving SNAPCRAFT-16C. Converts the assumes property from a list to a set during config initialization to prevent command-chain exceptions. Includes regression test coverage.
92%
#2864 meta: assume command-chain fix for prepending snapcraft-runner snapcraft merged Merged a fix adding a missing check for prepend_command_chain when determining if command-chain should be assumed in metadata. Includes updated assumes coverage tests. Approved by one reviewer and passed CI checks.
75%
#2379 meta: add assumes if using "full" app adapter snapcraft merged Merged into master. Automatically adds assumes: [command-chain] to snap metadata when using the full app adapter, resolving LP: #1799295. Approved, passed CI, and achieved 100% diff coverage.
72%
#4931 Failed to upload snap created with `assumes: - command-chain` snapcraft open Snapcraft duplicates 'command-chain' in assumes when user already lists it, causing snap store upload to fail schema validation. Triaged and confirmed as bug; fix not yet merged. Last activity 461 days ago.
71%
#2019931 snapcraft is ignoring the "assumes" section snapcraft (launchpad) closed Bug report indicating snapcraft omits the assumes section from snap.yaml when using core22 base. Closed after two days with zero comments, indicating the report was abandoned without resolution.
70%