chore: deprecate --ai flag in favor of --integration on specify init#2218
chore: deprecate --ai flag in favor of --integration on specify init#2218mnriem merged 2 commits intogithub:mainfrom
Conversation
- Adds deprecation warning when --ai is used - Shows equivalent --integration command replacement - Handles generic integration with --commands-dir mapping - Adds comprehensive test coverage for deprecation behavior - Warning displays as prominent red panel above Next Steps - --ai flag continues to function (non-breaking change) Fixes github#2169
There was a problem hiding this comment.
Pull request overview
Deprecates the legacy specify init --ai flag in favor of the newer --integration flow by emitting a prominent Rich warning panel (while keeping --ai functional for now), and adds tests to validate the warning content and placement.
Changes:
- Add helper functions to generate a
--integrationequivalent and a Rich deprecation warning message for--ai. - Print a red “Deprecation Warning” panel when
--aiis used, positioned before the “Next Steps” panel. - Add CLI-level tests covering the warning output (including the generic integration
--commands-dirmapping).
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Builds and prints the --ai deprecation warning and suggested --integration equivalent. |
tests/integrations/test_cli.py |
Adds tests asserting the deprecation warning content/ordering for --ai usage (including generic mapping). |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Use existing strip_ansi helper from conftest instead of duplicating ANSI escape pattern - Properly escape ai_commands_dir with shlex.quote() to handle paths with spaces - Add shlex import to support proper command-line argument escaping
Review Feedback AddressedI've addressed both comments from the code review:
The changes maintain the deprecation warning functionality while addressing the technical concerns raised in the review. |
There was a problem hiding this comment.
Pull request overview
Deprecates the legacy specify init --ai flag in favor of --integration by emitting a visible deprecation warning while keeping --ai functional for backward compatibility (per #2169).
Changes:
- Add Rich “Deprecation Warning” panel when
--aiis used, including the equivalent--integration ...command (with special-case mapping forgeneric+--ai-commands-dir→--integration-options). - Ensure the warning is rendered above the “Next Steps” panel.
- Add CLI-level tests verifying the warning content and its placement in output.
Show a summary per file
| File | Description |
|---|---|
tests/integrations/test_cli.py |
Adds normalization helper + new tests asserting --ai deprecation warning content/ordering and generic mapping behavior. |
src/specify_cli/__init__.py |
Builds and prints a deprecation warning panel for legacy --ai, including an --integration equivalent command string. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
Description
Implements the deprecation of the legacy
--aiflag onspecify initin favor of the modern--integrationflag, as requested in #2169.Changes
--aiis used--integrationcommand--commands-dirmapping--aiflag continues to function (non-breaking change)Testing
Fixes
Fixes #2169