Repository navigation
Conversation
In a Spec Kit project with no integration recorded, `specify integration upgrade` printed a yellow warning and exited 0. That broke chained upgrade commands and editor tooling (e.g. `specify self upgrade && specify integration upgrade && ...`), which treated exit 0 as a successful upgrade even though nothing was upgraded, and was inconsistent with `specify integration upgrade <key>` exiting 1 when `<key>` is not installed. Fail with exit code 1, print an error message with an actionable `specify integration install <key>` hint matching `integration use`, and add regression tests covering missing state, empty state payloads, `--force`, and post-uninstall upgrades. Refs github#5338 Assisted-by: Antigravity (model: Gemini 4 Neon (High), autonomous)
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The implementation and regression coverage address missing-integration failure handling across normal, forced, and post-uninstall paths, with no active review issues reported.
No open issues 🎉
What changed in this PR
Updates specify integration upgrade so projects without an installed integration report an error and exit with status 1, preventing automation chains from falsely reporting success.
Changes:
- Prints installation guidance and exits non-zero when no integration is installed, including with
--force. - Adds regression coverage for missing and empty integration state, forced upgrades, and post-uninstall behavior.
- Preserves successful upgrades and existing missing-manifest behavior.
| File | Description |
|---|---|
| tests/specify_cli/integrations/test_command_upgrade.py | Updates expected exit-code behavior and adds regression tests for missing or empty integration state, forced upgrades, and post-uninstall scenarios. |
| src/specify_cli/integrations/command_upgrade.py | Changes the no-installed-integration path to print an error with installation guidance and exit with status 1. |
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
Fixes #5338.
When no integration is recorded in a Spec Kit project,
specify integration upgradepreviously printed a yellow warning (No integration is currently installed.) and exited with code0. This caused chained automation and editor upgrade actions (such asspecify self upgrade && specify integration upgrade && ...) to report success when nothing was upgraded, and was inconsistent withspecify integration upgrade <key>exiting1when<key>is not installed.Changes:
integration_upgradeinsrc/specify_cli/integrations/command_upgrade.pyto print[red]Error:[/red] No integration is currently installed., include theInstall one with: specify integration install <key>guidance matchingspecify integration use, and raisetyper.Exit(1)when no default integration is installed.test_upgrade_no_manifestand external adapter upgrade tests).test_upgrade_no_integration_installedand add regression tests intests/specify_cli/integrations/test_command_upgrade.pycovering missing.specify/integration.json, empty state payloads ({},{"installed_integrations": []},{"integration": null, "installed_integrations": []}),--forcewith no installed integration, and upgrading after uninstalling the last integration.Testing
Set up this checkout's
.venvand editable install using the local development guide. Run commands from the checkout root..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 macOSVerification evidence (macOS, Python 3.14.6):
a4d5712):LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/specify_cli/integrations/test_command_upgrade.py -k "no_integration or after_uninstalling_last_integration" -qfailed all 6 regression cases (assert 0 == 1).LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/specify_cli/integrations/test_command_upgrade.py -q: 74 passed.LC_ALL=en_US.UTF-8 .venv/bin/python -m pytest tests/specify_cli/integrations/ tests/integrations/ -n auto -q: 4887 passed, 8 skipped.uvx ruff@0.15.0 check src tests: All checks passed..venv/bin/python .github/scripts/check_file_helper_migration.py --base upstream/main --head HEAD: passed (exit 0)..venv/bin/specify --helpand.venv/bin/specify integration upgrade --help: passed (exit 0)..specify/directory withoutintegration.json:.venv/bin/specify integration upgradeexited 1 (Error: No integration is currently installed.);.venv/bin/specify integration upgrade --forceexited 1..venv/bin/specify integration install copilot --script sh:.venv/bin/specify integration upgradeexited 0 (Integration 'GitHub Copilot' upgraded successfully)..venv/bin/specify integration uninstall:.venv/bin/specify integration upgradeexited 1.AI Disclosure
AI disclosure: Posted on behalf of @yxshee. Implemented and tested with Antigravity (model: Gemini 4 Neon (High), autonomous mode) for issue triage, code generation, regression test authoring, and validation; the commit carries an
Assisted-by:trailer.