feat: add --commit flag to issues list command#267
Open
alexander-turner wants to merge 4 commits intoDeepSourceCorp:masterfrom
Open
feat: add --commit flag to issues list command#267alexander-turner wants to merge 4 commits intoDeepSourceCorp:masterfrom
alexander-turner wants to merge 4 commits intoDeepSourceCorp:masterfrom
Conversation
Add support for listing issues from an analysis run for a specific commit SHA. This enables querying issues on PR branches and non-default branches via the run(commitOid:) GraphQL endpoint. Usage: deepsource issues list --commit <SHA>
alexander-turner
pushed a commit
to alexander-turner/cli
that referenced
this pull request
Feb 9, 2026
…tion - Move regexp.MustCompile to package-level var to avoid recompilation on every invocation (idiomatic Go) - Use cobra's MarkFlagsMutuallyExclusive for --commit/--repo instead of manual check in Run(), providing better UX and cleaner code - Fix misleading doc comment: "full commit SHA" -> describes that abbreviated SHAs (6-40 hex chars) are accepted - Add empty occurrences guard in list_run_issues.go to match the established pattern in list_issues.go and list_file_issues.go Closes DeepSourceCorp#261 https://claude.ai/code/session_01UrmgEwEjAJZzyE2tbVyJHw
alexander-turner
added a commit
to alexander-turner/cli
that referenced
this pull request
Feb 9, 2026
…WEbLE fix: address code issues in PR DeepSourceCorp#267 --commit flag
- Move regexp.MustCompile to package-level var (idiomatic Go) - Use cobra MarkFlagsMutuallyExclusive for --commit/--repo - Fix misleading "full commit SHA" doc comment - Add empty occurrences guard matching existing query patterns - Document --commit flag in README (resolves DeepSourceCorp#261)
3 tasks
…WEbLE fix: address code review issues in --commit flag (PR DeepSourceCorp#267)
alexander-turner
pushed a commit
to alexander-turner/TurnTrout.com
that referenced
this pull request
Feb 10, 2026
Update session-setup.sh to build the DeepSource CLI from the fork at alexander-turner/cli (branch feat/issues-list-by-commit) which adds `--commit` flag to `deepsource issues list`. This allows querying issues for a specific commit SHA instead of only the default branch. Falls back to the official CLI installer when Go is not available. Add a DeepSource issues check step to the PR creation skill that runs `deepsource issues list --commit <SHA>` after CI checks pass, with retry logic for when analysis isn't ready yet. Source: DeepSourceCorp/cli#267 https://claude.ai/code/session_01ANbcgw6Gt1895P6hpJMgVL
alexander-turner
pushed a commit
to alexander-turner/TurnTrout.com
that referenced
this pull request
Feb 14, 2026
Update session-setup.sh to build the DeepSource CLI from the fork at alexander-turner/cli (branch feat/issues-list-by-commit) which adds `--commit` flag to `deepsource issues list`. This allows querying issues for a specific commit SHA instead of only the default branch. Falls back to the official CLI installer when Go is not available. Add a DeepSource issues check step to the PR creation skill that runs `deepsource issues list --commit <SHA>` after CI checks pass, with retry logic for when analysis isn't ready yet. Source: DeepSourceCorp/cli#267 https://claude.ai/code/session_01ANbcgw6Gt1895P6hpJMgVL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
deepsource issues listcurrently only shows issues from the repository's default branch. This PR adds a--commitflag that queries issues from the analysis run for a specific commit SHA, enabling users to see issues found on PR branches and non-default branches.Motivation: When using DeepSource in CI pipelines or local pre-push hooks, it's useful to check what issues a specific commit introduced — particularly on feature branches where DeepSource already runs analysis via the GitHub App. Today the only way to see branch-specific results is through the web dashboard; this change brings that capability to the CLI.
NOTE: This PR is AI-written but seems to work. I don't know Go, otherwise I'd scrutinize myself. Please LMK if changes need to be made.
Usage
Changes
New file:
deepsource/issues/queries/list_run_issues.gorun(commitOid:)→checks→occurrencesto fetch issues from a specific analysis runDo()method following the existing patterns inlist_issues.goandlist_file_issues.go--limit(the GraphQL limit applies per-analyzer check, so without the cap, 3 analyzers × 100 limit = 300 results)Modified:
deepsource/client.goGetIssuesByCommit(ctx, commitOID, limit)SDK method, mirroring the existingGetIssuesandGetIssuesForFileModified:
command/issues/list/list.go--commitflag (long form only — no shorthand to avoid-cconflicts with common--configconventions)--repo(commit lookup is repo-agnostic via the API)ResolveRemotewhen--commitis specified (no git context needed)--analyzer,--limit,--json/--csv/--sarif, and--output-fileflags all work with--commitTesting
go build ./...passesgo test ./command/issues/list/passes (existing tests unaffected)run(commitOid:)GraphQL endpoint returns correct data via the DeepSource Cloud API (api.deepsource.io/graphql/)Notes
run(commitOid:)root query field and traverseschecks.occurrencesto collect issues. This field is documented in the DeepSource API but was not previously exposed by the CLI.[]issues.Issueslice used by the default code path.