Skip to content

fix(integrations): make build_exec_args declarative#2424

Open
markuswondrak wants to merge 1 commit intogithub:mainfrom
markuswondrak:fix/declarative-build-exec-args
Open

fix(integrations): make build_exec_args declarative#2424
markuswondrak wants to merge 1 commit intogithub:mainfrom
markuswondrak:fix/declarative-build-exec-args

Conversation

@markuswondrak
Copy link
Copy Markdown

Description

Fixes #2416.

This moves the default build_exec_args() implementation to IntegrationBase and makes the common CLI dispatch variations declarative via exec_* attributes.

It removes repeated per-integration boilerplate while keeping the special cases from the issue explicit:

  • CodexIntegration uses the exec subcommand and --json
  • DevinIntegration omits JSON output args
  • GooseIntegration opts out of CLI dispatch entirely

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv sync && uv run pytest
  • Tested with a sample project (if applicable)

Additional validation:

  • uvx ruff check src/
  • uv run pytest tests/test_workflows.py -q
  • Attempted uv sync --extra test and uv run pytest, but the full suite hung in this environment when an unrelated spawned gemini -p /speckit.plan process did not return

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

This PR was written primarily with GitHub Copilot CLI assistance. I reviewed the diff, ran the checks above, and prepared the final commit and PR contents manually.

Centralize non-interactive CLI dispatch argument construction on IntegrationBase and let integrations declare prompt, model, and JSON variations with exec_* attributes.\n\nThis fixes the inherited dispatch defaults called out in github#2416 and keeps special cases like Codex, Devin, and Goose explicit without per-integration boilerplate.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markuswondrak markuswondrak requested a review from mnriem as a code owner April 30, 2026 17:38
Copilot AI review requested due to automatic review settings April 30, 2026 17:38
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

Refactors integration CLI dispatch to centralize the default build_exec_args() behavior in IntegrationBase, making common CLI variations configurable via declarative exec_* attributes (per #2416).

Changes:

  • Add declarative exec_* attributes on IntegrationBase and implement the default build_exec_args() using them.
  • Remove duplicated build_exec_args() overrides from shared integration base classes; configure special cases via attributes (Codex/Devin/Goose).
  • Extend workflow tests to cover the new declarative behaviors and special cases.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_workflows.py Adds tests validating new declarative CLI arg construction and special-case integrations.
src/specify_cli/integrations/base.py Introduces declarative dispatch attributes and centralizes build_exec_args() in IntegrationBase; removes redundant overrides.
src/specify_cli/integrations/codex/init.py Switches Codex to declarative subcommand dispatch + --json output flag.
src/specify_cli/integrations/devin/init.py Declares Devin’s lack of JSON output args via exec_json_args = ().
src/specify_cli/integrations/goose/init.py Explicitly opts Goose out of CLI dispatch via exec_mode = "none".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +151 to +165
if not self.config or not self.config.get("requires_cli"):
return None
if self.exec_mode == "none":
return None

args = [self.key]

if self.exec_mode == "subcommand" and self.exec_subcommand:
args.append(self.exec_subcommand)

if self.exec_mode == "flag":
args.extend([self.exec_prompt_flag, prompt])
elif self.exec_mode == "subcommand":
args.append(prompt)

Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

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

Please address Copilot feedback. If not applicable, please explain why

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.

[Bug]: Systematic build_exec_args() audit — CLI dispatch flags unverified for 11+ integrations

3 participants