Skip to content

Add AWS CodeCommit URL parsing logic - #1277

Open
vocarista wants to merge 1 commit into
fluxcd:mainfrom
vocarista:flux-op/987
Open

Add AWS CodeCommit URL parsing logic#1277
vocarista wants to merge 1 commit into
fluxcd:mainfrom
vocarista:flux-op/987

Conversation

@vocarista

Copy link
Copy Markdown

Description

This PR exports ParseCodeCommitURL in auth/aws to provide a central helper for parsing AWS CodeCommit HTTPS Git URLs into host, region, and repository components.

Currently, downstream consumers (such as flux-operator) maintain duplicate CodeCommit URL parsing logic to extract host and repository details alongside the region. Centralizing this parsing in fluxcd/pkg/auth/aws allows callers to share a single parser.

Changes

  • Added ParseCodeCommitURL(rawURL string) (host, region, repo string, err error) supporting standard, FIPS, and China partition URLs.
  • Refactored getRegionFromCodeCommitURL to delegate to ParseCodeCommitURL while preserving its existing function signature and error contracts.
  • Added comprehensive unit tests in TestParseCodeCommitURL covering positive, negative, and edge cases.

Part of: controlplaneio-fluxcd/flux-operator#987

Signed-off-by: Kumar Piyush <kr.piyush888@gmail.com>
Assisted-by: Antigravity/Claude-Sonnet-4.6
@vocarista
vocarista requested a review from a team as a code owner August 9, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant