fix: skip missing extensions gracefully instead of crashing#2536
Merged
k9ert merged 4 commits intocryptoadvance:masterfrom Mar 21, 2026
Merged
fix: skip missing extensions gracefully instead of crashing#2536k9ert merged 4 commits intocryptoadvance:masterfrom
k9ert merged 4 commits intocryptoadvance:masterfrom
Conversation
✅ Deploy Preview for specter-desktop-docs canceled.
|
k9ert
approved these changes
Mar 19, 2026
bac17f2 to
ce383fc
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts extension/module reflection so Specter can start even when optional extensions listed in ProductionConfig.EXTENSION_LIST aren’t installed (regression fix for #2496), and adds tests to ensure missing modules are skipped rather than crashing startup.
Changes:
- Update
get_classlist_of_type_clazz_from_modulelist()to log a warning and skip missing modules instead of raisingSpecterError. - Add regression tests ensuring missing modules are skipped and an empty list is returned when all modules are missing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/cryptoadvance/specter/util/reflection.py |
Changes missing-module handling from raising to warning+continue during static module/class discovery. |
tests/test_util_reflection.py |
Adds regression coverage for skipping missing modules and returning an empty list when all are missing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
fde563a to
f10a6bf
Compare
EXTENSION_LIST in ProductionConfig includes optional extensions like liquidissuer that are not installed in source/development setups. Previously, a missing module raised SpecterError and prevented startup. Now logs a warning and continues loading the remaining extensions. This follows the principle that optional extensions should be optional. Fixes cryptoadvance#2496
…e#2496) Two test cases: - Missing module in middle of list: skipped with warning, others load fine - All modules missing: returns empty list, no crash
- Make skip-on-missing behavior opt-in via skip_missing parameter (default False preserves strict behavior for non-extension callers) - Only skip when e.name matches the module being imported; re-raise if an installed module has broken internal imports - Use 'Skipping module' instead of 'Skipping extension' since the function is also used for device modules - Add test for strict (default) behavior - Pass skip_missing=True at Extension call sites in service_manager Addresses Copilot review comments.
f10a6bf to
7fe4f44
Compare
k9ert
approved these changes
Mar 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EXTENSION_LISTinProductionConfigincludes optional extensions likeliquidissuerthat are not shipped with source installs. When any listed module is missing,get_classlist_of_type_clazz_from_modulelist()raises aSpecterErrorand prevents startup entirely.Fix: Replace the
raise SpecterError(...)withlogger.warning(...)+continue, so missing extensions are skipped with a clear log message while the rest of the application loads normally.Before:
After:
One-line logic change in
src/cryptoadvance/specter/util/reflection.py.Closes #2496