From 79e4286ce2e7971202be875e9894db826ea2b3ba Mon Sep 17 00:00:00 2001 From: "ccf-release-bot[bot]" <253916425+ccf-release-bot[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 19:31:48 +0000 Subject: [PATCH 1/3] fix(deps): update module github.com/google/go-github/v71 to v93 --- go.mod | 3 ++- go.sum | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 29af45c..44544b5 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.26.1 require ( github.com/compliance-framework/agent v0.9.3 github.com/google/go-github/v71 v71.0.0 + github.com/google/go-github/v93 v93.0.0 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-plugin v1.8.0 github.com/mitchellh/mapstructure v1.5.0 @@ -23,7 +24,7 @@ require ( github.com/goccy/go-json v0.10.5 // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-containerregistry v0.21.2 // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-querystring v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/hashicorp/yamux v0.1.2 // indirect github.com/lestrrat-go/blackmagic v1.0.4 // indirect diff --git a/go.sum b/go.sum index 3e070e2..744c174 100644 --- a/go.sum +++ b/go.sum @@ -174,8 +174,11 @@ github.com/google/go-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9D github.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0= github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30= github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M= +github.com/google/go-github/v93 v93.0.0/go.mod h1:l8I3rt4/mdjANKpg4Y84LEy9HJQCetUkZ8WTl2bPU8M= github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= From 813ee28b8d8db24e94186411073b2974d1d83acc Mon Sep 17 00:00:00 2001 From: Gustavo Carvalho Date: Wed, 28 Oct 2026 06:03:55 -0300 Subject: [PATCH 2/3] fix: bump refs across files Signed-off-by: Gustavo Carvalho --- go.mod | 1 - go.sum | 8 ++------ internal/data.go | 2 +- internal/data_test.go | 2 +- internal/eval_integration_test.go | 2 +- main.go | 2 +- 6 files changed, 6 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 44544b5..b849193 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.26.1 require ( github.com/compliance-framework/agent v0.9.3 - github.com/google/go-github/v71 v71.0.0 github.com/google/go-github/v93 v93.0.0 github.com/hashicorp/go-hclog v1.6.3 github.com/hashicorp/go-plugin v1.8.0 diff --git a/go.sum b/go.sum index 744c174..8d14fec 100644 --- a/go.sum +++ b/go.sum @@ -167,16 +167,13 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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-containerregistry v0.21.2 h1:vYaMU4nU55JJGFC9JR/s8NZcTjbE9DBBbvusTW9NeS0= github.com/google/go-containerregistry v0.21.2/go.mod h1:ctO5aCaewH4AK1AumSF5DPW+0+R+d2FmylMJdp5G7p0= -github.com/google/go-github/v71 v71.0.0 h1:Zi16OymGKZZMm8ZliffVVJ/Q9YZreDKONCr+WUd0Z30= -github.com/google/go-github/v71 v71.0.0/go.mod h1:URZXObp2BLlMjwu0O8g4y6VBneUj2bCHgnI8FfgZ51M= +github.com/google/go-github/v93 v93.0.0 h1:qElXPLv+XbSz1qrLdWyb0t3gSYGsWBTzr9T4/PZTCfk= github.com/google/go-github/v93 v93.0.0/go.mod h1:l8I3rt4/mdjANKpg4Y84LEy9HJQCetUkZ8WTl2bPU8M= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= 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/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -433,7 +430,6 @@ golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= golang.org/x/tools v0.49.0 h1:3NI7VXzL9+1WZD52Dx2ttoPwD5DWrFGpl9mFZDlmisI= golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk= diff --git a/internal/data.go b/internal/data.go index 9c84d97..76d7d2f 100644 --- a/internal/data.go +++ b/internal/data.go @@ -9,7 +9,7 @@ import ( policy_manager "github.com/compliance-framework/agent/policy-manager" "github.com/compliance-framework/agent/runner/proto" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v93/github" "github.com/hashicorp/go-hclog" ) diff --git a/internal/data_test.go b/internal/data_test.go index 8028a02..7985abe 100644 --- a/internal/data_test.go +++ b/internal/data_test.go @@ -8,7 +8,7 @@ import ( "net/url" "testing" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v93/github" "github.com/hashicorp/go-hclog" "github.com/open-policy-agent/opa/v1/rego" ) diff --git a/internal/eval_integration_test.go b/internal/eval_integration_test.go index 29665af..c060839 100644 --- a/internal/eval_integration_test.go +++ b/internal/eval_integration_test.go @@ -5,7 +5,7 @@ package internal import ( "context" "encoding/json" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v93/github" "github.com/hashicorp/go-hclog" "os" "testing" diff --git a/main.go b/main.go index 8dc92ec..add2c27 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "github.com/compliance-framework/agent/runner" "github.com/compliance-framework/agent/runner/proto" "github.com/compliance-framework/plugin-github-settings/internal" - "github.com/google/go-github/v71/github" + "github.com/google/go-github/v93/github" "github.com/hashicorp/go-hclog" goplugin "github.com/hashicorp/go-plugin" "github.com/mitchellh/mapstructure" From 145fd7d68865523ff0e1944769ab0e1f948960b3 Mon Sep 17 00:00:00 2001 From: Gustavo Carvalho Date: Wed, 28 Oct 2026 06:15:14 -0300 Subject: [PATCH 3/3] fix: adapt to go-github v93 API changes NewClient now returns an error and takes options, NewRequest takes a context, Do no longer does, and Client.BaseURL is a method. Co-Authored-By: Claude Sonnet 5.5 Signed-off-by: Gustavo Carvalho --- internal/data.go | 8 ++++---- internal/data_test.go | 12 ++++++------ internal/eval_integration_test.go | 6 +++++- main.go | 6 +++++- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/internal/data.go b/internal/data.go index 76d7d2f..39ab30d 100644 --- a/internal/data.go +++ b/internal/data.go @@ -168,13 +168,13 @@ func (df DataFetcher) fetchSSO(ctx context.Context, organization string) (*OrgSS } url := fmt.Sprintf("orgs/%s/sso", organization) - req, err := df.client.NewRequest(http.MethodGet, url, nil) + req, err := df.client.NewRequest(ctx, http.MethodGet, url, nil) if err != nil { return nil, fmt.Errorf("building SSO request: %w", err) } var ssoResp ssoResponse - httpResp, err := df.client.Do(ctx, req, &ssoResp) + httpResp, err := df.client.Do(req, &ssoResp) if err != nil { if httpResp != nil && httpResp.StatusCode == http.StatusNotFound { return &OrgSSO{Enabled: false}, nil @@ -255,13 +255,13 @@ func (df DataFetcher) fetchIPAllowList(ctx context.Context, organization string) }, } - req, err := df.client.NewRequest(http.MethodPost, "graphql", gqlQuery) + req, err := df.client.NewRequest(ctx, http.MethodPost, "graphql", gqlQuery) if err != nil { return nil, fmt.Errorf("building IP allow-list GraphQL request: %w", err) } var gqlResp graphqlResponse - _, err = df.client.Do(ctx, req, &gqlResp) + _, err = df.client.Do(req, &gqlResp) if err != nil { return nil, fmt.Errorf("executing IP allow-list GraphQL query: %w", err) } diff --git a/internal/data_test.go b/internal/data_test.go index 7985abe..6a993f8 100644 --- a/internal/data_test.go +++ b/internal/data_test.go @@ -5,7 +5,6 @@ import ( "encoding/json" "net/http" "net/http/httptest" - "net/url" "testing" "github.com/google/go-github/v93/github" @@ -17,13 +16,14 @@ func testGithubClient(t *testing.T, handler http.Handler) (*github.Client, func( t.Helper() server := httptest.NewServer(handler) - client := github.NewClient(server.Client()) - - baseURL, err := url.Parse(server.URL + "/") + baseURL := server.URL + "/" + client, err := github.NewClient( + github.WithHTTPClient(server.Client()), + github.WithURLs(&baseURL, nil), + ) if err != nil { - t.Fatalf("parsing test server URL: %v", err) + t.Fatalf("creating GitHub client: %v", err) } - client.BaseURL = baseURL return client, server.Close } diff --git a/internal/eval_integration_test.go b/internal/eval_integration_test.go index c060839..4380183 100644 --- a/internal/eval_integration_test.go +++ b/internal/eval_integration_test.go @@ -16,9 +16,13 @@ func TestDataFetcher_FetchData(t *testing.T) { // Simple test to locally validate that data can be fetched correctly ctx := context.Background() + client, err := github.NewClient(github.WithAuthToken(os.Getenv("GITHUB_TOKEN"))) + if err != nil { + t.Fatal(err) + } fetcher := DataFetcher{ logger: hclog.NewNullLogger(), - client: github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_TOKEN")), + client: client, } org, _, err := fetcher.FetchData(ctx, "compliance-framework", false) diff --git a/main.go b/main.go index add2c27..1a60903 100644 --- a/main.go +++ b/main.go @@ -95,7 +95,11 @@ func (l *CompliancePlugin) Configure(req *proto.ConfigureRequest) (*proto.Config } else { l.policyData = nil } - l.githubClient = github.NewClient(nil).WithAuthToken(l.config.Token) + githubClient, err := github.NewClient(github.WithAuthToken(l.config.Token)) + if err != nil { + return nil, fmt.Errorf("creating GitHub client: %w", err) + } + l.githubClient = githubClient return &proto.ConfigureResponse{}, nil }