feat(repo-providers): add AWS CodeCommit as a third git platform#529
Merged
jonwiggins merged 1 commit intomainfrom May 4, 2026
Merged
feat(repo-providers): add AWS CodeCommit as a third git platform#529jonwiggins merged 1 commit intomainfrom
jonwiggins merged 1 commit intomainfrom
Conversation
Adds CodeCommit support symmetrically with GitHub and GitLab so agent tasks can clone, push, and open PRs against repos hosted in AWS CodeCommit. - Extend GitPlatformType to include "codecommit" and parseRepoUrl/parsePrUrl to recognise git-codecommit.<region>.amazonaws.com plus console PR URLs. - New CodeCommitPlatform implementing the full GitPlatform interface via @aws-sdk/client-codecommit (PR get/list, comments, approval states, three merge modes, repo metadata, folder listing). - New codecommit-credential-service that resolves AWS creds from secrets (workspace -> global -> env vars) with a "workload-identity" sentinel for IRSA / instance-profile fallback. - Pod runtime: install AWS CLI v2 in the agent base image and wire `aws codecommit credential-helper` for HTTPS clone auth in repo-init.sh and agent-entrypoint.sh. - Prompt templates: new GIT_PLATFORM_CODECOMMIT / CODECOMMIT_REPO / BASE_BRANCH vars; agent uses `aws codecommit create-pull-request` and `update-pull-request-approval-state` instead of gh/glab. - Setup wizard: new CodeCommit panel with region + access key + secret + session token inputs, validate button (sts:GetCallerIdentity + codecommit:ListRepositories), and repo picker integration. - Helm: document EKS IRSA via serviceAccount.annotations (eks.amazonaws.com/role-arn). Closes #527
jplorier
pushed a commit
to jplorier/optio
that referenced
this pull request
May 5, 2026
…wiggins#529) Adds CodeCommit support symmetrically with GitHub and GitLab so agent tasks can clone, push, and open PRs against repos hosted in AWS CodeCommit. - Extend GitPlatformType to include "codecommit" and parseRepoUrl/parsePrUrl to recognise git-codecommit.<region>.amazonaws.com plus console PR URLs. - New CodeCommitPlatform implementing the full GitPlatform interface via @aws-sdk/client-codecommit (PR get/list, comments, approval states, three merge modes, repo metadata, folder listing). - New codecommit-credential-service that resolves AWS creds from secrets (workspace -> global -> env vars) with a "workload-identity" sentinel for IRSA / instance-profile fallback. - Pod runtime: install AWS CLI v2 in the agent base image and wire `aws codecommit credential-helper` for HTTPS clone auth in repo-init.sh and agent-entrypoint.sh. - Prompt templates: new GIT_PLATFORM_CODECOMMIT / CODECOMMIT_REPO / BASE_BRANCH vars; agent uses `aws codecommit create-pull-request` and `update-pull-request-approval-state` instead of gh/glab. - Setup wizard: new CodeCommit panel with region + access key + secret + session token inputs, validate button (sts:GetCallerIdentity + codecommit:ListRepositories), and repo picker integration. - Helm: document EKS IRSA via serviceAccount.annotations (eks.amazonaws.com/role-arn). Closes jonwiggins#527
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.
Summary
Adds AWS CodeCommit support alongside GitHub and GitLab so agents can clone, push, and open PRs against repos hosted in AWS CodeCommit. Closes #527.
CodeCommit returned to full GA in Nov 2025 with new-customer signups reopened, Git LFS coming in Q1 2026, and additional regions in Q3 2026 — this is an active surface, not a sunset target.
Approach
The existing three-layer abstraction (
GitPlatforminterface → per-provider classes → factory) made this clean. The third provider drops in symmetrically:!aws codecommit credential-helper $@); API ops via@aws-sdk/client-codecommit.AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, optionalAWS_SESSION_TOKEN,AWS_REGION) with aworkload-identitysentinel that defers to the SDK's default chain (IRSA on EKS, instance profile, env).aws codecommit create-pull-requestdirectly — no third-party CLI wrapper needed.APPROVEDmaps toUpdatePullRequestApprovalState(APPROVE);REQUEST_CHANGES/COMMENTpost viaPostCommentForPullRequestwith a prefix in the body.location.{filePath, filePosition, relativeFileVersion=AFTER}; falls back to a top-level comment on error so feedback is never silently dropped.Graceful degradation
CodeCommit doesn't have native CI, issues, or webhooks. Where the abstraction expects them:
getCIChecks()returns[]. The reconciler atreconcile-repo.ts:462already treatschecksStatus="none"as merge-eligible, so auto-merge still fires.listIssues()returns[]; mutating issue methods throw a clear "not supported" error.reviewTrigger="on_pr"is recommended over the defaulton_ci_passfor CodeCommit repos (since CI never reports). Documented in CLAUDE.md.What's in this PR
GitPlatformTypeextended;parseRepoUrl/parsePrUrlrecognisegit-codecommit.<region>.amazonaws.com(HTTPS + SSH) and console PR URLs.CodeCommitPlatform(≈400 lines) implementing all 14GitPlatformmethods.codecommit-credential-servicefor AWS cred resolution.repo-init.shandagent-entrypoint.shconfiguregit config credential.helper '!aws codecommit credential-helper \$@'when the URL is a CodeCommit repo.GIT_PLATFORM_CODECOMMIT/CODECOMMIT_REPO/BASE_BRANCHvars wired throughtask-worker.ts,review-service.ts,pr-review-service.ts.POST /api/setup/validate/aws-credentialsandPOST /api/setup/repos/codecommit.serviceAccount.annotations.Tests
CodeCommitPlatformunit tests usingaws-sdk-client-mockpnpm format:check,pnpm turbo typecheck(12/12),pnpm turbo test(2089/2089),pnpm turbo build, andapps/web next buildall green.Follow-ups (not blocking this PR, but blocking real use)
PostCommentForPullRequestlocation call hasn't been exercised against a live CodeCommit PR. The fallback path (top-level comment) should keep us safe if positioning fails, but worth verifying on the first real review.[]).Test plan
repo-init.shlog lines)aws codecommit create-pull-requestsuccessfullychecksStatus="none")