Source Control
What it is
Section titled “What it is”Source Control integrates Foundry with GitHub via a GitHub App installation. It provides repository connection, role inference (frontend, backend, infrastructure, etc.), inline repository pickers across the platform, and feeds code events back into Foundry’s data model.
Why it matters
Section titled “Why it matters”Delivery work produces code. Source control integration closes the loop between Foundry’s planning artifacts and the actual codebase, enabling code-aware features like codebase analysis, gate evidence, and sandbox auto-push.
Key concepts
Section titled “Key concepts”- GitHub App installation:
useGitHubInstallationhook tracks whether the GitHub App is installed for the current org, with state:checking,installed,not_installed,error - Install CTA:
GitHubInstallCTAprompts users to install the GitHub App if not yet configured - Repo picker dropdown:
RepoPickerDropdownprovides a searchable dropdown for selecting repositories, used across tasks, workstreams, and agents - Repo create modal:
RepoCreateModalallows creating new GitHub repositories directly from Foundry - Connect repository inline:
ConnectRepositoryInlineprovides a compact inline widget for connecting a repo - Repo badge:
RepoBadgedisplays a compact repository identifier with icon - Role inference:
inferRepoRoleheuristic function classifies repositories as frontend, backend, infrastructure, monorepo, etc. - Role options: Predefined
ROLE_OPTIONSfor manual role assignment - Repo list hook:
useRepoListfetches available and connected repositories with filtering
How to use it
Section titled “How to use it”- Install the Foundry GitHub App on your GitHub organization (prompted via
GitHubInstallCTAon first use). - Navigate to [Program] > Repositories to connect repos to the program.
- Use the Repo Picker to search and select repositories — roles are auto-inferred.
- Override inferred roles manually if the heuristic is incorrect.
- Connected repos appear as
RepoBadgeicons across tasks, workstreams, and agent configurations. - Create new repositories directly from Foundry via the create modal.
Data model
Section titled “Data model”This feature uses the following tables:
sourceControl/repositories— Connected repository records with rolessourceControl/installations— GitHub App installation state per orgsourceControl/events— Raw GitHub webhook eventssourceControl/pullRequests— PR records synced from GitHubsourceControl/commits— Commit records synced from GitHubsourceControl/deployments— Deployment recordssourceControl/reviews— PR review recordssourceControl/tokenCache— GitHub token cache for API calls