Bootstrap gobce analyzer, docs, and release flow#1
Conversation
…g its functionality and coverage estimation capabilities.
Exclude local toolchain files, local environment config, coverage output, and build artifacts from version control. Made-with: Cursor
Introduce the public Analyze API, internal analyzer pipeline, tests, and CLI analyze command to run branch coverage estimation from coverprofile data. Made-with: Cursor
Document gobce's scope, CLI usage, estimation model, and algorithm overview as a dedicated design note. Made-with: Cursor
Expand README for install and CI usage, and add GoReleaser plus a tag-triggered GitHub Actions workflow for GitHub Release artifacts. Made-with: Cursor
Introduce a plain-language explanation of gobce's analysis flow with a concrete if-branch mapping example, and link it from README design docs. Made-with: Cursor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e4276a9. Configure here.
| } | ||
| if lineNo == 1 && strings.HasPrefix(line, "mode:") { | ||
| continue | ||
| } |
There was a problem hiding this comment.
Mode header skip breaks on leading blank lines
Low Severity
lineNo is incremented for every physical line, including blanks that are skipped via continue. The mode: header is only treated as a header when it lands on physical line 1, so any leading blank or whitespace-only line shifts the header to lineNo == 2 and parseCoverProfileLine then rejects it with an "unexpected coverprofile entry" error. Tracking the index of the first non-empty line, or matching mode: regardless of position, would make the parser tolerant to harmless prefixes.
Reviewed by Cursor Bugbot for commit e4276a9. Configure here.
| parsed, err := parser.ParseFile(fset, filePath, nil, 0) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("parse source %q: %w", filePath, err) | ||
| } |
There was a problem hiding this comment.
Unresolvable source paths abort entire analysis
Medium Severity
When resolveSourcePath cannot locate a file (e.g., the coverprofile contains an import-path entry from a dependency, generated code, or a stale path), it returns the raw import-path string unchanged. parser.ParseFile then fails on that path and collectFileBranchCandidates propagates the error, which causes Analyze to abort the entire run with no result. A single missing or external file in the profile makes the tool unusable, even though the rest of the project could still be analyzed. Skipping unresolved files (with a warning) or treating them as zero candidates would be more robust for real coverprofiles produced by go test ./....
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e4276a9. Configure here.
…EADME and documentation to reflect the new `--output` flag for saving JSON results to a specified file while maintaining stdout output. Adjust usage examples accordingly.
Parse and store coverprofile column positions, use line+column range overlap in spanCovered, and add a regression test for one-line if/else coverage misclassification. Made-with: Cursor
Run go test on pull requests and use go.mod via setup-go go-version-file in both CI and release workflows. Made-with: Cursor
9511e63 to
0321174
Compare
Avoid aborting analysis when parser cannot open a file from coverprofile by skipping missing files and add a regression test covering mixed resolvable/unresolvable entries. Made-with: Cursor
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |


Summary
.gitignore, GoReleaser config, and tag-triggered GitHub Actions release workflow).Test plan
./.tools/go/bin/go test ./..../.tools/go/bin/go run ./cmd/gobce analyze --coverprofile coverage.out --format jsonMade with Cursor
Note
Medium Risk
Introduces a new coverage-analysis engine and CLI plus automated GitHub Releases via GoReleaser; main risk is correctness/edge cases in AST/coverprofile interpretation and release workflow configuration.
Overview
Adds an initial
gobcelibrary +gobce analyzeCLI that reads a Go-coverprofile, computes statement coverage, estimates C1 branch coverage via AST-based branch-candidate detection (if/switch/type switch/for/range), and emits JSON including uncovered-branch findings.Adds basic test coverage for the public
AnalyzeAPI, plus documentation (README + design/walkthrough) and a tag-triggered release pipeline (.github/workflows/release.yml+.goreleaser.yml) to publish multi-arch binaries; also updates repo hygiene via.gitignoreand newgo.mod.Reviewed by Cursor Bugbot for commit e4276a9. Bugbot is set up for automated code reviews on this repo. Configure here.