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

Bump github.com/bradleyfalzon/ghinstallation/v2 from 2.12.0 to 2.13.0 #683

Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ require (
chainguard.dev/sdk v0.1.29
cloud.google.com/go/kms v1.20.4
cloud.google.com/go/secretmanager v1.14.3
github.com/bradleyfalzon/ghinstallation/v2 v2.12.0
github.com/bradleyfalzon/ghinstallation/v2 v2.13.0
github.com/chainguard-dev/clog v1.5.1
github.com/chainguard-dev/terraform-infra-common v0.6.112
github.com/cloudevents/sdk-go/v2 v2.15.2
github.com/coreos/go-oidc/v3 v3.11.0
github.com/golang-jwt/jwt/v4 v4.5.1
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v66 v66.0.0
github.com/google/go-github/v68 v68.0.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/kelseyhightower/envconfig v1.4.0
Expand Down
228 changes: 224 additions & 4 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/octosts/octosts.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"github.com/bradleyfalzon/ghinstallation/v2"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
lru "github.com/hashicorp/golang-lru/v2"
expirablelru "github.com/hashicorp/golang-lru/v2/expirable"

Expand Down
18 changes: 9 additions & 9 deletions pkg/octosts/octosts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
josejwt "github.com/go-jose/go-jose/v4/jwt"
jwt "github.com/golang-jwt/jwt/v4"
"github.com/google/go-cmp/cmp"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"google.golang.org/grpc/metadata"

"github.com/octo-sts/app/pkg/provider"
Expand All @@ -48,9 +48,9 @@ func newFakeGitHub() *fakeGitHub {
mux := http.NewServeMux()
mux.HandleFunc("/app/installations", func(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode([]github.Installation{{
ID: github.Int64(1234),
ID: github.Ptr(int64(1234)),
Account: &github.User{
Login: github.String("org"),
Login: github.Ptr("org"),
},
}})
})
Expand All @@ -62,7 +62,7 @@ func newFakeGitHub() *fakeGitHub {
}

json.NewEncoder(w).Encode(github.InstallationToken{
Token: github.String(base64.StdEncoding.EncodeToString(b)),
Token: github.Ptr(base64.StdEncoding.EncodeToString(b)),
ExpiresAt: &github.Timestamp{Time: time.Now().Add(10 * time.Minute)},
})
})
Expand All @@ -73,9 +73,9 @@ func newFakeGitHub() *fakeGitHub {
fmt.Fprintf(io.MultiWriter(w, os.Stdout), "ReadFile failed: %v\n", err)
}
json.NewEncoder(w).Encode(github.RepositoryContent{
Content: github.String(base64.StdEncoding.EncodeToString(b)),
Type: github.String("file"),
Encoding: github.String("base64"),
Content: github.Ptr(base64.StdEncoding.EncodeToString(b)),
Type: github.Ptr("file"),
Encoding: github.Ptr("base64"),
})
})
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestExchange(t *testing.T) {
want: &github.InstallationTokenOptions{
Repositories: []string{"repo"},
Permissions: &github.InstallationPermissions{
PullRequests: github.String("write"),
PullRequests: github.Ptr("write"),
},
},
},
Expand All @@ -152,7 +152,7 @@ func TestExchange(t *testing.T) {
},
want: &github.InstallationTokenOptions{
Permissions: &github.InstallationPermissions{
PullRequests: github.String("write"),
PullRequests: github.Ptr("write"),
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/octosts/trust_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"slices"

"github.com/coreos/go-oidc/v3/oidc"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
)

type TrustPolicy struct {
Expand Down
6 changes: 3 additions & 3 deletions pkg/prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"chainguard.dev/sdk/sts"
"github.com/chainguard-dev/clog"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/kelseyhightower/envconfig"
"golang.org/x/oauth2"
"google.golang.org/api/idtoken"
Expand Down Expand Up @@ -88,8 +88,8 @@ func Func(ctx context.Context) error {
if _, _, err := ghc.Issues.Create(ctx,
"octo-sts", "prober",
&github.IssueRequest{
Title: github.String("octo-sts prober was able to create an issue"),
Body: github.String("This should fail!"),
Title: github.Ptr("octo-sts prober was able to create an issue"),
Body: github.Ptr("This should fail!"),
}); err == nil {
return fmt.Errorf("expected to fail creating an issue")
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/chainguard-dev/clog"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
"github.com/hashicorp/go-multierror"
"k8s.io/apimachinery/pkg/util/sets"
"sigs.k8s.io/yaml"
Expand Down Expand Up @@ -150,14 +150,14 @@ func (e *Validator) handleSHA(ctx context.Context, client *github.Client, owner,
opts := github.CreateCheckRunOptions{
Name: "Trust Policy Validation",
HeadSHA: sha,
ExternalID: github.String(sha),
Status: github.String("completed"),
Conclusion: github.String(conclusion),
ExternalID: github.Ptr(sha),
Status: github.Ptr("completed"),
Conclusion: github.Ptr(conclusion),
StartedAt: &github.Timestamp{Time: time.Now()},
CompletedAt: &github.Timestamp{Time: time.Now()},
Output: &github.CheckRunOutput{
Title: github.String(title),
Summary: github.String(summary),
Title: github.Ptr(title),
Summary: github.Ptr(summary),
},
}

Expand Down
50 changes: 25 additions & 25 deletions pkg/webhook/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/chainguard-dev/clog"
"github.com/chainguard-dev/clog/slogtest"
"github.com/google/go-cmp/cmp"
"github.com/google/go-github/v66/github"
"github.com/google/go-github/v68/github"
)

func TestValidatePolicy(t *testing.T) {
Expand Down Expand Up @@ -91,11 +91,11 @@ func TestOrgFilter(t *testing.T) {
t.Run(tc.org, func(t *testing.T) {
body, err := json.Marshal(github.PushEvent{
Organization: &github.Organization{
Login: github.String(tc.org),
Login: github.Ptr(tc.org),
},
Repo: &github.PushEventRepository{
Owner: &github.User{
Login: github.String(tc.org),
Login: github.Ptr(tc.org),
},
},
})
Expand Down Expand Up @@ -179,19 +179,19 @@ func TestWebhookOK(t *testing.T) {

body, err := json.Marshal(github.PushEvent{
Installation: &github.Installation{
ID: github.Int64(1111),
ID: github.Ptr(int64(1111)),
},
Organization: &github.Organization{
Login: github.String("foo"),
Login: github.Ptr("foo"),
},
Repo: &github.PushEventRepository{
Owner: &github.User{
Login: github.String("foo"),
Login: github.Ptr("foo"),
},
Name: github.String("bar"),
Name: github.Ptr("bar"),
},
Before: github.String("1234"),
After: github.String("5678"),
Before: github.Ptr("1234"),
After: github.Ptr("5678"),
})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -219,15 +219,15 @@ func TestWebhookOK(t *testing.T) {
want := []*github.CreateCheckRunOptions{{
Name: "Trust Policy Validation",
HeadSHA: "5678",
ExternalID: github.String("5678"),
Status: github.String("completed"),
Conclusion: github.String("success"),
ExternalID: github.Ptr("5678"),
Status: github.Ptr("completed"),
Conclusion: github.Ptr("success"),
// Use time from the response to ignore it.
StartedAt: &github.Timestamp{Time: got[0].StartedAt.Time},
CompletedAt: &github.Timestamp{Time: got[0].CompletedAt.Time},
Output: &github.CheckRunOutput{
Title: github.String("Valid trust policy."),
Summary: github.String(""),
Title: github.Ptr("Valid trust policy."),
Summary: github.Ptr(""),
},
}}
if diff := cmp.Diff(want, got); diff != "" {
Expand Down Expand Up @@ -285,19 +285,19 @@ func TestWebhookDeletedSTS(t *testing.T) {

body, err := json.Marshal(github.PushEvent{
Installation: &github.Installation{
ID: github.Int64(1111),
ID: github.Ptr(int64(1111)),
},
Organization: &github.Organization{
Login: github.String("foo"),
Login: github.Ptr("foo"),
},
Repo: &github.PushEventRepository{
Owner: &github.User{
Login: github.String("foo"),
Login: github.Ptr("foo"),
},
Name: github.String("bar"),
Name: github.Ptr("bar"),
},
Before: github.String("9876"),
After: github.String("4321"),
Before: github.Ptr("9876"),
After: github.Ptr("4321"),
})
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -325,15 +325,15 @@ func TestWebhookDeletedSTS(t *testing.T) {
want := []*github.CreateCheckRunOptions{{
Name: "Trust Policy Validation",
HeadSHA: "4321",
ExternalID: github.String("4321"),
Status: github.String("completed"),
Conclusion: github.String("success"),
ExternalID: github.Ptr("4321"),
Status: github.Ptr("completed"),
Conclusion: github.Ptr("success"),
// Use time from the response to ignore it.
StartedAt: &github.Timestamp{Time: got[0].StartedAt.Time},
CompletedAt: &github.Timestamp{Time: got[0].CompletedAt.Time},
Output: &github.CheckRunOutput{
Title: github.String("Valid trust policy."),
Summary: github.String(""),
Title: github.Ptr("Valid trust policy."),
Summary: github.Ptr(""),
},
}}
if diff := cmp.Diff(want, got); diff != "" {
Expand Down
Loading