Repository navigation
feat(coder): clone GitLab, Bitbucket and Azure DevOps repos in coder_prepare_repo - #703
Merged
Merged
Conversation
…prepare_repo coder_prepare_repo minted a GitHub App token itself and refused every other provider, although the platform already vends credentials for all four to session containers. It now asks those same vendors (GitCredentials::Vendor, AzureDevops::GitCredentialService), so the session still has to hold the repository and Azure's authorization chain applies unchanged. GitHub, GitLab and Bitbucket authenticate through the existing credential helper, now fed username and password from the environment. Azure DevOps needs a bearer header for Entra tokens, which the helper protocol cannot carry before git 2.46, so it goes through --config-env=http.extraheader. Neither puts the secret in argv or on the workspace disk. Unlike the per-repository GitHub token, a GitLab, Bitbucket or Azure PAT is the connection's own; the Coder guide's Limits now says what that exposes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Artem Petrov <[email protected]>
NOX73
added a commit
that referenced
this pull request
Nov 11, 2026
…s-0-1-0 * origin/develop: feat(coder): clone GitLab, Bitbucket and Azure DevOps repos in coder_prepare_repo (#703) fix(agents): show each runtime's own logo everywhere (#704) feat(teams): assign cards to a team and run triggers as a team (#701) feat(agents): collect the Copilot CLI transcript as a session log (#700) fix(agents): keep Grok and Antigravity conversations in the terminal scrollback (#698) feat(billing): redesign the Billing tab around active and previous subscriptions (#646) feat(web): switch the UI, admin, public pages and emails to Inter (#699) chore(deps): weekly dependency batch — aws-sdk-core 3.267 retry fix, prism 2, Mantine 9.7.5, runner Go 1.27.4 (#697) fix(board): leave archived tasks out of agent board listings (#690) feat(agents): add GitHub Copilot CLI as an agent runtime (#684) feat(runners): the callback proxy — the proxy sidecar, the host runner relay and the gateway proxy route (task #216, 8b) (#677) Signed-off-by: Rozhnov Alexandr <[email protected]>
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
coder_prepare_repocloned only GitHub and public repositories. Any GitLab,Bitbucket or Azure DevOps repository attached to a session was refused with
<provider> repositories are not supported yet — only GitHub and public clones.The platform already issues credentials for all four providers to session
containers. Only the Coder path minted its own GitHub token.
What changes
Coder::RepoBootstrapgets the credential from the same services that answera session container's git:
GitCredentials::Vendorfor GitHub, GitLab andBitbucket, and
AzureDevops::GitCredentialServicefor Azure DevOps. Thesession must still hold the repository, and Azure's authorization chain
(project, binding, scope) applies unchanged.
preparenow takessession:.credential.helper. Username andpassword now come from
AIXLE_GIT_USERNAME/AIXLE_GIT_PASSWORD, sooauth2andx-token-authwork as well asx-access-token.git --config-env=http.extraheader=AIXLE_GIT_AUTH_HEADER.An Entra token only works as a bearer header, and the helper protocol cannot
carry one before git 2.46. This needs git 2.31+ on the workspace, which the
guide now says.
not in argv, not in
remote.origin.urland not in the job's command file.Authorizationheader moved ontoGitCredentialService::Vended#authorization_header, so the session clone andthe Coder clone build it the same way.
shared workspace (the connection's own token, not narrowed to one repository,
readable from the clone process's environment while it runs). Troubleshooting
entries were updated to match.
Verification
test/services/coder/repo_bootstrap_test.rb: new cases for GitLab (oauth2),Bitbucket (
x-token-auth), Azure service principal (Bearer), Azure PAT(Basic, including the
reffetch), a repository the session does not hold,and Azure refusing to issue a credential.
coder_tools_test.rb,azure_devops/session_git_setup_test.rb,azure_git_credentials_test.rb, the changelog and docs-drift tests, rubocopand brakeman pass locally.
that logs
Authorization. In helper mode the server saw an anonymous request,a 401, then
Basic base64(oauth2:<token>). In header modeBearer <token>was on the first request. Neither script contains the secret.
RepoBootstrapran in the staging app against its real integrations and athrowaway workspace created from the default template (git 2.50.1), which was
deleted afterwards. Private repositories cloned with exit 0 for: GitLab with a
PAT, GitLab with a service account, Bitbucket with an access token, Azure DevOps
with a service principal (a repository whose names contain spaces, checked out
with
ref), and GitHub (regression). Re-running over an existing clone (therepair path) also worked. In every case the token was absent from the clone's
.gitand from the job directory, andoriginholds the bare URL. Arepository the session does not hold was refused.
connection. That path is covered by a unit test and by the local
real-git run above.
🤖 Generated with Claude Code