← Back to issue list

sources: clean up IncompatibleOptionsError

View original Github issue

Metadata

Project
snapcraft
Number
#2109
Type
pull request
State
merged
Author
kalikiana
Labels
Created
Updated
Closed

Current evaluation

Merged refactoring splitting IncompatibleOptionsError into SnapcraftSourceIncompatibleOptionsError and SnapcraftSourceInvalidOptionError. Updated tests to use new classes and assert properties. Approved and merged after passing CI.

Suggested action:

No scores available.

Issue body

- [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] If this is a bugfix. Have you checked that there is a bug report open for the issue you are trying to fix on [bug reports](https://bugs.launchpad.net/snapcraft)? - [x] If this is a new feature. Have you discussed the design on the [forum](https://forum.snapcraft.io)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh unit`? ----- This PR splits `IncompatibleOptionsError` into `SnapcraftSource{IncompatibleOptionsError, and InvalidOptionError}` so there's distinct errors for an option that can't be used with a source and trying to use exclusive options at the same time. This is part of #1705. The following new tests are affected: - tests.unit.sources - All tests were updated to use the new error classes and assert the properties rather than the message string. I locally ran the tests: - `./runtests.sh tests/unit` with unrelated failures in [tests.unit.test_lifecycle.CoreSetupTestCase.test_core_setup_if_docker_env](https://bugs.launchpad.net/snapcraft/+bug/1752576), `tests.unit.test_mangling.TestClearExecstack.test_execstack_clears` and `tests.unit.test_elf`. - `./runtests.sh tests/integration` with one unrelated failure in [tests.integration.general.test_parser.TestParserWikis](https://bugs.launchpad.net/snapcraft/+bug/1752580) - `./runtests.sh static`: Everything passed

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged refactoring splitting IncompatibleOptionsError into SnapcraftSourceIncompatibleOptionsError and SnapcraftSourceInvalidOptionError. Updated tests to use new classes and assert properties. Approved and merged after passing CI.
qwen3.6-35b-a3b-mtp-q6 Merged a refactor splitting IncompatibleOptionsError into SnapcraftSourceIncompatibleOptionsError and SnapcraftSourceInvalidOptionError. Updated tests to use the new classes and assert properties. Addresses part of issue #1705.
qwen3.6-35b-a3b-mtp-q6 Merged refactoring that splits IncompatibleOptionsError into SnapcraftSourceIncompatibleOptionsError and SnapcraftSourceInvalidOptionError. Updated unit tests to use the new classes. Resolves part of issue #1705.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2604 sources: introduce SnapcraftSourceNotFoundError snapcraft merged Merged. Introduces SnapcraftSourceNotFoundError to improve error messaging for missing sources, chaining to FileNotFoundError. Adds unit tests, fixes formatting, and resolves internal tickets SNAPCRAFT-VV, VN, TJ, T9, and TE. Approved and CI-passed.
73%
#2734 SnapcraftError refactoring snapcraft merged Refactored SnapcraftError across four files, adding 279 lines and removing 26. Approved by one reviewer and merged into the codebase.
71%