Skip to content

refactor: replace hand-rolled HTTP client with google/go-github#25

Merged
packet-mover merged 1 commit intomainfrom
refactor/switch-to-go-github
Apr 7, 2026
Merged

refactor: replace hand-rolled HTTP client with google/go-github#25
packet-mover merged 1 commit intomainfrom
refactor/switch-to-go-github

Conversation

@packet-mover
Copy link
Copy Markdown
Contributor

Summary

  • Replaced the hand-rolled HTTP/JSON client in client.go with google/go-github v72, reducing the file from 263 to 160 lines
  • Bumped Go from 1.22.2 to 1.26.1 (required by go-github v72)
  • Added 403 handling in GetRulesets and GetBranchProtection - private repos without GitHub Pro return 403 on these endpoints, which should fall through gracefully (same as 404) rather than failing the scan

The GitHubClient interface, mock, all tests, scanner logic, rules, and report generation are unchanged.

Test plan

  • go test ./... passes
  • go build ./... succeeds
  • Live run against CodatusHQ org completed successfully (scanned 2 repos, posted report)

Switches realGitHubClient from manual HTTP/JSON handling to
google/go-github v72, reducing client.go from 263 to 160 lines.
Also bumps Go to 1.26.1 and handles 403 on rulesets/branch
protection endpoints (private repos without GitHub Pro).

Interface, mock, tests, and all other files unchanged.
@packet-mover packet-mover merged commit 267b07a into main Apr 7, 2026
2 checks passed
@packet-mover packet-mover deleted the refactor/switch-to-go-github branch April 7, 2026 20:33
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