Skip to content

Add --commit flag to report command#285

Merged
sourya-deepsource merged 3 commits intomasterfrom
commit-flag-repo
Apr 3, 2026
Merged

Add --commit flag to report command#285
sourya-deepsource merged 3 commits intomasterfrom
commit-flag-repo

Conversation

@jai-deepsource
Copy link
Copy Markdown
Contributor

Summary

  • Add --commit flag to deepsource report that accepts a commit SHA directly
  • When set, skips git detection entirely — useful for CI environments where git is unavailable (Docker builds, shallow clones, etc.)
  • Falls back to existing behavior (git rev-parse / GIT_COMMIT_SHA env var) when not set
  • Adds test verifying git bypass works correctly

Test plan

  • go build ./... passes
  • go test ./internal/services/report/... ./command/report/... passes
  • New test TestReportExplicitCommitSkipsGit verifies commit flag bypasses git
  • Manual test: deepsource report --commit <sha> --analyzer test-coverage --key go --value-file coverage.out

- Allow specifying commit SHA directly, skipping git detection
- Useful for CI environments where git is not available
- Falls back to existing git/env var resolution when not set
@deepsource-io
Copy link
Copy Markdown

deepsource-io bot commented Mar 24, 2026

DeepSource Code Review

We reviewed changes in bd0f271...6851c41 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Coverage  

Code Review Summary

Analyzer Status Updated (UTC) Details
Go Apr 3, 2026 8:02p.m. Review ↗
Secrets Apr 3, 2026 8:02p.m. Review ↗
Test coverage Apr 3, 2026 8:02p.m. Review ↗

Code Coverage Summary

Language Line Coverage (New Code) Line Coverage (Overall)
Aggregate
53.8%
[⤫ below threshold]
25.4%
[▲ up 0.1% from master]
Go
53.8%
[⤫ below threshold]
25.4%
[▲ up 0.1% from master]
[✓ above threshold]

➟ Additional coverage metrics may have been reported. See full coverage report ↗

@jai-deepsource
Copy link
Copy Markdown
Contributor Author

https://github.com/DeepSourceCorp/docs/pull/81 @sourya-deepsource @srijan-deepsource Merge the docs once this change is done.

@jai-deepsource jai-deepsource requested review from sourya-deepsource and removed request for srijan-deepsource April 3, 2026 20:00
@sourya-deepsource sourya-deepsource merged commit 8038474 into master Apr 3, 2026
4 of 5 checks passed
@sourya-deepsource sourya-deepsource deleted the commit-flag-repo branch April 3, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants