Skip to content

CLI-549 Add sonar integrate antigravity command and install orchestration#407

Open
nquinquenel wants to merge 1 commit into
feature/nq/CLI-548-integrate-antigravityfrom
feature/nq/CLI-549-add-command-antigravity
Open

CLI-549 Add sonar integrate antigravity command and install orchestration#407
nquinquenel wants to merge 1 commit into
feature/nq/CLI-548-integrate-antigravityfrom
feature/nq/CLI-549-add-command-antigravity

Conversation

@nquinquenel

@nquinquenel nquinquenel commented Jun 8, 2026

Copy link
Copy Markdown
Member

Register integrate antigravity in the command tree, add integrateAntigravity() orchestration, register antigravity-cli in ALL_INTEGRATIONS, and CAG.

More to come


Summary by Gitar

  • New command:
    • Added sonar integrate antigravity command to orchestrate secrets hooks and agentic integration.
    • Implemented command tree registration, orchestration logic in integrateAntigravity(), and antigravity-cli integration declaration.
  • Configuration & Constants:
    • Defined ANTIGRAVITY_PROJECT_AGENTS_DIR and global config paths in config-constants.ts for consistent file placement.
  • Testing:
    • Added comprehensive integration tests for project-level and global installs, option validation, and authentication checks.
    • Included unit tests for command orchestration and install target resolution logic.

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Jun 8, 2026

Copy link
Copy Markdown

CLI-549

Comment thread tests/unit/cli/commands/integrate/antigravity/integrate.test.ts
Comment thread src/cli/command-tree.ts
@nquinquenel nquinquenel force-pushed the feature/nq/CLI-549-add-command-antigravity branch from b2809b1 to 24c64c2 Compare June 8, 2026 09:50
@nquinquenel nquinquenel marked this pull request as ready for review June 8, 2026 11:47
@nquinquenel nquinquenel force-pushed the feature/nq/CLI-549-add-command-antigravity branch from 24c64c2 to 080e1e8 Compare June 8, 2026 12:06
@gitar-bot

gitar-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Integrates the 'antigravity' command and orchestration logic, resolving previous issues with test assertions and command descriptions. The implementation includes comprehensive integration tests and centralized path configurations.

✅ 2 resolved
Quality: Antigravity command description advertises unimplemented features

📄 src/cli/command-tree.ts:253-255 📄 src/cli/commands/integrate/antigravity/declaration.ts:35-48
The command help text states: 'This will install secrets scanning hooks, configure SonarQube Agentic Analysis and MCP Server.' However, the antigravity integration declaration currently exposes only a no-op 'integration-setup' feature; per the code comments, secrets hooks, SQAA, and MCP are deferred to CLI-550/CLI-551. Running the command today does none of what the description promises, which is misleading to users. Consider tempering the description until those features land (e.g. note that setup is in progress) so the help text matches actual behavior.

Bug: Unawaited rejects assertion makes 'invalid token' test ineffective

📄 tests/unit/cli/commands/integrate/antigravity/integrate.test.ts:86-91
The it('aborts when token is invalid', ...) callback is synchronous and the expect(...).rejects.toThrow('Token is invalid.') assertion is neither awaited nor returned. As a result the rejection assertion is fire-and-forget: the test completes before the promise settles, so a regression where integrateAntigravity resolves (or throws a different error) would not fail this test. The promise is also left dangling, which can surface as an unhandled rejection in another test. Additionally, expect(installIntegrationSpy).not.toHaveBeenCalled() runs synchronously immediately after kicking off the async call, so it passes trivially regardless of behavior. Make the callback async and await the rejection before asserting on the spy.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! I think it's great to go in small increments. I would suggest to target master branch directly but not declare the new feature in command-tree.

export interface AntigravityIntegrationOptions extends IntegrateAgentOptions {
projectRoot?: string;
globalSecretsHookExists?: boolean;
/** Install PostInvocation SQAA hook (project scope). Wired in CLI-551. */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's fine to drop this comment

@nquinquenel nquinquenel Jun 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I like to write comments on feature branch to make sure I don't forget about implementation of each tickets, but thanks for suggesting to target master directly! I think it makes sense, I'll remove all the temporary bits I added

}

/**
* Minimal declarative integration for CLI-549 orchestration. Secrets hooks,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

TMI ? :D

shouldInstall: () => askUser(),
},
createContextAugmentationFeature<AntigravityIntegrationOptions>({
agentDisplayName: 'Antigravity',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will the same integration also work with Antigravity IDE? Or only CLI? Depending on the answer we might want to update this display name or the integration ID on line 32

claudeIntegration,
copilotIntegration,
codexIntegration,
antigravityIntegration,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think at some point we said we should not have feature branches. So instead I would suggest removing this change / making antigravity command hidden, and merging directly to master. We can also discuss with Damien.

Comment thread src/cli/command-tree.ts
.addHelpText('after', projectKeyExtraHelp)
.authenticatedAction((auth, options: IntegrateAgentOptions) => integrateCodex(options, auth));

integrateCommand

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See comment above. Maybe it's best to keep the groundwork but remove wiring from customer-facing surfaces.

// ---------------------------------------------------------------------------

/** Antigravity workspace agents directory (relative to the project root). */
export const ANTIGRAVITY_PROJECT_AGENTS_DIR = '.agents';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I might be wrong but I vaguely remember Codex also having a similar path? Just something to double-check, not to have duplicate or overwritten integrations

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really need this file? I think similar stuff is covered in the integration test

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.

2 participants