fix: keep --ai as a supported init alias#2637
Open
puneetdixit200 wants to merge 4 commits into
Open
Conversation
Contributor
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.
| preset: str = typer.Option(None, "--preset", help="Install a preset during initialization (by preset ID)"), | ||
| branch_numbering: str = typer.Option(None, "--branch-numbering", help="Branch numbering strategy: 'sequential' (001, 002, …, 1000, … — expands past 999 automatically) or 'timestamp' (YYYYMMDD-HHMMSS)"), | ||
| integration: str = typer.Option(None, "--integration", help="Use the new integration system (e.g. --integration copilot). Mutually exclusive with --ai."), | ||
| integration: str = typer.Option(None, "--integration", help="Coding agent integration to use (e.g. --integration copilot). Equivalent to --ai; mutually exclusive with --ai."), |
| assert "Commands will no longer be available" not in normalized_output | ||
| assert "--ai is deprecated" not in normalized_output | ||
| assert "deprecated --ai" not in normalized_output | ||
| assert re.search(r"(--ai.{0,80}deprecated|deprecated.{0,80}--ai)", normalized_output, re.IGNORECASE) is None |
| assert "Commands will no longer be available" not in normalized_output | ||
| assert "--ai is deprecated" not in normalized_output | ||
| assert "deprecated --ai" not in normalized_output | ||
| assert re.search(r"(--ai.{0,80}deprecated|deprecated.{0,80}--ai)", normalized_output, re.IGNORECASE) is None |
cda1475 to
cd13ce6
Compare
Comment on lines
+47
to
+63
| assert "Deprecation Warning" not in output | ||
| assert "no longer be available" not in output | ||
| assert "Commands will no longer be available" not in output | ||
| assert "--ai is deprecated" not in output | ||
| assert "deprecated --ai" not in output | ||
| assert ( | ||
| re.search(r"(--ai.{0,80}deprecated|deprecated.{0,80}--ai)", output, re.IGNORECASE) | ||
| is None | ||
| ) | ||
| assert ( | ||
| re.search(r"(--ai.{0,120}0\.10\.0|0\.10\.0.{0,120}--ai)", output, re.IGNORECASE) | ||
| is None | ||
| ) | ||
| assert ( | ||
| re.search(r"(--ai.{0,120}next steps|next steps.{0,120}--ai)", output, re.IGNORECASE) | ||
| is None | ||
| ) |
Comment on lines
+126
to
+127
| "or generic (requires --ai-commands-dir). Equivalent to --integration; " | ||
| "do not combine them." |
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.
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.