Skip to content

Adds a new extractor misc/gitrepo to Scalibr that captures standard Git repository metadata (remotes, commits) and its submodules recursively.#2155

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_921816918
May 29, 2026
Merged

Adds a new extractor misc/gitrepo to Scalibr that captures standard Git repository metadata (remotes, commits) and its submodules recursively.#2155
copybara-service[bot] merged 1 commit into
mainfrom
test_921816918

Conversation

@copybara-service

@copybara-service copybara-service Bot commented May 27, 2026

Copy link
Copy Markdown

Adds a new extractor misc/gitrepo to Scalibr that captures standard Git repository metadata (remotes, commits) and its submodules recursively.

Key changes:

  • Adds Extractor which triggers on .git directories.
  • Uses go-git dependency to read repository metadata and traverse submodules recursively.
  • Provides a robust fallback tracking mechanism to read .git/config via basic file parsing if native repo opening fails.
  • Normalizes SSH/SCP-like git URLs to HTTPS for standard PURL reporting.
  • Registers the new extractor in list.go.
  • Comprehensive unit tests covering various repository states, submodules, and URL formats.
  • Fixes GenerateScanInputMock in mockscaninput.go to handle OS-specific paths correctly when using os.DirFS.

@copybara-service
copybara-service Bot force-pushed the test_921816918 branch 17 times, most recently from 58c50b5 to 7fb1a55 Compare May 29, 2026 06:12
@copybara-service copybara-service Bot changed the title Adds a new extractor misc/gitrepo-dirs to Scalibr that captures standard Git repository metadata by inspecting .git directories. Adds a new extractor misc/gitrepo to Scalibr that captures standard Git repository metadata (remotes, commits) and its submodules recursively. May 29, 2026
… Git repository metadata (remotes, commits) and its submodules recursively.

Key changes:
- Adds `Extractor` which triggers on `.git` directories.
- Uses `go-git` dependency to read repository metadata and traverse submodules recursively.
- Provides a robust fallback tracking mechanism to read `.git/config` via basic file parsing if native repo opening fails.
- Normalizes SSH/SCP-like git URLs to HTTPS for standard PURL reporting.
- Registers the new extractor in list.go.
- Comprehensive unit tests covering various repository states, submodules, and URL formats.
- Fixes `GenerateScanInputMock` in `mockscaninput.go` to handle OS-specific paths correctly when using `os.DirFS`.

PiperOrigin-RevId: 923195752
@copybara-service
copybara-service Bot merged commit 7d8ebd9 into main May 29, 2026
1 check passed
@copybara-service
copybara-service Bot deleted the test_921816918 branch May 29, 2026 06:18
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.

0 participants