Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade go-github dep to v68 #2184

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/gofrs/flock v0.12.1
github.com/google/cel-go v0.22.1
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v67 v67.0.0
github.com/google/go-github/v68 v68.0.0
github.com/google/gofuzz v1.2.0
github.com/google/uuid v1.6.0
github.com/gorilla/securecookie v1.1.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-github/v64 v64.0.0 h1:4G61sozmY3eiPAjjoOHponXDBONm+utovTKbyUb2Qdg=
github.com/google/go-github/v64 v64.0.0/go.mod h1:xB3vqMQNdHzilXBiO2I+M7iEFtHf+DP/omBOv6tQzVo=
github.com/google/go-github/v67 v67.0.0 h1:g11NDAmfaBaCO8qYdI9fsmbaRipHNWRIU/2YGvlh4rg=
github.com/google/go-github/v67 v67.0.0/go.mod h1:zH3K7BxjFndr9QSeFibx4lTKkYS3K9nDanoI1NjaOtY=
github.com/google/go-github/v68 v68.0.0 h1:ZW57zeNZiXTdQ16qrDiZ0k6XucrxZ2CGmoTvcCyQG6s=
github.com/google/go-github/v68 v68.0.0/go.mod h1:K9HAUBovM2sLwM408A18h+wd9vqdLOEqTUCbnRIcx68=
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/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
Expand Down
4 changes: 2 additions & 2 deletions internal/githubclient/githubclient.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2024-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package githubclient
Expand All @@ -12,7 +12,7 @@ import (
"slices"
"strings"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"k8s.io/apimachinery/pkg/util/sets"

"go.pinniped.dev/internal/plog"
Expand Down
168 changes: 84 additions & 84 deletions internal/githubclient/githubclient_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 the Pinniped contributors. All Rights Reserved.
// Copyright 2024-2025 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0

package githubclient
Expand All @@ -9,7 +9,7 @@ import (
"strings"
"testing"

"github.com/google/go-github/v67/github"
"github.com/google/go-github/v68/github"
"github.com/migueleliasweb/go-github-mock/src/mock"
"github.com/stretchr/testify/require"
"k8s.io/client-go/util/cert"
Expand Down Expand Up @@ -138,8 +138,8 @@ func TestGetUser(t *testing.T) {
mock.WithRequestMatch(
mock.GetUser,
github.User{
Login: github.String("some-username"),
ID: github.Int64(12345678),
Login: github.Ptr("some-username"),
ID: github.Ptr[int64](12345678),
},
),
),
Expand Down Expand Up @@ -174,7 +174,7 @@ func TestGetUser(t *testing.T) {
mock.WithRequestMatch(
mock.GetUser,
github.User{
ID: github.Int64(12345678),
ID: github.Ptr[int64](12345678),
},
),
),
Expand All @@ -187,7 +187,7 @@ func TestGetUser(t *testing.T) {
mock.WithRequestMatch(
mock.GetUser,
github.User{
Login: github.String("some-username"),
Login: github.Ptr("some-username"),
},
),
),
Expand Down Expand Up @@ -268,9 +268,9 @@ func TestGetOrgMembership(t *testing.T) {
mock.WithRequestMatch(
mock.GetUserOrgs,
[]github.Organization{
{Login: github.String("org1")},
{Login: github.String("org2")},
{Login: github.String("org3")},
{Login: github.Ptr("org1")},
{Login: github.Ptr("org2")},
{Login: github.Ptr("org3")},
},
),
),
Expand All @@ -283,14 +283,14 @@ func TestGetOrgMembership(t *testing.T) {
mock.WithRequestMatchPages(
mock.GetUserOrgs,
[]github.Organization{
{Login: github.String("page1-org1")},
{Login: github.String("page1-org2")},
{Login: github.String("page1-org3")},
{Login: github.Ptr("page1-org1")},
{Login: github.Ptr("page1-org2")},
{Login: github.Ptr("page1-org3")},
},
[]github.Organization{
{Login: github.String("page2-org1")},
{Login: github.String("page2-org2")},
{Login: github.String("page2-org3")},
{Login: github.Ptr("page2-org1")},
{Login: github.Ptr("page2-org2")},
{Login: github.Ptr("page2-org3")},
},
),
),
Expand Down Expand Up @@ -319,9 +319,9 @@ func TestGetOrgMembership(t *testing.T) {
mock.WithRequestMatch(
mock.GetUserOrgs,
[]github.Organization{
{Login: github.String("page1-org1")},
{Login: github.Ptr("page1-org1")},
{Login: nil},
{Login: github.String("page1-org3")},
{Login: github.Ptr("page1-org3")},
},
),
),
Expand Down Expand Up @@ -404,31 +404,31 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("orgAlpha-team1-name"),
Slug: github.String("orgAlpha-team1-slug"),
Name: github.Ptr("orgAlpha-team1-name"),
Slug: github.Ptr("orgAlpha-team1-slug"),
Organization: &github.Organization{
Login: github.String("alpha"),
Login: github.Ptr("alpha"),
},
},
{
Name: github.String("orgAlpha-team2-name"),
Slug: github.String("orgAlpha-team2-slug"),
Name: github.Ptr("orgAlpha-team2-name"),
Slug: github.Ptr("orgAlpha-team2-slug"),
Organization: &github.Organization{
Login: github.String("alpha"),
Login: github.Ptr("alpha"),
},
},
{
Name: github.String("orgAlpha-team3-name"),
Slug: github.String("orgAlpha-team3-slug"),
Name: github.Ptr("orgAlpha-team3-name"),
Slug: github.Ptr("orgAlpha-team3-slug"),
Organization: &github.Organization{
Login: github.String("alpha"),
Login: github.Ptr("alpha"),
},
},
{
Name: github.String("orgBeta-team1-name"),
Slug: github.String("orgBeta-team1-slug"),
Name: github.Ptr("orgBeta-team1-name"),
Slug: github.Ptr("orgBeta-team1-slug"),
Organization: &github.Organization{
Login: github.String("beta"),
Login: github.Ptr("beta"),
},
},
},
Expand Down Expand Up @@ -466,24 +466,24 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team1-name"),
Slug: github.String("team1-slug"),
Name: github.Ptr("team1-name"),
Slug: github.Ptr("team1-slug"),
Organization: &github.Organization{
Login: github.String("alPhA"),
Login: github.Ptr("alPhA"),
},
},
{
Name: github.String("team2-name"),
Slug: github.String("team2-slug"),
Name: github.Ptr("team2-name"),
Slug: github.Ptr("team2-slug"),
Organization: &github.Organization{
Login: github.String("bEtA"),
Login: github.Ptr("bEtA"),
},
},
{
Name: github.String("team3-name"),
Slug: github.String("team3-slug"),
Name: github.Ptr("team3-name"),
Slug: github.Ptr("team3-slug"),
Organization: &github.Organization{
Login: github.String("gAmmA"),
Login: github.Ptr("gAmmA"),
},
},
},
Expand Down Expand Up @@ -511,29 +511,29 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team1-name"),
Slug: github.String("team1-slug"),
Name: github.Ptr("team1-name"),
Slug: github.Ptr("team1-slug"),
Organization: &github.Organization{
Login: github.String("alpha"),
Login: github.Ptr("alpha"),
},
},
{
Name: github.String("team2-name"),
Slug: github.String("team2-slug"),
Name: github.Ptr("team2-name"),
Slug: github.Ptr("team2-slug"),
Organization: &github.Organization{
Login: github.String("beta"),
Login: github.Ptr("beta"),
},
},
{
Name: github.String("team3-name"),
Slug: github.String("team3-slug"),
Name: github.Ptr("team3-name"),
Slug: github.Ptr("team3-slug"),
Parent: &github.Team{
Name: github.String("delta-team-name"),
Slug: github.String("delta-team-slug"),
Name: github.Ptr("delta-team-name"),
Slug: github.Ptr("delta-team-slug"),
Organization: nil, // the real GitHub API does not return Org on "Parent" team.
},
Organization: &github.Organization{
Login: github.String("gamma"),
Login: github.Ptr("gamma"),
},
},
},
Expand Down Expand Up @@ -570,53 +570,53 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team-name-with-parent"),
Slug: github.String("team-slug-with-parent"),
Name: github.Ptr("team-name-with-parent"),
Slug: github.Ptr("team-slug-with-parent"),
Parent: &github.Team{
Name: github.String("parent-team-name"),
Slug: github.String("parent-team-slug"),
Name: github.Ptr("parent-team-name"),
Slug: github.Ptr("parent-team-slug"),
Organization: nil, // the real GitHub API does not return Org on "Parent" team.
},
Organization: &github.Organization{
Login: github.String("org-with-nested-teams"),
Login: github.Ptr("org-with-nested-teams"),
},
},
{
Name: github.String("team-name-with-same-parent-again"),
Slug: github.String("team-slug-with-same-parent-again"),
Name: github.Ptr("team-name-with-same-parent-again"),
Slug: github.Ptr("team-slug-with-same-parent-again"),
Parent: &github.Team{
Name: github.String("parent-team-name"),
Slug: github.String("parent-team-slug"),
Name: github.Ptr("parent-team-name"),
Slug: github.Ptr("parent-team-slug"),
Organization: nil, // the real GitHub API does not return Org on "Parent" team.
},
Organization: &github.Organization{
Login: github.String("org-with-nested-teams"),
Login: github.Ptr("org-with-nested-teams"),
},
},
{
Name: github.String("parent-team-name"),
Slug: github.String("parent-team-slug"),
Name: github.Ptr("parent-team-name"),
Slug: github.Ptr("parent-team-slug"),
Organization: &github.Organization{
Login: github.String("org-with-nested-teams"),
Login: github.Ptr("org-with-nested-teams"),
},
},
{
Name: github.String("team-name-with-parent-from-disallowed-org"),
Slug: github.String("team-slug-with-parent-from-disallowed-org"),
Name: github.Ptr("team-name-with-parent-from-disallowed-org"),
Slug: github.Ptr("team-slug-with-parent-from-disallowed-org"),
Parent: &github.Team{
Name: github.String("parent-team-name-from-disallowed-org"),
Slug: github.String("parent-team-slug-from-disallowed-org"),
Name: github.Ptr("parent-team-name-from-disallowed-org"),
Slug: github.Ptr("parent-team-slug-from-disallowed-org"),
Organization: nil, // the real GitHub API does not return Org on "Parent" team.
},
Organization: &github.Organization{
Login: github.String("disallowed-org"),
Login: github.Ptr("disallowed-org"),
},
},
{
Name: github.String("team-name-without-parent"),
Slug: github.String("team-slug-without-parent"),
Name: github.Ptr("team-name-without-parent"),
Slug: github.Ptr("team-slug-without-parent"),
Organization: &github.Organization{
Login: github.String("beta"),
Login: github.Ptr("beta"),
},
},
},
Expand Down Expand Up @@ -654,19 +654,19 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("page1-team-name"),
Slug: github.String("page1-team-slug"),
Name: github.Ptr("page1-team-name"),
Slug: github.Ptr("page1-team-slug"),
Organization: &github.Organization{
Login: github.String("page1-org-name"),
Login: github.Ptr("page1-org-name"),
},
},
},
[]github.Team{
{
Name: github.String("page2-team-name"),
Slug: github.String("page2-team-slug"),
Name: github.Ptr("page2-team-name"),
Slug: github.Ptr("page2-team-slug"),
Organization: &github.Organization{
Login: github.String("page2-org-name"),
Login: github.Ptr("page2-org-name"),
},
},
},
Expand Down Expand Up @@ -694,8 +694,8 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team-name"),
Slug: github.String("team-slug"),
Name: github.Ptr("team-name"),
Slug: github.Ptr("team-slug"),
},
},
),
Expand All @@ -709,8 +709,8 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team-name"),
Slug: github.String("team-slug"),
Name: github.Ptr("team-name"),
Slug: github.Ptr("team-slug"),
Organization: &github.Organization{},
},
},
Expand All @@ -725,9 +725,9 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Slug: github.String("team-slug"),
Slug: github.Ptr("team-slug"),
Organization: &github.Organization{
Login: github.String("some-org"),
Login: github.Ptr("some-org"),
},
},
},
Expand All @@ -742,9 +742,9 @@ func TestGetTeamMembership(t *testing.T) {
mock.GetUserTeams,
[]github.Team{
{
Name: github.String("team-name"),
Name: github.Ptr("team-name"),
Organization: &github.Organization{
Login: github.String("some-org"),
Login: github.Ptr("some-org"),
},
},
},
Expand Down
Loading