Skip to content

Add Gong CLI setup provider#141

Open
leo-paz wants to merge 1 commit into
mainfrom
codex/gong-cli-support
Open

Add Gong CLI setup provider#141
leo-paz wants to merge 1 commit into
mainfrom
codex/gong-cli-support

Conversation

@leo-paz

@leo-paz leo-paz commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add gong to the CLI provider list
  • resolve CLI Gong setup calls to Core's internal gong-oauth provider key
  • keep public CLI output/URLs using gong
  • add focused setup/provider tests and a CLI patch changeset

Verification

  • bun test packages/cli/tests/lib/providers.test.ts packages/cli/tests/commands/integrations/setup.test.ts
  • bunx biome check packages/cli/src/lib/providers.ts packages/cli/src/commands/integrations/setup.ts packages/cli/tests/lib/providers.test.ts packages/cli/tests/commands/integrations/setup.test.ts .changeset/gong-cli-provider.md
  • bun run build --filter=@outlit/tools
  • cd packages/cli && bun run typecheck

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Gong as a supported CLI setup provider, enabling Gong OAuth authentication through the CLI integration setup flow.
  • Improvements

    • Enhanced provider identifier resolution to ensure setup calls correctly route through Core's OAuth system.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR adds Gong as a CLI setup provider by implementing a public-to-internal provider ID mapping mechanism. The public name "gong" is resolved to the Core provider ID "gong-oauth" during setup flows, while the public name is preserved in client-facing artifacts.

Changes

Gong Provider Resolution and Setup Integration

Layer / File(s) Summary
Provider resolution infrastructure
packages/cli/src/lib/providers.ts, packages/cli/tests/lib/providers.test.ts
PROVIDER_NAMES now includes "gong". A new exported resolveProvider(input) function normalizes the input and maps "gong" to the internal Core ID "gong-oauth". Documentation for ProviderCapability.cliName clarifies that Core returns a public provider ID. Tests verify the new provider is listed and the resolution mapping works correctly.
Setup command flow integration
packages/cli/src/commands/integrations/setup.ts, packages/cli/tests/commands/integrations/setup.test.ts
The setup command now imports resolveProvider and uses it in a new resolveCapabilityProviderId() helper. All three setup flows (API-key, OAuth, and follow-up steps) call Core tools with the resolved provider ID. The integration test mock remaps gong-oauth back to gong in public-facing URLs. A new Gong OAuth test verifies the complete flow with proper status, session ID, and provider mapping.
Release changelog
.changeset/gong-cli-provider.md
Patch release entry for @outlit/cli documents Gong as a new CLI setup provider with routing through Core's Gong OAuth provider key.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • OutlitAI/outlit-sdk#136: Implements the foundational integrations setup command and provider capabilities framework that this PR builds upon to add Gong provider resolution.

Poem

🐰 A Gong so bright, now in CLI's sight,
With aliases mapped from public to light,
Setup flows dance through Core's OAuth door,
While gong-oauth hides what once was lore. 🔑

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Gong as a CLI setup provider. It is concise, clear, and directly reflects the primary objective of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/gong-cli-support

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/cli/src/lib/providers.ts (1)

70-87: ⚖️ Poor tradeoff

Hardcoded internal alias on the CLI duplicates a contract Core is documented to own.

The header comment (Lines 48-51) states "Core owns aliases, internal provider IDs, setup modes...", yet PROVIDER_ID_OVERRIDES now pins the internal gong-oauth ID into the CLI. If Core ever renames its internal Gong provider key, this map silently breaks setup routing with no compile-time signal. The resolveProvider implementation itself is correct (normalization + safe ?? cliName fallback for unknown inputs).

Consider sourcing the internal ID from the capability payload returned by Core rather than maintaining a parallel constant, or at minimum document why this one alias is mirrored client-side.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/lib/providers.ts` around lines 70 - 87,
PROVIDER_ID_OVERRIDES hardcodes Core's internal provider ID (gong ->
"gong-oauth") in the CLI which duplicates a contract Core is documented to own;
remove or stop relying on PROVIDER_ID_OVERRIDES and instead use the provider ID
from Core's capabilities payload at runtime (e.g., fetch the capability that
lists provider IDs and map normalized input from
normalizeProviderInput/resolveProvider to the returned id), or if immediate
removal is unsafe, add a clear comment on PROVIDER_ID_OVERRIDES explaining why
this alias is mirrored and add a runtime check in resolveProvider to prefer the
Core-provided id when available; update references to PROVIDER_NAMES,
normalizeProviderInput, and resolveProvider accordingly so the CLI no longer
risks a stale hardcoded internal id.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/cli/src/lib/providers.ts`:
- Around line 70-87: PROVIDER_ID_OVERRIDES hardcodes Core's internal provider ID
(gong -> "gong-oauth") in the CLI which duplicates a contract Core is documented
to own; remove or stop relying on PROVIDER_ID_OVERRIDES and instead use the
provider ID from Core's capabilities payload at runtime (e.g., fetch the
capability that lists provider IDs and map normalized input from
normalizeProviderInput/resolveProvider to the returned id), or if immediate
removal is unsafe, add a clear comment on PROVIDER_ID_OVERRIDES explaining why
this alias is mirrored and add a runtime check in resolveProvider to prefer the
Core-provided id when available; update references to PROVIDER_NAMES,
normalizeProviderInput, and resolveProvider accordingly so the CLI no longer
risks a stale hardcoded internal id.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82b591a0-077a-41a3-adaa-5c46b464afa3

📥 Commits

Reviewing files that changed from the base of the PR and between 8c915f2 and 5ef3096.

📒 Files selected for processing (5)
  • .changeset/gong-cli-provider.md
  • packages/cli/src/commands/integrations/setup.ts
  • packages/cli/src/lib/providers.ts
  • packages/cli/tests/commands/integrations/setup.test.ts
  • packages/cli/tests/lib/providers.test.ts

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.

1 participant