fix: keep --ai as a supported init alias#2637
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates the CLI behavior and documentation so the legacy --ai flag no longer emits a deprecation warning and is treated as a short alias for selecting an integration.
Changes:
- Remove the
--aideprecation warning panel fromspecify init. - Update integration tests to assert no deprecation warning is printed for
--ai. - Update docs/README to document
--aias a short alias for--integration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/integrations/test_cli.py | Updates expectations to ensure --ai no longer prints a deprecation warning. |
| src/specify_cli/init.py | Removes deprecation-warning construction/printing and related import; updates --integration help text. |
| docs/reference/core.md | Documents --ai as a short alias and adds an example. |
| README.md | Documents --ai as a short alias and adds an example usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cda1475 to
cd13ce6
Compare
|
AI-assisted follow-up pushed in Verification:
|
0f023bc to
2381193
Compare
|
Rebased/resolved the conflict against current Current head: Verified locally:
|
| | Option | Description | | ||
| | ------------------------ | ------------------------------------------------------------------------ | | ||
| | `--integration <key>` | AI coding agent integration to use (e.g. `copilot`, `claude`, `gemini`). See the [Integrations reference](integrations.md) for all available keys | | ||
| | `--integration <key>` | AI coding agent integration to use (e.g. `copilot`, `claude`, `gemini`). Equivalent to `--ai`; do not combine them. See the [Integrations reference](integrations.md) for all available keys | |
| def _assert_no_ai_deprecation_output(output: str) -> None: | ||
| lower_output = output.lower() |
| ai_related_blocks = [ | ||
| block | ||
| for block in re.split(r"\n\s*\n", lower_output) | ||
| if "--ai" in block | ||
| ] | ||
| for block in ai_related_blocks: | ||
| assert "deprecated" not in block | ||
| assert "0.10.0" not in block | ||
| assert "next steps" not in block |
There was a problem hiding this comment.
Addressed in cf2295b. _assert_no_ai_deprecation_output now strips ANSI itself, normalizes only for whole-output assertions, and splits the raw cleaned output into blocks before checking AI-related sections. I also updated both callers to pass result.output instead of the already-normalized string. Verification: focused 3-test run passed, full tests/integrations/test_cli.py passed (77 tests), specify init --help ran, and git diff --check passed.
| normalized_output = _normalize_cli_output(result.output) | ||
| assert result.exit_code == 0, result.output | ||
| assert "Deprecation Warning" in normalized_output | ||
| assert "--ai" in normalized_output | ||
| assert "deprecated" in normalized_output | ||
| assert "no longer be available" in normalized_output | ||
| assert "0.10.0" in normalized_output | ||
| assert "--integration copilot" in normalized_output | ||
| assert normalized_output.index("Deprecation Warning") < normalized_output.index("Next Steps") | ||
| _assert_no_ai_deprecation_output(normalized_output) |
|
AI-assisted follow-up pushed in This addresses the review-note cleanup around the
Verified locally on the current head:
|
Summary
specify init --ai <key>as a supported short alias instead of warning about removal--aideprecation panel while preserving mutual exclusion with--integration--aialongside--integrationin the core reference and READMECloses #2636.
Verification
uv sync --extra testuv run pytest tests/integrations/test_cli.py::TestInitIntegrationFlag::test_integration_and_ai_mutually_exclusive tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_copilot_does_not_emit_deprecation_warning tests/integrations/test_cli.py::TestInitIntegrationFlag::test_ai_generic_alias_does_not_emit_deprecation_warning -q-> 3 passedPYTHONUTF8=1 PYTHONIOENCODING=utf-8 uv run specify --help-> passedgit diff --check-> passedNote: the full
tests/integrations/test_cli.pysuite reached 68 passed / 1 skipped but 7 unrelated symlink-safety tests failed on this Windows checkout withWinError 1314because symlink creation requires elevated privileges.AI-assisted work
This patch was prepared with AI assistance and manually reviewed. I added the no-deprecation regression expectation first, observed it fail on the existing warning, then reran the affected tests after the implementation change.