feat(cli): add github command group for workspace GitHub connections#113
Draft
AmanVarshney01 wants to merge 1 commit into
Draft
feat(cli): add github command group for workspace GitHub connections#113AmanVarshney01 wants to merge 1 commit into
AmanVarshney01 wants to merge 1 commit into
Conversation
Adds prisma-cli github list/connect/install so agents and headless sessions can drive the GitHub connection flow the Console gained in pdp-control-plane#4406: list connected and connectable accounts, connect an already-installed account to the active workspace without a GitHub round trip, and mint the install URL for brand-new accounts. Connect resolution is non-interactive by design: missing or unknown accounts fail with structured errors carrying the connectable options in meta and as runnable next steps. Real mode calls the Management API endpoints from pdp-control-plane#4408; the connectable/connect paths are called through a single typed seam until the published SDK carries them. Fixture mode is fully covered by tests.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Agent-friendly counterpart to the Console work in pdp-control-plane#4396/#4402/#4406/#4407: agents and headless sessions need to drive the GitHub connection flow without a browser. The critical piece is connecting an org that already has the Prisma GitHub App installed — the only path GitHub itself cannot round-trip (no callback fires when nothing changes), now exposed by pdp-control-plane#4408.
Commands
connectwithout an account fails withGITHUB_ACCOUNT_REQUIRED, carrying the connectable options inerror.meta.connectableand as runnable next steps — an agent picks and reruns, no prompt-blocking. Unknown accounts fail the same way withGITHUB_ACCOUNT_NOT_FOUND.GITHUB_CONNECT_FAILEDafter the platform self-heals its stale rows.Draft status: one dependency
Real mode calls the two new Management API endpoints from pdp-control-plane#4408 (open). The published
@prisma/management-api-sdkdoes not carry those paths yet, so they go through a single documented, fully-typed seam inlib/github/provider.ts— delete-marked for when the SDK regen lands after #4408 merges. Everything else (/v1/scm-installations,install-intents) uses the typed SDK client directly.Undraft once #4408 is merged and the SDK is bumped (seam removal is a follow-up commit here).
Testing
6 fixture-mode CLI tests (
tests/github.test.ts): list with per-account dedupe (newest installation wins), connect by login and by numeric id, structuredGITHUB_ACCOUNT_REQUIREDwith machine-readable options,GITHUB_ACCOUNT_NOT_FOUNDwith the same, install URL. Full suite 615 green; typecheck clean. Real mode needs a live check against #4408 once deployed.