From e647522a4c9d8655b1fa31d6dbc5f33348a399a7 Mon Sep 17 00:00:00 2001 From: "mm-renovate-bot[bot]" <265138953+mm-renovate-bot[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 18:17:26 +0000 Subject: [PATCH 1/4] dev: Update module github.com/google/go-github/v86 to v89 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 65ebd01..17c3828 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.26.4 require ( github.com/bmatcuk/doublestar/v4 v4.10.0 github.com/boyter/gocodewalker v1.5.1 - github.com/google/go-github/v86 v86.0.0 + github.com/google/go-github/v89 v89.0.0 github.com/pelletier/go-toml/v2 v2.4.3 github.com/sourcegraph/go-diff v0.8.0 github.com/urfave/cli/v3 v3.10.1 From fe9d1ffd92e106fc1e263575f7b474f3e2c02d64 Mon Sep 17 00:00:00 2001 From: BakerNet Date: Tue, 21 Jul 2026 11:19:25 -0700 Subject: [PATCH 2/4] Fix github upgrade --- go.sum | 4 ++-- internal/app/app_test.go | 2 +- internal/github/gh.go | 2 +- internal/github/gh_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/go.sum b/go.sum index e847552..51ad736 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/go-github/v86 v86.0.0 h1:S/6aANJhwRm8EQmGKVML3j41yq0h2BsTP8FnDkO7kcA= -github.com/google/go-github/v86 v86.0.0/go.mod h1:zKv1l4SwDXNFMGByi2FWkq71KwSXqj/eQRZuqtmcot8= +github.com/google/go-github/v89 v89.0.0 h1:35bEK5XoEcF3PZrlVbl9XN63f5BcJRA/UGkxeC9xPg0= +github.com/google/go-github/v89 v89.0.0/go.mod h1:QLcbU0ipeAqQuR5KSg8c2lql4Qk1EwJ2dWz/0rP4Nho= github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/pelletier/go-toml/v2 v2.4.3 h1:GTRvJQutkOSftxIFD5xw9aepkYNuPWmVJpffdDPYVpY= diff --git a/internal/app/app_test.go b/internal/app/app_test.go index e4f8885..30b487a 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/google/go-github/v86/github" + "github.com/google/go-github/v89/github" owners "github.com/multimediallc/codeowners-plus/internal/config" "github.com/multimediallc/codeowners-plus/internal/git" gh "github.com/multimediallc/codeowners-plus/internal/github" diff --git a/internal/github/gh.go b/internal/github/gh.go index 96453ba..3181353 100644 --- a/internal/github/gh.go +++ b/internal/github/gh.go @@ -9,7 +9,7 @@ import ( "strings" "time" - "github.com/google/go-github/v86/github" + "github.com/google/go-github/v89/github" "github.com/multimediallc/codeowners-plus/internal/git" "github.com/multimediallc/codeowners-plus/pkg/codeowners" f "github.com/multimediallc/codeowners-plus/pkg/functional" diff --git a/internal/github/gh_test.go b/internal/github/gh_test.go index 9bfe9b1..afc085f 100644 --- a/internal/github/gh_test.go +++ b/internal/github/gh_test.go @@ -13,7 +13,7 @@ import ( "testing" "time" - "github.com/google/go-github/v86/github" + "github.com/google/go-github/v89/github" "github.com/multimediallc/codeowners-plus/pkg/codeowners" f "github.com/multimediallc/codeowners-plus/pkg/functional" ) From 973398c81f9d8ec0d5864a11d248574c4c6cc9b8 Mon Sep 17 00:00:00 2001 From: BakerNet Date: Tue, 21 Jul 2026 15:34:12 -0700 Subject: [PATCH 3/4] Fix NewClient calls --- internal/app/app.go | 5 ++++- internal/github/gh.go | 9 ++++++--- internal/github/gh_test.go | 18 ++++++++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/internal/app/app.go b/internal/app/app.go index f9f21e7..d962024 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -79,7 +79,10 @@ func New(cfg Config) (*App, error) { owner := repoSplit[0] repo := repoSplit[1] - client := gh.NewClient(owner, repo, cfg.Token) + client, err := gh.NewClient(owner, repo, cfg.Token) + if err != nil { + return nil, err + } app := &App{ config: &cfg, client: client, diff --git a/internal/github/gh.go b/internal/github/gh.go index 3181353..8803d66 100644 --- a/internal/github/gh.go +++ b/internal/github/gh.go @@ -69,8 +69,11 @@ type GHClient struct { infoBuffer io.Writer } -func NewClient(owner, repo, token string) Client { - client := github.NewClient(nil).WithAuthToken(token) +func NewClient(owner, repo, token string) (Client, error) { + client, err := github.NewClient(github.WithAuthToken(token)) + if err != nil { + return nil, err + } return &GHClient{ context.Background(), owner, @@ -82,7 +85,7 @@ func NewClient(owner, repo, token string) Client { nil, io.Discard, io.Discard, - } + }, nil } func (gh *GHClient) PR() *github.PullRequest { diff --git a/internal/github/gh_test.go b/internal/github/gh_test.go index afc085f..d43fab4 100644 --- a/internal/github/gh_test.go +++ b/internal/github/gh_test.go @@ -8,7 +8,6 @@ import ( "io" "net/http" "net/http/httptest" - "net/url" "reflect" "testing" "time" @@ -323,7 +322,11 @@ func TestIsSubstringInComments(t *testing.T) { } func TestNewGithubClient(t *testing.T) { - client, ok := NewClient("owner", "repo", "token").(*GHClient) + c, err := NewClient("owner", "repo", "token") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + client, ok := c.(*GHClient) if !ok { t.Fatalf("Expected client to be of type *GHClient, got %T", client) } @@ -582,12 +585,11 @@ func TestNilCommentsErr(t *testing.T) { func mockServerAndClient(t *testing.T) (*http.ServeMux, *httptest.Server, *GHClient) { mux := http.NewServeMux() server := httptest.NewServer(mux) - client := github.NewClient(nil) - baseURL, err := url.Parse(server.URL + "/") + baseURL := server.URL + "/" + client, err := github.NewClient(github.WithURLs(&baseURL, &baseURL)) if err != nil { t.Fatalf("unexpected error: %v", err) } - client.BaseURL = baseURL gh := &GHClient{ ctx: context.Background(), owner: "test-owner", @@ -1462,7 +1464,11 @@ func TestContainsValidBypassApproval(t *testing.T) { } func TestContainsValidBypassApprovalNoPR(t *testing.T) { - gh := NewClient("test-owner", "test-repo", "test-token").(*GHClient) + c, err := NewClient("test-owner", "test-repo", "test-token") + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + gh := c.(*GHClient) result, err := gh.ContainsValidBypassApproval([]string{}) From 59f4eb2d6cb0726d6769d90774047603946b1eb8 Mon Sep 17 00:00:00 2001 From: BakerNet Date: Tue, 21 Jul 2026 15:35:51 -0700 Subject: [PATCH 4/4] covbadge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 312f015..90857ad 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Code Ownership & Review Assignment Tool - GitHub CODEOWNERS but better [![Go Report Card](https://goreportcard.com/badge/github.com/multimediallc/codeowners-plus)](https://goreportcard.com/report/github.com/multimediallc/codeowners-plus?kill_cache=1) [![Tests](https://github.com/multimediallc/codeowners-plus/actions/workflows/go.yml/badge.svg)](https://github.com/multimediallc/codeowners-plus/actions/workflows/go.yml) -![Coverage](https://img.shields.io/badge/Coverage-82.7%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-82.6%25-brightgreen) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)