Skip to content

Nathan.gallet/fix ci failures#247

Merged
NathanGallet-dd merged 1 commit into
mainfrom
nathan.gallet/fix-ci-failures
Jul 7, 2026
Merged

Nathan.gallet/fix ci failures#247
NathanGallet-dd merged 1 commit into
mainfrom
nathan.gallet/fix-ci-failures

Conversation

@NathanGallet-dd

@NathanGallet-dd NathanGallet-dd commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Test_E2EFetchBundleThenOfflineScan was failing in CI because getRepositoryCommitInfo hard-errors when the git branch name cannot be determined. This happens on release tag pushes, where GitHub Actions checks out in detached HEAD state with no remote branch pointing at the commit.

Branch is optional metadata (omitempty in the model) — aborting the entire scan over it is wrong. The fix removes the hard error and lets the scan continue with an empty branch.

How to reproduce

# Simulate a commit with no remote tracking ref (same as a CI tag push)
git commit --allow-empty -m "temp"

# Run the test — fails before the fix
go test ./cmd/scanner/... -run Test_E2EFetchBundleThenOfflineScan -v -count=1

@NathanGallet-dd
NathanGallet-dd requested a review from a team as a code owner July 7, 2026 13:54
@datadog-official

This comment has been minimized.

@NathanGallet-dd
NathanGallet-dd force-pushed the nathan.gallet/fix-ci-failures branch 2 times, most recently from c0cae59 to 405bcd8 Compare July 7, 2026 15:11
- Remove hard error when branch name is empty in getRepositoryCommitInfo
- Replace with explanatory comment noting branch is optional metadata
- Detached-HEAD state is common in CI tag builds where no branch is checked out

Rationale: The scanner was aborting entirely when run against a detached HEAD
(e.g., a CI pipeline triggered by a git tag). Branch is only metadata attached
to the scan result; it is not required for the scan to succeed. Continuing
without a branch name is the correct behaviour rather than returning an error
that prevents any scan results from being produced.

This commit made by [/dd:git:commit:atomic](https://github.com/DataDog/claude-marketplace/tree/main/dd/commands/git/commit/atomic.md)
@NathanGallet-dd
NathanGallet-dd force-pushed the nathan.gallet/fix-ci-failures branch from 405bcd8 to 1971071 Compare July 7, 2026 15:25
@NathanGallet-dd
NathanGallet-dd merged commit b5ed984 into main Jul 7, 2026
19 checks passed
@NathanGallet-dd
NathanGallet-dd deleted the nathan.gallet/fix-ci-failures branch July 7, 2026 15:27
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.

2 participants