Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.

Fix bugs, improve code quality, upgrade go-github to v74#7

Merged
philn-delphia merged 1 commit into
v2from
code-improvements
Mar 2, 2026
Merged

Fix bugs, improve code quality, upgrade go-github to v74#7
philn-delphia merged 1 commit into
v2from
code-improvements

Conversation

@philn-delphia

Copy link
Copy Markdown
Collaborator

Summary

  • Fix goroutine panic: Added missing return statements after close(channel) in newCommentLoopChannel — without these, the goroutine continues looping and panics on the next send/close of the already-closed channel
  • Fix malformed run URL: Added trailing / to githubBaseURL so issue links resolve correctly (https://github.com/owner/repo/... instead of https://github.comowner/repo/...)
  • Deduplicate isApproved/isDenied: Consolidated into a single matchesWordList(body, words) function, removing ~20 lines of duplicated logic
  • Use strings.Join: Replaces fmt.Sprintf("%s", slice) for human-readable approver lists in issue bodies
  • Use slices.Contains: Replaces hand-rolled approversIndex with stdlib (Go 1.21+)
  • Consolidate minimumApprovals parsing: Was parsed in both retrieveApprovers and main(); now parsed and validated once in retrieveApprovers which returns the value
  • Surface team-fetch errors: expandGroupFromUser now returns errors, distinguishing 404 (not a team) from real failures (auth, rate limit, network)
  • Upgrade go-github v61 → v74

Test plan

  • go build ./... compiles cleanly
  • go test -v ./... — all 41 tests pass
  • Verify approval workflow end-to-end in a test repo

Made with Cursor

- fix missing return after close(channel) in comment loop goroutine (would panic)
- fix missing slash in githubBaseURL producing malformed run URLs
- deduplicate isApproved/isDenied into single matchesWordList function
- use strings.Join for readable approver formatting in issue bodies
- use slices.Contains from stdlib instead of hand-rolled approversIndex
- consolidate minimumApprovals parsing into retrieveApprovers (was parsed twice)
- surface team-fetch errors in expandGroupFromUser instead of swallowing them
- upgrade go-github from v61 to v74

Made-with: Cursor
@philn-delphia philn-delphia self-assigned this Mar 2, 2026
@philn-delphia philn-delphia requested a review from a team March 2, 2026 19:46
@philn-delphia philn-delphia merged commit d369562 into v2 Mar 2, 2026
1 check passed
@philn-delphia philn-delphia deleted the code-improvements branch March 2, 2026 19:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant