feat(cli): install the organization's GitHub App from the CLI

Merged
SA
1mo ago
+145-2

Summary

  • New internal-audience group superset integrations, starting with github connect|status|disconnect for the organization's GitHub App. This is not superset connections github, which is a person's own GitHub account.
  • Cloud environments can only check out repos the org's App can see. Until now, installing the App meant going through the web Integrations page, so a CLI-only setup got stuck at "No repositories connected".

How it works

  • connect opens /api/github/install?organizationId=…, the same URL the web Integrations page uses. It then polls integration.github.getInstallation until the row exists, for up to 10 minutes. --no-wait just prints the URL.
    • The route authenticates with the browser's Superset session, so the browser must be signed in (as with plugins connect).
    • If the org already has an installation, it reports that instead.
  • status shows the installation's account and the repo count.
  • disconnect asks you to type the account name in a terminal, or needs --yes without one, because it removes the repos from every environment in the org. The server still restricts it to org admins.
  • environments repos now points an org with no repos at superset integrations github connect.
  • Existing guard: the callback already refuses an installation that another org owns, so choosing superset-sh from a test org can't take it away from Superset.

Manual QA (against production, read-only)

  • integrations github status in Superset: "Installed on superset-sh; 23 repositories".
  • integrations github status in App Review: "not installed", pointing to connect.
  • integrations github connect --no-wait in App Review prints the install URL for that org.
  • The full browser install into App Review: next, during the onboarding dry run.

Testing

  • bun run typecheck (cli)
  • biome check

Summary by cubic

Adds superset integrations github connect|status|disconnect to install the organization's GitHub App from the CLI, so a CLI-only setup no longer gets stuck at "No repositories connected" — previously the only way to install the App was the web Integrations page.

  • connect opens the same install URL the web Integrations page uses and polls until the installation exists, up to 10 minutes; --no-wait only prints the URL.
  • status shows the account the App is installed on and the repo count; disconnect asks you to type the account name, or needs --yes without a terminal, because it removes the repos from every environment in the org.
  • environments repos now points at the new connect command instead of Settings.
  • Both connect commands now frame the URL as a fallback ("If your browser did not open…") rather than claiming the browser opened the page.

Summary by CodeRabbit

  • New Features
    • Added CLI commands to connect a GitHub App installation, check its status and connected repositories, and disconnect it. You can wait for setup to finish or get instructions to complete it later.
    • Added integrations to the CLI’s account and app help command list.
  • Improvements
    • Updated the recovery hint shown when no repositories are connected to direct you to the GitHub integration connect command.
    • Clarified whether to open the GitHub authorization link when the browser does not open automatically.