Add Gong CLI setup provider#141
Conversation
WalkthroughThis PR adds Gong as a CLI setup provider by implementing a public-to-internal provider ID mapping mechanism. The public name ChangesGong Provider Resolution and Setup Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/cli/src/lib/providers.ts (1)
70-87: ⚖️ Poor tradeoffHardcoded 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_OVERRIDESnow pins the internalgong-oauthID into the CLI. If Core ever renames its internal Gong provider key, this map silently breaks setup routing with no compile-time signal. TheresolveProviderimplementation itself is correct (normalization + safe?? cliNamefallback 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
📒 Files selected for processing (5)
.changeset/gong-cli-provider.mdpackages/cli/src/commands/integrations/setup.tspackages/cli/src/lib/providers.tspackages/cli/tests/commands/integrations/setup.test.tspackages/cli/tests/lib/providers.test.ts
Summary
gongto the CLI provider listgong-oauthprovider keygongVerification
bun test packages/cli/tests/lib/providers.test.ts packages/cli/tests/commands/integrations/setup.test.tsbunx 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.mdbun run build --filter=@outlit/toolscd packages/cli && bun run typecheckSummary by CodeRabbit
Release Notes
New Features
Improvements