Skip to content

Bootstrap gobce analyzer, docs, and release flow#1

Merged
keyskey merged 10 commits into
mainfrom
feat/gobce-initial-setup
Apr 25, 2026
Merged

Bootstrap gobce analyzer, docs, and release flow#1
keyskey merged 10 commits into
mainfrom
feat/gobce-initial-setup

Conversation

@keyskey
Copy link
Copy Markdown
Owner

@keyskey keyskey commented Apr 25, 2026

Summary

  • Add gobce core analyzer implementation with CLI entrypoint and internal package structure for coverage parsing and branch estimation.
  • Add project documentation, including design notes and a beginner-friendly walkthrough explaining how gobce derives estimated C1 coverage.
  • Add release tooling and repo hygiene updates (.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 json
  • Validate README setup and release instructions reflect current workflow

Made 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 gobce library + gobce analyze CLI 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 Analyze API, 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 .gitignore and new go.mod.

Reviewed by Cursor Bugbot for commit e4276a9. Bugbot is set up for automated code reviews on this repo. Configure here.

keyskey added 6 commits April 25, 2026 21:23
…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
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ 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.

Comment thread internal/analyzer/branches.go
}
if lineNo == 1 && strings.HasPrefix(line, "mode:") {
continue
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

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)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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.
Repository owner deleted a comment from cursor Bot Apr 25, 2026
keyskey added 2 commits April 25, 2026 23:07
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
@keyskey keyskey force-pushed the feat/gobce-initial-setup branch from 9511e63 to 0321174 Compare April 25, 2026 14:12
Repository owner deleted a comment from cursor Bot Apr 25, 2026
Repository owner deleted a comment from cursor Bot Apr 25, 2026
Repository owner deleted a comment from cursor Bot Apr 25, 2026
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
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 25, 2026

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.

@keyskey keyskey merged commit 00e612a into main Apr 25, 2026
1 check passed
@keyskey keyskey deleted the feat/gobce-initial-setup branch April 25, 2026 14:16
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.

1 participant