Repository navigation
Conversation
`extension add` and `extension enable` deploy the templates an extension declares in `provides.config`, and bundle install and refresh do the same (github#4285), but `extension update` never called scaffold_config. When a new version introduces a config template, the updated project has no `<ext>-config.yml` while a fresh install of that version does, and `extension enable` cannot deploy it either: it stops early because the extension is already enabled. Scaffold once the install has restored the project's existing configs, so those are skipped exactly as before, and report deployed and failed templates under the update line, as `extension add` does. Assisted-by: Claude Code (model: Claude Opus 5.5, autonomous) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
When a new extension version adds a
provides.configtemplate,specify extension updateinstalls it but never creates the project's<ext>-config.yml. A freshspecify extension addof the same version does create it. Bundle install and refresh do too, since #4285 fixed the same gap there (#4283).specify extension enablecan't fill the gap either, because it exits early with "already enabled". So an updated project silently lacks a config file that the new version expects.Root cause:
run_update_command()in_command_update_transaction.pyinstalls the new archive and copies the backed-up config files back, but never callsExtensionManager.scaffold_config(). The other install paths all do:command_add.py,command_enable.pyandbundles/primitives.py.The fix calls
manager.scaffold_config(extension_id)right after the backed-up configs are restored. Existing files are therefore skipped, so a user's customized config is never replaced. Deployed and failed templates are reported under the "Updated to" line, with the same wording asextension add. A rollback restores the extension directory, which also removes anything scaffolded.Reproduction with the real CLI against a local catalog (
SPECKIT_CATALOG_URL=http://localhost:8765/...) servingdemo1.0.0 (no config), then 1.1.0, which declaresdemo-config.ymlfromconfig-template.yml:For comparison,
specify extension add demostraight at 1.1.0 onmainprintsConfig scaffolded: • .specify/extensions/demo/demo-config.yml.Testing
uv run specify --helpuv sync && uv run pytestmainand on this branchNew tests in
tests/specify_cli/extensions/test_command_update.py. They use a real zip archive and the real install path; only the catalog lookup and download are patched.test_update_scaffolds_config_declared_by_new_versiontest_update_keeps_existing_config_over_new_template: a customized config isn't replacedtest_update_warns_when_declared_config_cannot_be_scaffoldedOn
main, the first and third fail and the second passes. The first fails withtest-ext-config.ymlmissing. The third fails because "Config templates not scaffolded" is missing from the output. All three pass with the change, and the whole file gives 23 passed.tests/specify_cli/extensions,tests/test_extensions.py,tests/specify_cli/bundles): 1589 passed.tests/test_*_python_parity.pyfiles occur identically on unmodifiedmainon this machine under full-suite load; those files pass when run on their own (257 passed, 112 skipped).uvx ruff@0.15.0 check src tests: cleanNote: open PR #5005 edits a hunk just above this insertion point for a different concern (re-registering commands on update), so at most a trivial conflict.
AI Disclosure
AI disclosure: Claude Code (model: Claude Opus 5.5, max reasoning effort, autonomous agent mode) opened this PR on behalf of @yxshee. A Claude Code subagent (same model, autonomous) found the bug and wrote the fix and tests. The lead agent independently re-ran the new tests against
mainand the branch, reproduced the before and after behavior with the real CLI, reviewed the diff, and wrote this description. No human reviewed the change line by line before it was opened.🤖 Generated with Claude Code