Skip to content

feat: normalize remote repo URL before code scanning#523

Draft
apzuk3 wants to merge 1 commit intomainfrom
feat/normalize-remote-repo-url
Draft

feat: normalize remote repo URL before code scanning#523
apzuk3 wants to merge 1 commit intomainfrom
feat/normalize-remote-repo-url

Conversation

@apzuk3
Copy link
Copy Markdown

@apzuk3 apzuk3 commented Jan 14, 2026

Add GetSanitizedRemoteUrl function to convert git remote URLs to a consistent HTTP format. This handles SSH, HTTPS, and SCP-like syntax (e.g., git@github.com:org/repo.git) by normalizing them to http://{host}/{path} format.

Apply normalization in determineAnalyzeInput before passing the remote URL to scan.NewRepositoryTarget, ensuring consistent URL format for both file and directory scan paths.

  • Add GetSanitizedRemoteUrl in pkg/utils/git/git.go
  • Add comprehensive tests for URL normalization
  • Apply normalization in native_workflow.go
  • Add tests covering various URL formats in code workflow

Add GetSanitizedRemoteUrl function to convert git remote URLs to a
consistent HTTP format. This handles SSH, HTTPS, and SCP-like syntax
(e.g., git@github.com:org/repo.git) by normalizing them to
http://{host}/{path} format.

Apply normalization in determineAnalyzeInput before passing the remote
URL to scan.NewRepositoryTarget, ensuring consistent URL format for
both file and directory scan paths.

- Add GetSanitizedRemoteUrl in pkg/utils/git/git.go
- Add comprehensive tests for URL normalization
- Apply normalization in native_workflow.go
- Add tests covering various URL formats in code workflow
@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Jan 14, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-io
Copy link
Copy Markdown

snyk-io bot commented Jan 14, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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