Repository navigation
fix: preserve existing priority from registry when installing/refreshing bundles - #5331
Conversation
…ing bundles When or is run, the existing user-set priorities (via / ) were being reset to the bundle's declared priority. This fix reads the existing priority from the registry first, and only falls back to the component's declared priority or DEFAULT_PRIORITY if no existing priority is found. Fixes: github#5318
There was a problem hiding this comment.
🟡 Changes recommended
Singular component-kind checks skip registry lookups for presets and extensions, so refresh still overwrites saved priorities, with no regression tests covering preservation.
3 open issues
What changed in this PR
This PR aims to preserve user-set preset and extension priorities when Specify CLI installs or refreshes bundles.
Changes:
- Adds registry-priority lookups to both component installers.
- Falls back to the bundle-declared priority or
DEFAULT_PRIORITYwhen no saved priority exists.
Project tests were not run in this review environment.
AI-generated review by GitHub Copilot (model: unknown; automated mode) for the requesting contributor; analysis and wording are AI-generated.
| File | Description |
|---|---|
src/specify_cli/bundles/primitives.py |
Adds saved-priority selection for preset and extension installation paths. |
Review effort: Balanced (auto)
|
Please address Copilot feedback |
ComponentRef.kind is "presets"/"extensions", so the singular checks never read the registry. Add tests covering registry-priority preservation on install/refresh and fallback to declared/default priority.
|
Thanks — addressed the Copilot feedback in 60a3a1b:
|
There was a problem hiding this comment.
🟡 Changes recommended
Unnormalized registry priorities can cause refresh/update failures for stored string or zero values, requiring normalization and a declared/default fallback in both bundle and extension paths.
1 open issue
3 resolved since last review
Review effort: Balanced (auto)
|
Please address Copilot feedback |
Registry data may hold strings, zero or booleans; normalize via normalize_priority and fall back to the declared/default priority so bundle refresh/update does not fail. Add regression tests for both presets and extensions.
|
Thanks — addressed the second Copilot review in e83e024:
|
|
Thank you! |


Description
Fix: preserve existing priority from registry when installing/refreshing bundles
When
bundle install --refreshorbundle updateis run, theexisting user-set priorities (via
specify preset set-priority/specify extension set-priority) were being reset to the bundle'sdeclared priority. This fix reads the existing priority from the
registry first, and only falls back to the component's declared
priority or DEFAULT_PRIORITY if no existing priority is found.
Testing
Manual testing showed that running
bundle install --refreshaftersetting a priority via
specify extension set-prioritynow preservesthe user-set priority instead of resetting it to 10.
See the commit for details: fix/bundle-priority-preservation