Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Manage shared web env var additions and rotations with `pnpm web:env set <VARIAB
- `GITHUB_LITE_APP_CLIENT_ID` - OAuth Client ID for the lite GitHub App install/login flow. [PUBLIC]
- `GITHUB_MULTIPLE_INSTALLATION_ORGANIZATION_IDS` - Comma-separated Kilo organization UUIDs allowed to connect multiple GitHub App installations. Unset or empty disables multiple installations for all organizations. [SERVER]
- `GITHUB_CONNECTION_MANAGEMENT_ENABLED` - Set to exact `true` to admit new existing-installation connection management and local disconnect. Unset or any other value keeps new management admission disabled without changing incumbent GitHub integration workflows. [SERVER]
- `PER_REPO_SETTINGS` - Set to exactly `true` to reveal the Repository Customizations UI (per-installation default AI model / PR review mode, plus per-repository overrides) on the GitHub integration settings pages, for both personal accounts and organizations. Defaults to disabled so the feature can ship dark. [SERVER]
- `GITHUB_ADMIN_STATS_TOKEN` - Token for admin GitHub API stats lookups; used in `apps/web/src/scripts/backfill-pr-author-github-ids.ts`. `[SECRET]`
- `GITHUB_CLI_PAT` - GitHub personal access token for `gh` CLI operations inside contractors; used in `services/gastown/container/src/process-manager.ts`. `[SECRET]`
- `GITHUB_TOKEN` - Generic GitHub token for API calls used as fallback when `GIT_TOKEN` or `GITHUB_CLI_PAT` is absent; used in `services/gastown/container/src/process-manager.ts`. `[SECRET]`
Expand Down
118 changes: 0 additions & 118 deletions apps/storybook/stories/GitHubRepositoryCustomizations.stories.tsx

This file was deleted.

44 changes: 32 additions & 12 deletions apps/web/src/components/integrations/GitHubIntegrationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useModelSelectorList } from '@/app/api/openrouter/hooks';
import { buildGitHubInstallState } from './github-install-state';
import { useConfirm } from '@/components/ui/confirm';
import { OrganizationGitHubInstallations } from './OrganizationGitHubInstallations';
import { InstallationCustomizations } from './GitHubRepositoryCustomizationsPreview';

type GitHubIntegrationDetailsProps = {
organizationId?: string;
Expand All @@ -40,6 +41,10 @@ type GitHubIntegrationDetailsProps = {
existingPendingOrg?: string;
appReturnPath?: string;
onInstallationDetected?: () => void;
/** Reveals the Repository Customizations UI (default AI model / PR review
* mode plus per-repository overrides) behind the PER_REPO_SETTINGS flag.
* Computed server-side and threaded down since this is a client component. */
perRepoSettingsEnabled?: boolean;
};

/**
Expand Down Expand Up @@ -233,7 +238,10 @@ export function GitHubIntegrationDetails(props: GitHubIntegrationDetailsProps) {
<GitHubIntegrationOutcomeToasts {...props} />
{props.organizationId && !props.appReturnPath ? (
<div className="space-y-6">
<OrganizationGitHubInstallations organizationId={props.organizationId} />
<OrganizationGitHubInstallations
organizationId={props.organizationId}
perRepoSettingsEnabled={props.perRepoSettingsEnabled}
/>
<Card>
<CardHeader>
<div className="space-y-1.5">
Expand Down Expand Up @@ -274,6 +282,7 @@ function GitHubIntegrationDetailsContent({
pendingApproval,
appReturnPath,
onInstallationDetected,
perRepoSettingsEnabled,
}: GitHubIntegrationDetailsProps) {
const trpc = useTRPC();
const queryClient = useQueryClient();
Expand Down Expand Up @@ -899,17 +908,19 @@ function GitHubIntegrationDetailsContent({
</div>

{/* Model Selection */}
<div className="space-y-3 rounded-lg border p-4">
<ModelCombobox
label="AI Model"
helperText="Select the AI model to use when responding to GitHub bot mentions"
models={modelOptions}
value={selectedModel}
onValueChange={handleModelChange}
isLoading={isLoadingModels}
placeholder="Select a model"
/>
</div>
{!perRepoSettingsEnabled && (
<div className="space-y-3 rounded-lg border p-4">
<ModelCombobox
label="AI Model"
helperText="Select the AI model to use when responding to GitHub bot mentions"
models={modelOptions}
value={selectedModel}
onValueChange={handleModelChange}
isLoading={isLoadingModels}
placeholder="Select a model"
/>
</div>
)}

{/* Actions */}
<div className="flex flex-wrap gap-3">
Expand Down Expand Up @@ -1000,6 +1011,15 @@ function GitHubIntegrationDetailsContent({
</CardContent>
</Card>

{isInstalled && installation && !isPendingApproval && perRepoSettingsEnabled && (
<InstallationCustomizations
integrationId={installation.id}
organizationId={organizationId}
models={modelOptions}
initiallyOpen={false}
/>
)}

{!organizationId ? (
<Card id="github-identity">
<CardHeader>
Expand Down
Loading
Loading