Repository navigation
fix(extensions): fall back to the ID when add sees no name - #5510
Merged
Merged
Conversation
`extension add` printed the catalog entry's name with ext_info['name'], so an entry without one exited with KeyError: 'name' before the download started. github#5308 made search and info fall back to the ID for the same entries; add now does too, as the preset twin already does. Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous)
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change addresses the nameless catalog-entry failure by falling back to the resolved extension ID and adds a focused regression test covering that installation path.
No open issues 🎉
What changed in this PR
Fixes specify extension add <id> so catalog entries without a name no longer fail before downloading, using the extension ID as the display fallback.
Changes:
- Falls back to the resolved extension ID when rendering the download message.
- Adds a regression test for successful installation from a catalog entry missing
name.
| File | Description |
|---|---|
| tests/specify_cli/extensions/test_command_add.py | Adds a regression test verifying that nameless catalog entries install successfully and display the extension ID. |
| src/specify_cli/extensions/command_add.py | Uses the resolved extension ID as the fallback when a catalog entry has no name. |
Review effort: Lite (adaptive)
Collaborator
|
Thank you! |
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.
Description
specify extension add <id>exits 1 withKeyError: 'name'when the catalog entry has noname, before anything is downloaded. #5308 fixed the same entries forextension searchandextension info(#5307): catalog entries are kept without per-field validation, and display falls back to the extension ID. TheDownloading …line inextension_addstill indexedext_info['name']directly, while the same line already uses.get('version', 'unknown')and the preset twin (presets/command_add.py) usespack_info.get('name', preset_id).This reads the name with
.get('name', extension_id), soaddprintsDownloading catalog-extension v1.0.0...and continues. Nothing else on the download path indexesname.Testing
.venv/bin/specify --help(Windows PowerShell:.\.venv\Scripts\specify.exe --help).venv/bin/python -m pytest tests -q(Windows PowerShell:.\.venv\Scripts\python.exe -m pytest tests -q); use affected test paths for focused checks andLC_ALL=en_US.UTF-8on macOSAdded
test_catalog_add_without_entry_name_uses_idtotests/specify_cli/extensions/test_command_add.py. It fails onmain(exit_code1 fromKeyError('name')) and passes with the fix.tests/specify_cli/extensionsandtests/test_extensions.pypass (843 tests);ruff checkis clean on the changed source file.AI Disclosure
AI disclosure: This PR was written by an AI coding agent, Claude Code (model: Claude Opus 5.5), working autonomously on behalf of the account holder, with no human review before submission. The agent found the bug by tracing #5308 to the remaining call site, wrote the fix and the test, ran the tests above, and wrote this description. The commit carries an
Assisted-by:trailer.