Skip to content

chore: deprecate --ai flag in favor of --integration on specify init#2218

Merged
mnriem merged 2 commits intogithub:mainfrom
mnriem:issue-2169-deprecate-ai-flag
Apr 14, 2026
Merged

chore: deprecate --ai flag in favor of --integration on specify init#2218
mnriem merged 2 commits intogithub:mainfrom
mnriem:issue-2169-deprecate-ai-flag

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented Apr 14, 2026

Description

Implements the deprecation of the legacy --ai flag on specify init in favor of the modern --integration flag, as requested in #2169.

Changes

  • Adds a prominent red deprecation warning panel when --ai is used
  • Displays the equivalent --integration command
  • Handles special case of generic integration with --commands-dir mapping
  • Warning is positioned above "Next Steps" for visibility
  • The --ai flag continues to function (non-breaking change)

Testing

  • Added comprehensive test coverage for the deprecation behavior
  • All existing tests pass (1420+ tests)
  • Manual CLI verification confirms the warning renders correctly

Fixes

Fixes #2169

- 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
Copilot AI review requested due to automatic review settings April 14, 2026 19:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --integration equivalent and a Rich deprecation warning message for --ai.
  • Print a red “Deprecation Warning” panel when --ai is used, positioned before the “Next Steps” panel.
  • Add CLI-level tests covering the warning output (including the generic integration --commands-dir mapping).
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
@mnriem
Copy link
Copy Markdown
Collaborator Author

mnriem commented Apr 14, 2026

Review Feedback Addressed

I've addressed both comments from the code review:

  1. Reuse existing strip_ansi helper

    • Updated _normalize_cli_output() in tests to use the existing strip_ansi function from tests/conftest.py instead of duplicating the ANSI escape pattern regex
    • This ensures consistency and benefits from the more comprehensive escape-sequence pattern used elsewhere
  2. Properly escape paths with spaces

    • Added import shlex to the imports
    • Updated the --integration-options command suggestion to use shlex.quote(ai_commands_dir) when building the replacement command
    • This ensures that paths containing spaces (or special characters) will be correctly parsed by the generic integration's shlex.split() call

The changes maintain the deprecation warning functionality while addressing the technical concerns raised in the review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --ai is used, including the equivalent --integration ... command (with special-case mapping for generic + --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

@mnriem mnriem merged commit 39c7b04 into github:main Apr 14, 2026
12 checks passed
@mnriem mnriem deleted the issue-2169-deprecate-ai-flag branch April 14, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate --ai flag in favor of --integration

2 participants