From af87389a1970057331f6c745928f2e8982518a3d Mon Sep 17 00:00:00 2001 From: Lucas Holt Date: Sat, 29 Mar 2025 19:39:16 -0400 Subject: [PATCH 01/29] Add instructions for MidnightBSD installation --- docs/install_linux.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/install_linux.md b/docs/install_linux.md index 43ba876a1..09342c802 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -163,6 +163,20 @@ Or via [pkg(8)](https://www.freebsd.org/cgi/man.cgi?pkg(8)): pkg install gh ``` +### MidnightBSD + +MidnightBSD users can install from mports + +```bash +cd /usr/mports/devel/gh/ && make install clean +``` + +Or via [mport(1)](http://man.midnightbsd.org/cgi-bin/man.cgi/mport): + +```bash +mport install gh +``` + ### NetBSD/pkgsrc NetBSD users and those on [platforms supported by pkgsrc](https://pkgsrc.org/#index4h1) can install the [gh package](https://pkgsrc.se/net/gh): From b0ab450a0697b1bced47716b5fee99ec0bbc5ea2 Mon Sep 17 00:00:00 2001 From: Antonio Consuegra Date: Mon, 28 Apr 2025 14:30:36 +0200 Subject: [PATCH 02/29] Fix expected error output of TestRepo/repo-rename-transfer-ownership --- acceptance/testdata/repo/repo-rename-transfer-ownership.txtar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acceptance/testdata/repo/repo-rename-transfer-ownership.txtar b/acceptance/testdata/repo/repo-rename-transfer-ownership.txtar index 6b1a3e3fb..754a609d7 100644 --- a/acceptance/testdata/repo/repo-rename-transfer-ownership.txtar +++ b/acceptance/testdata/repo/repo-rename-transfer-ownership.txtar @@ -3,7 +3,7 @@ exec gh repo create $ORG/$SCRIPT_NAME-$RANDOM_STRING --add-readme --private # Attempt to rename the repo with a slash in the name ! exec gh repo rename $ORG/new-name --repo=$ORG/$SCRIPT_NAME-$RANDOM_STRING --yes -stderr 'New repository name cannot contain '/' character - to transfer a repository to a new owner, you must follow additional steps on GitHub.com. For more information on transferring repository ownership, see .' +stderr 'New repository name cannot contain \''/\'' character - to transfer a repository to a new owner, you must follow additional steps on . For more information on transferring repository ownership, see .' # Defer repo deletion defer gh repo delete $ORG/$SCRIPT_NAME-$RANDOM_STRING --yes \ No newline at end of file From ed57df1a9af6c614b6396abbcf85b6a0aa0a35a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 14:26:44 +0000 Subject: [PATCH 03/29] chore(deps): bump google.golang.org/grpc from 1.72.0 to 1.72.2 Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.72.0 to 1.72.2. - [Release notes](https://github.com/grpc/grpc-go/releases) - [Commits](https://github.com/grpc/grpc-go/compare/v1.72.0...v1.72.2) --- updated-dependencies: - dependency-name: google.golang.org/grpc dependency-version: 1.72.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 108c5722d..62aa7437d 100644 --- a/go.mod +++ b/go.mod @@ -54,7 +54,7 @@ require ( golang.org/x/sync v0.14.0 golang.org/x/term v0.32.0 golang.org/x/text v0.25.0 - google.golang.org/grpc v1.72.0 + google.golang.org/grpc v1.72.2 google.golang.org/protobuf v1.36.6 gopkg.in/h2non/gock.v1 v1.1.2 gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 8d50af689..8d55e736d 100644 --- a/go.sum +++ b/go.sum @@ -612,8 +612,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e h1: google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e/go.mod h1:085qFyf2+XaZlRdCgKNCIZ3afY2p4HHZdoIRpId8F4A= google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e h1:ztQaXfzEXTmCBvbtWYRhJxW+0iJcz2qXfd38/e9l7bA= google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= -google.golang.org/grpc v1.72.0 h1:S7UkcVa60b5AAQTaO6ZKamFp1zMZSU0fGDK2WZLbBnM= -google.golang.org/grpc v1.72.0/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= +google.golang.org/grpc v1.72.2 h1:TdbGzwb82ty4OusHWepvFWGLgIbNo1/SUynEN0ssqv8= +google.golang.org/grpc v1.72.2/go.mod h1:wH5Aktxcg25y1I3w7H69nHfXdOG3UiadoBtjh3izSDM= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From cde860be883b444e9151b3c560eea5c28420d871 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Tue, 3 Jun 2025 13:33:52 +0100 Subject: [PATCH 04/29] Iterate on `pr edit` problems with existing assignees This commit is a handful of changes around `gh pr edit --add-assignee` behavior. Most notably, fixing a bug where the assigned actors weren't being dropped. In addition to this, I was refactoring the testing setup to allow for individual test table scenarios could be contained. --- pkg/cmd/issue/edit/edit_test.go | 17 ++- pkg/cmd/pr/edit/edit.go | 1 + pkg/cmd/pr/edit/edit_test.go | 177 ++++++++++++++++++++++++-------- 3 files changed, 144 insertions(+), 51 deletions(-) diff --git a/pkg/cmd/issue/edit/edit_test.go b/pkg/cmd/issue/edit/edit_test.go index 4840cbf7a..7d2d36662 100644 --- a/pkg/cmd/issue/edit/edit_test.go +++ b/pkg/cmd/issue/edit/edit_test.go @@ -631,10 +631,11 @@ func Test_editRun(t *testing.T) { }, EditFieldsSurvey: func(p prShared.EditPrompter, eo *prShared.Editable, _ string) error { // Checking that the display name is being used in the prompt. - require.Equal(t, eo.Assignees.Default, []string{"hubot", "MonaLisa (Mona Display Name)"}) + require.Equal(t, eo.Assignees.Default, []string{"hubot"}) + require.Equal(t, eo.Assignees.DefaultLogins, []string{"hubot"}) - // Mocking a selection of only MonaLisa in the prompt. - eo.Assignees.Value = []string{"MonaLisa (Mona Display Name)"} + // Adding MonaLisa as PR assignee, should preserve hubot. + eo.Assignees.Value = []string{"hubot", "MonaLisa (Mona Display Name)"} return nil }, FetchOptions: prShared.FetchOptions, @@ -662,7 +663,7 @@ func Test_editRun(t *testing.T) { // Checking that despite the display name being returned // from the EditFieldsSurvey, the ID is still // used in the mutation. - require.Contains(t, inputs["actorIds"], "MONAID") + require.Subset(t, inputs["actorIds"], []string{"MONAID", "HUBOTID"}) }), ) }, @@ -809,15 +810,9 @@ func mockIsssueNumberGetWithAssignedActors(_ *testing.T, reg *httpmock.Registry, "id": "HUBOTID", "login": "hubot", "__typename": "Bot" - }, - { - "id": "MONAID", - "login": "MonaLisa", - "name": "Mona Display Name", - "__typename": "User" } ], - "totalCount": 2 + "totalCount": 1 } } } } }`, number)), ) diff --git a/pkg/cmd/pr/edit/edit.go b/pkg/cmd/pr/edit/edit.go index 5e1f19b18..becbfce47 100644 --- a/pkg/cmd/pr/edit/edit.go +++ b/pkg/cmd/pr/edit/edit.go @@ -228,6 +228,7 @@ func editRun(opts *EditOptions) error { if pr.AssignedActorsUsed { editable.Assignees.ActorAssignees = true editable.Assignees.Default = pr.AssignedActors.DisplayNames() + editable.Assignees.DefaultLogins = pr.AssignedActors.Logins() } else { editable.Assignees.Default = pr.Assignees.Logins() } diff --git a/pkg/cmd/pr/edit/edit_test.go b/pkg/cmd/pr/edit/edit_test.go index 0c40e3839..0b731cd00 100644 --- a/pkg/cmd/pr/edit/edit_test.go +++ b/pkg/cmd/pr/edit/edit_test.go @@ -532,8 +532,31 @@ func Test_editRun(t *testing.T) { URL: "https://github.com/OWNER/REPO/pull/123", AssignedActorsUsed: true, }, ghrepo.New("OWNER", "REPO")), - Interactive: true, - Surveyor: testSurveyor{}, + Interactive: true, + Surveyor: testSurveyor{ + fieldsToEdit: func(e *shared.Editable) error { + e.Title.Edited = true + e.Body.Edited = true + e.Reviewers.Edited = true + e.Assignees.Edited = true + e.Labels.Edited = true + e.Projects.Edited = true + e.Milestone.Edited = true + return nil + }, + editFields: func(e *shared.Editable, _ string) error { + e.Title.Value = "new title" + e.Body.Value = "new body" + e.Reviewers.Value = []string{"monalisa", "hubot", "OWNER/core", "OWNER/external"} + e.Assignees.Value = []string{"monalisa", "hubot"} + e.Labels.Value = []string{"feature", "TODO", "bug"} + e.Labels.Add = []string{"feature", "TODO", "bug"} + e.Labels.Remove = []string{"docs"} + e.Projects.Value = []string{"Cleanup", "CleanupV2"} + e.Milestone.Value = "GA" + return nil + }, + }, Fetcher: testFetcher{}, EditorRetriever: testEditorRetriever{}, }, @@ -556,8 +579,29 @@ func Test_editRun(t *testing.T) { URL: "https://github.com/OWNER/REPO/pull/123", AssignedActorsUsed: true, }, ghrepo.New("OWNER", "REPO")), - Interactive: true, - Surveyor: testSurveyor{skipReviewers: true}, + Interactive: true, + Surveyor: testSurveyor{ + fieldsToEdit: func(e *shared.Editable) error { + e.Title.Edited = true + e.Body.Edited = true + e.Assignees.Edited = true + e.Labels.Edited = true + e.Projects.Edited = true + e.Milestone.Edited = true + return nil + }, + editFields: func(e *shared.Editable, _ string) error { + e.Title.Value = "new title" + e.Body.Value = "new body" + e.Assignees.Value = []string{"monalisa", "hubot"} + e.Labels.Value = []string{"feature", "TODO", "bug"} + e.Labels.Add = []string{"feature", "TODO", "bug"} + e.Labels.Remove = []string{"docs"} + e.Projects.Value = []string{"Cleanup", "CleanupV2"} + e.Milestone.Value = "GA" + return nil + }, + }, Fetcher: testFetcher{}, EditorRetriever: testEditorRetriever{}, }, @@ -579,8 +623,30 @@ func Test_editRun(t *testing.T) { URL: "https://github.com/OWNER/REPO/pull/123", AssignedActorsUsed: true, }, ghrepo.New("OWNER", "REPO")), - Interactive: true, - Surveyor: testSurveyor{removeAllReviewers: true}, + Interactive: true, + Surveyor: testSurveyor{ + fieldsToEdit: func(e *shared.Editable) error { + e.Title.Edited = true + e.Body.Edited = true + e.Assignees.Edited = true + e.Labels.Edited = true + e.Projects.Edited = true + e.Milestone.Edited = true + return nil + }, + editFields: func(e *shared.Editable, _ string) error { + e.Title.Value = "new title" + e.Body.Value = "new body" + e.Reviewers.Remove = []string{"monalisa", "hubot", "OWNER/core", "OWNER/external", "dependabot"} + e.Assignees.Value = []string{"monalisa", "hubot"} + e.Labels.Value = []string{"feature", "TODO", "bug"} + e.Labels.Add = []string{"feature", "TODO", "bug"} + e.Labels.Remove = []string{"docs"} + e.Projects.Value = []string{"Cleanup", "CleanupV2"} + e.Milestone.Value = "GA" + return nil + }, + }, Fetcher: testFetcher{}, EditorRetriever: testEditorRetriever{}, }, @@ -659,6 +725,59 @@ func Test_editRun(t *testing.T) { } } +func Test_editRun_actors(t *testing.T) { + ios, _, stdout, stderr := iostreams.Test() + ios.SetStdoutTTY(true) + ios.SetStdinTTY(true) + ios.SetStderrTTY(true) + + reg := &httpmock.Registry{} + defer reg.Verify(t) + reg.Register( + httpmock.GraphQL(`query RepositoryAssignableActors\b`), + httpmock.StringResponse(` + { "data": { "repository": { "suggestedActors": { + "nodes": [ + { "login": "hubot", "id": "HUBOTID", "__typename": "Bot" }, + { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name", "__typename": "User" } + ], + "pageInfo": { "hasNextPage": false } + } } } } + `)) + mockPullRequestUpdate(reg) + mockPullRequestUpdateActorAssignees(reg) + + httpClient := func() (*http.Client, error) { return &http.Client{Transport: reg}, nil } + baseRepo := func() (ghrepo.Interface, error) { return ghrepo.New("OWNER", "REPO"), nil } + + input := &EditOptions{ + Detector: &fd.EnabledDetectorMock{}, + SelectorArg: "123", + Finder: shared.NewMockFinder("123", &api.PullRequest{ + URL: "https://github.com/OWNER/REPO/pull/123", + }, ghrepo.New("OWNER", "REPO")), + Interactive: false, + Editable: shared.Editable{ + Assignees: shared.EditableAssignees{ + EditableSlice: shared.EditableSlice{ + Add: []string{"monalisa", "hubot"}, + Remove: []string{"octocat"}, + Edited: true, + }, + }, + }, + Fetcher: testFetcher{}, + } + input.IO = ios + input.HttpClient = httpClient + input.BaseRepo = baseRepo + + err := editRun(input) + assert.NoError(t, err) + assert.Equal(t, "https://github.com/OWNER/REPO/pull/123\n", stdout.String()) + assert.Equal(t, "", stderr.String()) +} + func mockRepoMetadata(reg *httpmock.Registry, skipReviewers bool) { reg.Register( httpmock.GraphQL(`query RepositoryAssignableActors\b`), @@ -666,7 +785,7 @@ func mockRepoMetadata(reg *httpmock.Registry, skipReviewers bool) { { "data": { "repository": { "suggestedActors": { "nodes": [ { "login": "hubot", "id": "HUBOTID", "__typename": "Bot" }, - { "login": "MonaLisa", "id": "MONAID", "__typename": "User" } + { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name", "__typename": "User" } ], "pageInfo": { "hasNextPage": false } } } } } @@ -813,48 +932,26 @@ func mockProjectV2ItemUpdate(reg *httpmock.Registry) { } type testFetcher struct{} -type testSurveyor struct { - skipReviewers bool - removeAllReviewers bool -} -type testEditorRetriever struct{} func (f testFetcher) EditableOptionsFetch(client *api.Client, repo ghrepo.Interface, opts *shared.Editable) error { return shared.FetchOptions(client, repo, opts) } -func (s testSurveyor) FieldsToEdit(e *shared.Editable) error { - e.Title.Edited = true - e.Body.Edited = true - if !s.skipReviewers { - e.Reviewers.Edited = true - } - e.Assignees.Edited = true - e.Labels.Edited = true - e.Projects.Edited = true - e.Milestone.Edited = true - return nil +type testSurveyor struct { + fieldsToEdit func(e *shared.Editable) error + editFields func(e *shared.Editable, editorCmd string) error } -func (s testSurveyor) EditFields(e *shared.Editable, _ string) error { - e.Title.Value = "new title" - e.Body.Value = "new body" - if !s.skipReviewers { - if s.removeAllReviewers { - e.Reviewers.Remove = []string{"monalisa", "hubot", "OWNER/core", "OWNER/external", "dependabot"} - } else { - e.Reviewers.Value = []string{"monalisa", "hubot", "OWNER/core", "OWNER/external"} - } - } - e.Assignees.Value = []string{"monalisa", "hubot"} - e.Labels.Value = []string{"feature", "TODO", "bug"} - e.Labels.Add = []string{"feature", "TODO", "bug"} - e.Labels.Remove = []string{"docs"} - e.Projects.Value = []string{"Cleanup", "CleanupV2"} - e.Milestone.Value = "GA" - return nil +func (s testSurveyor) FieldsToEdit(e *shared.Editable) error { + return s.fieldsToEdit(e) } +func (s testSurveyor) EditFields(e *shared.Editable, editorCmd string) error { + return s.editFields(e, editorCmd) +} + +type testEditorRetriever struct{} + func (t testEditorRetriever) Retrieve() (string, error) { return "vim", nil } From a24d39ac87b14979f2a52e3f417f92d17e53186e Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Tue, 3 Jun 2025 13:48:01 +0100 Subject: [PATCH 05/29] Fix test, remove partial standalone test --- pkg/cmd/pr/edit/edit_test.go | 54 +----------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/pkg/cmd/pr/edit/edit_test.go b/pkg/cmd/pr/edit/edit_test.go index 0b731cd00..99f949e8b 100644 --- a/pkg/cmd/pr/edit/edit_test.go +++ b/pkg/cmd/pr/edit/edit_test.go @@ -628,6 +628,7 @@ func Test_editRun(t *testing.T) { fieldsToEdit: func(e *shared.Editable) error { e.Title.Edited = true e.Body.Edited = true + e.Reviewers.Edited = true e.Assignees.Edited = true e.Labels.Edited = true e.Projects.Edited = true @@ -725,59 +726,6 @@ func Test_editRun(t *testing.T) { } } -func Test_editRun_actors(t *testing.T) { - ios, _, stdout, stderr := iostreams.Test() - ios.SetStdoutTTY(true) - ios.SetStdinTTY(true) - ios.SetStderrTTY(true) - - reg := &httpmock.Registry{} - defer reg.Verify(t) - reg.Register( - httpmock.GraphQL(`query RepositoryAssignableActors\b`), - httpmock.StringResponse(` - { "data": { "repository": { "suggestedActors": { - "nodes": [ - { "login": "hubot", "id": "HUBOTID", "__typename": "Bot" }, - { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name", "__typename": "User" } - ], - "pageInfo": { "hasNextPage": false } - } } } } - `)) - mockPullRequestUpdate(reg) - mockPullRequestUpdateActorAssignees(reg) - - httpClient := func() (*http.Client, error) { return &http.Client{Transport: reg}, nil } - baseRepo := func() (ghrepo.Interface, error) { return ghrepo.New("OWNER", "REPO"), nil } - - input := &EditOptions{ - Detector: &fd.EnabledDetectorMock{}, - SelectorArg: "123", - Finder: shared.NewMockFinder("123", &api.PullRequest{ - URL: "https://github.com/OWNER/REPO/pull/123", - }, ghrepo.New("OWNER", "REPO")), - Interactive: false, - Editable: shared.Editable{ - Assignees: shared.EditableAssignees{ - EditableSlice: shared.EditableSlice{ - Add: []string{"monalisa", "hubot"}, - Remove: []string{"octocat"}, - Edited: true, - }, - }, - }, - Fetcher: testFetcher{}, - } - input.IO = ios - input.HttpClient = httpClient - input.BaseRepo = baseRepo - - err := editRun(input) - assert.NoError(t, err) - assert.Equal(t, "https://github.com/OWNER/REPO/pull/123\n", stdout.String()) - assert.Equal(t, "", stderr.String()) -} - func mockRepoMetadata(reg *httpmock.Registry, skipReviewers bool) { reg.Register( httpmock.GraphQL(`query RepositoryAssignableActors\b`), From ed4b90104f290148229837324a2d2b63ad79be08 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:20:37 +0100 Subject: [PATCH 06/29] test(pr): Add tests for actor assignees --- pkg/cmd/issue/edit/edit_test.go | 4 +- pkg/cmd/pr/edit/edit_test.go | 65 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/issue/edit/edit_test.go b/pkg/cmd/issue/edit/edit_test.go index 7d2d36662..d14b2f462 100644 --- a/pkg/cmd/issue/edit/edit_test.go +++ b/pkg/cmd/issue/edit/edit_test.go @@ -631,8 +631,8 @@ func Test_editRun(t *testing.T) { }, EditFieldsSurvey: func(p prShared.EditPrompter, eo *prShared.Editable, _ string) error { // Checking that the display name is being used in the prompt. - require.Equal(t, eo.Assignees.Default, []string{"hubot"}) - require.Equal(t, eo.Assignees.DefaultLogins, []string{"hubot"}) + require.Equal(t, []string{"hubot"}, eo.Assignees.Default) + require.Equal(t, []string{"hubot"}, eo.Assignees.DefaultLogins) // Adding MonaLisa as PR assignee, should preserve hubot. eo.Assignees.Value = []string{"hubot", "MonaLisa (Mona Display Name)"} diff --git a/pkg/cmd/pr/edit/edit_test.go b/pkg/cmd/pr/edit/edit_test.go index 99f949e8b..374625912 100644 --- a/pkg/cmd/pr/edit/edit_test.go +++ b/pkg/cmd/pr/edit/edit_test.go @@ -661,6 +661,71 @@ func Test_editRun(t *testing.T) { }, stdout: "https://github.com/OWNER/REPO/pull/123\n", }, + { + name: "interactive prompts with actor assignee display names when actors available", + input: &EditOptions{ + Detector: &fd.EnabledDetectorMock{}, + SelectorArg: "123", + Finder: shared.NewMockFinder("123", &api.PullRequest{ + URL: "https://github.com/OWNER/REPO/pull/123", + AssignedActorsUsed: true, + AssignedActors: api.AssignedActors{ + Nodes: []api.Actor{ + { + ID: "HUBOTID", + Login: "hubot", + TypeName: "Bot", + }, + }, + TotalCount: 1, + }, + }, ghrepo.New("OWNER", "REPO")), + Interactive: true, + Surveyor: testSurveyor{ + fieldsToEdit: func(e *shared.Editable) error { + e.Assignees.Edited = true + return nil + }, + editFields: func(e *shared.Editable, _ string) error { + // Checking that the display name is being used in the prompt. + require.Equal(t, []string{"hubot"}, e.Assignees.Default) + require.Equal(t, []string{"hubot"}, e.Assignees.DefaultLogins) + + // Adding MonaLisa as PR assignee, should preserve hubot. + e.Assignees.Value = []string{"hubot", "MonaLisa (Mona Display Name)"} + return nil + }, + }, + Fetcher: testFetcher{}, + EditorRetriever: testEditorRetriever{}, + }, + httpStubs: func(reg *httpmock.Registry) { + reg.Register( + httpmock.GraphQL(`query RepositoryAssignableActors\b`), + httpmock.StringResponse(` + { "data": { "repository": { "suggestedActors": { + "nodes": [ + { "login": "hubot", "id": "HUBOTID", "__typename": "Bot" }, + { "login": "MonaLisa", "id": "MONAID", "name": "Mona Display Name", "__typename": "User" } + ], + "pageInfo": { "hasNextPage": false } + } } } } + `)) + mockPullRequestUpdate(reg) + reg.Register( + httpmock.GraphQL(`mutation ReplaceActorsForAssignable\b`), + httpmock.GraphQLMutation(` + { "data": { "replaceActorsForAssignable": { "__typename": "" } } }`, + func(inputs map[string]interface{}) { + // Checking that despite the display name being returned + // from the EditFieldsSurvey, the ID is still + // used in the mutation. + require.Subset(t, inputs["actorIds"], []string{"MONAID", "HUBOTID"}) + }), + ) + }, + stdout: "https://github.com/OWNER/REPO/pull/123\n", + }, { name: "Legacy assignee users are fetched and updated on unsupported GitHub Hosts", input: &EditOptions{ From 2266c7a5b527d32bb80939a52bddaf99dc797db0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:57:13 +0000 Subject: [PATCH 07/29] chore(deps): bump mislav/bump-homebrew-formula-action from 3.2 to 3.4 Bumps [mislav/bump-homebrew-formula-action](https://github.com/mislav/bump-homebrew-formula-action) from 3.2 to 3.4. - [Release notes](https://github.com/mislav/bump-homebrew-formula-action/releases) - [Commits](https://github.com/mislav/bump-homebrew-formula-action/compare/942e550c6344cfdb9e1ab29b9bb9bf0c43efa19b...8e2baa47daaa8db10fcdeb04105dfa6850eb0d68) --- updated-dependencies: - dependency-name: mislav/bump-homebrew-formula-action dependency-version: '3.4' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deployment.yml | 2 +- .github/workflows/homebrew-bump.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 850cc19b7..d5cc67ec9 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -384,7 +384,7 @@ jobs: git diff --name-status @{upstream}.. fi - name: Bump homebrew-core formula - uses: mislav/bump-homebrew-formula-action@942e550c6344cfdb9e1ab29b9bb9bf0c43efa19b + uses: mislav/bump-homebrew-formula-action@8e2baa47daaa8db10fcdeb04105dfa6850eb0d68 if: inputs.environment == 'production' && !contains(inputs.tag_name, '-') with: formula-name: gh diff --git a/.github/workflows/homebrew-bump.yml b/.github/workflows/homebrew-bump.yml index 228f1a345..0b42803aa 100644 --- a/.github/workflows/homebrew-bump.yml +++ b/.github/workflows/homebrew-bump.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Bump homebrew-core formula - uses: mislav/bump-homebrew-formula-action@942e550c6344cfdb9e1ab29b9bb9bf0c43efa19b + uses: mislav/bump-homebrew-formula-action@8e2baa47daaa8db10fcdeb04105dfa6850eb0d68 if: inputs.environment == 'production' && !contains(inputs.tag_name, '-') with: formula-name: gh From bde303dab28caac33926e38d5de6591a0b4c9a48 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Tue, 10 Jun 2025 13:57:31 +0100 Subject: [PATCH 08/29] test: fix test data const Signed-off-by: Babak K. Shandiz --- pkg/cmd/pr/shared/finder_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/pr/shared/finder_test.go b/pkg/cmd/pr/shared/finder_test.go index 28c2337d3..0fd96e09b 100644 --- a/pkg/cmd/pr/shared/finder_test.go +++ b/pkg/cmd/pr/shared/finder_test.go @@ -728,7 +728,7 @@ func TestFindAssignableActors(t *testing.T) { pr, _, err := f.Find(FindOptions{ Detector: &fd.DisabledDetectorMock{}, Fields: []string{"assignees"}, - Selector: "https://github.com/cli/cli/pull/123", + Selector: "https://github.com/cli/cli/pull/13", }) require.NoError(t, err) @@ -772,7 +772,7 @@ func TestFindAssignableActors(t *testing.T) { pr, _, err := f.Find(FindOptions{ Detector: &fd.EnabledDetectorMock{}, Fields: []string{"assignees"}, - Selector: "https://github.com/cli/cli/pull/123", + Selector: "https://github.com/cli/cli/pull/13", }) require.NoError(t, err) From 52bde8a3f7b1218cb11f6369671623ac0af81b48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:52:22 +0000 Subject: [PATCH 09/29] chore(deps): bump github.com/sigstore/protobuf-specs from 0.4.2 to 0.4.3 Bumps [github.com/sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs) from 0.4.2 to 0.4.3. - [Release notes](https://github.com/sigstore/protobuf-specs/releases) - [Changelog](https://github.com/sigstore/protobuf-specs/blob/main/CHANGELOG.md) - [Commits](https://github.com/sigstore/protobuf-specs/compare/v0.4.2...v0.4.3) --- updated-dependencies: - dependency-name: github.com/sigstore/protobuf-specs dependency-version: 0.4.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a4c973df1..49b7c8ddf 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/opentracing/opentracing-go v1.2.0 github.com/rivo/tview v0.0.0-20221029100920-c4a7e501810d github.com/shurcooL/githubv4 v0.0.0-20240120211514-18a1ae0e79dc - github.com/sigstore/protobuf-specs v0.4.2 + github.com/sigstore/protobuf-specs v0.4.3 github.com/sigstore/sigstore-go v1.0.0 github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 diff --git a/go.sum b/go.sum index 718e0ca67..598a713a2 100644 --- a/go.sum +++ b/go.sum @@ -455,8 +455,8 @@ github.com/shurcooL/githubv4 v0.0.0-20240120211514-18a1ae0e79dc h1:vH0NQbIDk+mJL github.com/shurcooL/githubv4 v0.0.0-20240120211514-18a1ae0e79dc/go.mod h1:zqMwyHmnN/eDOZOdiTohqIUKUrTFX62PNlu7IJdu0q8= github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466 h1:17JxqqJY66GmZVHkmAsGEkcIu0oCe3AM420QDgGwZx0= github.com/shurcooL/graphql v0.0.0-20230722043721-ed46e5a46466/go.mod h1:9dIRpgIY7hVhoqfe0/FcYp0bpInZaT7dc3BYOprrIUE= -github.com/sigstore/protobuf-specs v0.4.2 h1:bD5bnhctpGNiR+FAEZl7N95XkN8TJFrNMIcWLunDtxA= -github.com/sigstore/protobuf-specs v0.4.2/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= +github.com/sigstore/protobuf-specs v0.4.3 h1:kRgJ+ciznipH9xhrkAbAEHuuxD3GhYnGC873gZpjJT4= +github.com/sigstore/protobuf-specs v0.4.3/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= github.com/sigstore/rekor v1.3.10 h1:/mSvRo4MZ/59ECIlARhyykAlQlkmeAQpvBPlmJtZOCU= github.com/sigstore/rekor v1.3.10/go.mod h1:JvryKJ40O0XA48MdzYUPu0y4fyvqt0C4iSY7ri9iu3A= github.com/sigstore/sigstore v1.9.4 h1:64+OGed80+A4mRlNzRd055vFcgBeDghjZw24rPLZgDU= From ee3db50e43915adc8dd1c3014a0ac5f491f7e50b Mon Sep 17 00:00:00 2001 From: William Martin Date: Wed, 11 Jun 2025 13:47:18 +0200 Subject: [PATCH 10/29] Avoid requesting PR reviewer twice --- api/queries_repo.go | 23 +++++++------ api/queries_repo_test.go | 72 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+), 10 deletions(-) diff --git a/api/queries_repo.go b/api/queries_repo.go index efbcfcb19..3190745ea 100644 --- a/api/queries_repo.go +++ b/api/queries_repo.go @@ -709,19 +709,22 @@ func (m *RepoMetadataResult) MembersToIDs(names []string) ([]string, error) { } // Look for ID in assignable actors if not found in assignable users - for _, a := range m.AssignableActors { - if strings.EqualFold(assigneeLogin, a.Login()) { - ids = append(ids, a.ID()) - found = true - break - } - if strings.EqualFold(assigneeLogin, a.DisplayName()) { - ids = append(ids, a.ID()) - found = true - break + if !found { + for _, a := range m.AssignableActors { + if strings.EqualFold(assigneeLogin, a.Login()) { + ids = append(ids, a.ID()) + found = true + break + } + if strings.EqualFold(assigneeLogin, a.DisplayName()) { + ids = append(ids, a.ID()) + found = true + break + } } } + // And if we still didn't find an ID, return an error if !found { return nil, fmt.Errorf("'%s' not found", assigneeLogin) } diff --git a/api/queries_repo_test.go b/api/queries_repo_test.go index 9040a0018..c291fc468 100644 --- a/api/queries_repo_test.go +++ b/api/queries_repo_test.go @@ -461,6 +461,78 @@ t001: team(slug:"robots"){id,slug} } } +func TestMembersToIDs(t *testing.T) { + t.Parallel() + + t.Run("finds ids in assignable users", func(t *testing.T) { + t.Parallel() + + repoMetadataResult := RepoMetadataResult{ + AssignableUsers: []AssignableUser{ + NewAssignableUser("MONAID", "monalisa", ""), + NewAssignableUser("MONAID2", "monalisa2", ""), + }, + AssignableActors: []AssignableActor{ + NewAssignableBot("HUBOTID", "hubot"), + }, + } + ids, err := repoMetadataResult.MembersToIDs([]string{"monalisa"}) + require.NoError(t, err) + require.Equal(t, []string{"MONAID"}, ids) + }) + + t.Run("finds ids by assignable actor logins", func(t *testing.T) { + t.Parallel() + + repoMetadataResult := RepoMetadataResult{ + AssignableActors: []AssignableActor{ + NewAssignableBot("HUBOTID", "hubot"), + NewAssignableUser("MONAID", "monalisa", ""), + }, + } + ids, err := repoMetadataResult.MembersToIDs([]string{"monalisa"}) + require.NoError(t, err) + require.Equal(t, []string{"MONAID"}, ids) + }) + + t.Run("finds ids by assignable actor display names", func(t *testing.T) { + t.Parallel() + + repoMetadataResult := RepoMetadataResult{ + AssignableActors: []AssignableActor{ + NewAssignableUser("MONAID", "monalisa", "mona"), + }, + } + ids, err := repoMetadataResult.MembersToIDs([]string{"monalisa (mona)"}) + require.NoError(t, err) + require.Equal(t, []string{"MONAID"}, ids) + }) + + t.Run("when a name appears in both assignable users and actors, the id is only returned once", func(t *testing.T) { + t.Parallel() + + repoMetadataResult := RepoMetadataResult{ + AssignableUsers: []AssignableUser{ + NewAssignableUser("MONAID", "monalisa", ""), + }, + AssignableActors: []AssignableActor{ + NewAssignableUser("MONAID", "monalisa", ""), + }, + } + ids, err := repoMetadataResult.MembersToIDs([]string{"monalisa"}) + require.NoError(t, err) + require.Equal(t, []string{"MONAID"}, ids) + }) + + t.Run("when id is not found, returns an error", func(t *testing.T) { + t.Parallel() + + repoMetadataResult := RepoMetadataResult{} + _, err := repoMetadataResult.MembersToIDs([]string{"monalisa"}) + require.Error(t, err) + }) +} + func sliceEqual(a, b []string) bool { if len(a) != len(b) { return false From 1eee56ec00ae1ff0c08e03adcd0d7a4c79dd79aa Mon Sep 17 00:00:00 2001 From: Dylan Ancel Date: Wed, 11 Jun 2025 16:28:03 +0200 Subject: [PATCH 11/29] Add accurate context when `run rerun` fails (#10774) * Add accurate context when run rerun fails * Update tests to verify behaviour for API errors Signed-off-by: Babak K. Shandiz * Use the new `httpmock.JSONErrorResponse` helper Signed-off-by: Babak K. Shandiz --------- Signed-off-by: Babak K. Shandiz Co-authored-by: Babak K. Shandiz --- pkg/cmd/run/rerun/rerun.go | 5 +---- pkg/cmd/run/rerun/rerun_test.go | 39 ++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/run/rerun/rerun.go b/pkg/cmd/run/rerun/rerun.go index 66d5d6f64..8777e0a8a 100644 --- a/pkg/cmd/run/rerun/rerun.go +++ b/pkg/cmd/run/rerun/rerun.go @@ -202,10 +202,7 @@ func rerunRun(client *api.Client, repo ghrepo.Interface, run *shared.Run, onlyFa if err != nil { var httpError api.HTTPError if errors.As(err, &httpError) && httpError.StatusCode == 403 { - if httpError.Message == "Unable to retry this workflow run because it was created over a month ago" { - return fmt.Errorf("run %d cannot be rerun; %s", run.ID, httpError.Message) - } - return fmt.Errorf("run %d cannot be rerun; its workflow file may be broken", run.ID) + return fmt.Errorf("run %d cannot be rerun; %s", run.ID, httpError.Message) } return fmt.Errorf("failed to rerun: %w", err) } diff --git a/pkg/cmd/run/rerun/rerun_test.go b/pkg/cmd/run/rerun/rerun_test.go index 0dc74129e..77f0a922f 100644 --- a/pkg/cmd/run/rerun/rerun_test.go +++ b/pkg/cmd/run/rerun/rerun_test.go @@ -14,6 +14,7 @@ import ( "github.com/cli/cli/v2/pkg/cmdutil" "github.com/cli/cli/v2/pkg/httpmock" "github.com/cli/cli/v2/pkg/iostreams" + "github.com/cli/go-gh/v2/pkg/api" "github.com/google/shlex" "github.com/stretchr/testify/assert" ) @@ -374,7 +375,7 @@ func TestRerun(t *testing.T) { errOut: "no recent runs have failed; please specify a specific ``", }, { - name: "unrerunnable", + name: "API error (403)", tty: true, opts: &RerunOptions{ RunID: "3", @@ -392,10 +393,42 @@ func TestRerun(t *testing.T) { })) reg.Register( httpmock.REST("POST", "repos/OWNER/REPO/actions/runs/3/rerun"), - httpmock.StatusStringResponse(403, "no")) + httpmock.JSONErrorResponse(403, api.HTTPError{ + StatusCode: 403, + Message: "blah blah", + }), + ) }, wantErr: true, - errOut: "run 3 cannot be rerun; its workflow file may be broken", + errOut: "run 3 cannot be rerun; blah blah", + }, + { + name: "API error (non-403)", + tty: true, + opts: &RerunOptions{ + RunID: "3", + }, + httpStubs: func(reg *httpmock.Registry) { + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/runs/3"), + httpmock.JSONResponse(shared.SuccessfulRun)) + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/workflows/123"), + httpmock.JSONResponse(workflowShared.WorkflowsPayload{ + Workflows: []workflowShared.Workflow{ + shared.TestWorkflow, + }, + })) + reg.Register( + httpmock.REST("POST", "repos/OWNER/REPO/actions/runs/3/rerun"), + httpmock.JSONErrorResponse(500, api.HTTPError{ + StatusCode: 500, + Message: "blah blah", + }), + ) + }, + wantErr: true, + errOut: "failed to rerun: HTTP 500: blah blah (https://api.github.com/repos/OWNER/REPO/actions/runs/3/rerun)", }, } From f8a31330031b66716fa10c8fbdfb1f3d005e5f3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jun 2025 14:33:02 +0000 Subject: [PATCH 12/29] chore(deps): bump actions/attest-build-provenance from 2.3.0 to 2.4.0 Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/actions/attest-build-provenance/releases) - [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md) - [Commits](https://github.com/actions/attest-build-provenance/compare/db473fddc028af60658334401dc6fa3ffd8669fd...e8998f949152b193b063cb0ec769d69d929409be) --- updated-dependencies: - dependency-name: actions/attest-build-provenance dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/deployment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index d5cc67ec9..17758a3e6 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -309,7 +309,7 @@ jobs: rpmsign --addsign dist/*.rpm - name: Attest release artifacts if: inputs.environment == 'production' - uses: actions/attest-build-provenance@db473fddc028af60658334401dc6fa3ffd8669fd # v2.3.0 + uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2.4.0 with: subject-path: "dist/gh_*" - name: Run createrepo From 928a326cee78313df3fc7085e2e113edc06bc98c Mon Sep 17 00:00:00 2001 From: William Martin Date: Mon, 16 Jun 2025 17:09:04 +0200 Subject: [PATCH 13/29] Add workflow to check `help wanted` labelling (#11105) Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com> Co-authored-by: Babak K. Shandiz Co-authored-by: Andy Feller --- .github/workflows/codeql.yml | 9 +- .github/workflows/pr-help-wanted.yml | 29 ++++++ .../workflows/scripts/check-help-wanted.sh | 93 +++++++++++++++++++ 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pr-help-wanted.yml create mode 100755 .github/workflows/scripts/check-help-wanted.sh diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8cd5ecbee..d74e1c142 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,6 +18,10 @@ permissions: jobs: CodeQL-Build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + language: ['go', 'actions'] steps: - name: Check out code @@ -26,13 +30,16 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: - languages: go + languages: ${{ matrix.language }} queries: security-and-quality - name: Setup Go + if: matrix.language == 'go' uses: actions/setup-go@v5 with: go-version-file: 'go.mod' - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{ matrix.language }}" diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml new file mode 100644 index 000000000..5475d2eff --- /dev/null +++ b/.github/workflows/pr-help-wanted.yml @@ -0,0 +1,29 @@ +name: PR Help Wanted Check +on: + pull_request_target: + types: [opened] + +permissions: + contents: none + issues: read + pull-requests: write + +jobs: + check-help-wanted: + runs-on: ubuntu-latest + steps: + - name: Check for issues without help-wanted label + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} + PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} + if: !github.event.pull_request.draft + run: | + # Skip if PR is from a bot or org member + if [ "$PR_AUTHOR_TYPE" = "Bot" ] || "gh api orgs/cli/public_members/${PR_AUTHOR}" --silent 2>/dev/null + then + exit 0 + fi + + # Run the script to check for issues without help-wanted label + bash .github/scripts/check-help-wanted.sh ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/scripts/check-help-wanted.sh b/.github/workflows/scripts/check-help-wanted.sh new file mode 100755 index 000000000..59c12fecd --- /dev/null +++ b/.github/workflows/scripts/check-help-wanted.sh @@ -0,0 +1,93 @@ +#!/bin/bash + +set -e + +PR_URL="$1" + +if [ -z "$PR_URL" ]; then + echo "Usage: $0 " + echo "" + echo "Check if the PR references any non-help-wanted issues and, if so, comment" + echo "on it explaining why the team might close/dismiss it." + exit 1 +fi + +# Extract PR number from URL for logging +PR_NUM="$(basename "$PR_URL")" + +# Extract cli/cli closing issues references from PR +CLOSING_ISSUES="$(gh pr view "$PR_URL" --json closingIssuesReferences --jq '.closingIssuesReferences[] | select(.repository.name == "cli" and .repository.owner.login == "cli") | .number')" + +if [ -z "$CLOSING_ISSUES" ]; then + echo "No closing issues found for PR #$PR_NUM" + exit 0 +fi + +# Check each closing issue for 'help-wanted' label +ISSUES_WITHOUT_HELP_WANTED=() + +for issue_num in $CLOSING_ISSUES; do + echo "Checking issue #$issue_num for 'help wanted' label..." + + # Get issue labels + LABELS=$(gh issue view "$issue_num" --json labels --jq '.labels[].name') + + # Skip if the issue has the gh-attestion or gh-codespace label + # This is because the codeowners for these commands may not be public + # cli org members, and so unless we authenticate with a PAT, we can't + # know who is an external contributor or not. + # So we skip these issues to avoid falsely writing a comment + # on each PR opened by these codeowners. + if echo "$LABELS" | grep -q -e "gh-attestation" -e "gh-codespace"; then + echo "Issue #$issue_num is skipped due to labels" + continue + fi + + # Check if 'help wanted' label exists + if ! echo "$LABELS" | grep -q "help wanted"; then + ISSUES_WITHOUT_HELP_WANTED+=("$issue_num") + echo "Issue #$issue_num does not have 'help wanted' label" + else + echo "Issue #$issue_num has 'help wanted' label" + fi +done + +# If we found issues without 'help wanted' label, post a comment +if [ ${#ISSUES_WITHOUT_HELP_WANTED[@]} -gt 0 ]; then + echo "Found ${#ISSUES_WITHOUT_HELP_WANTED[@]} issues without 'help wanted' label" + + # Build issue list for comment + ISSUE_LIST="" + for issue_num in "${ISSUES_WITHOUT_HELP_WANTED[@]}"; do + ISSUE_LIST="$ISSUE_LIST- #$issue_num"$'\n' + done + + # Create comment message + gh pr comment "$PR_URL" --body-file - < Date: Mon, 16 Jun 2025 17:53:43 +0200 Subject: [PATCH 14/29] Quote workflow conditional --- .github/workflows/pr-help-wanted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml index 5475d2eff..d11173645 100644 --- a/.github/workflows/pr-help-wanted.yml +++ b/.github/workflows/pr-help-wanted.yml @@ -17,7 +17,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} - if: !github.event.pull_request.draft + if: "!github.event.pull_request.draft" run: | # Skip if PR is from a bot or org member if [ "$PR_AUTHOR_TYPE" = "Bot" ] || "gh api orgs/cli/public_members/${PR_AUTHOR}" --silent 2>/dev/null From 32a7400e228c3df7eeead2dc4df888b026272d5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 16:02:19 +0000 Subject: [PATCH 15/29] chore(deps): bump github.com/in-toto/attestation from 1.1.1 to 1.1.2 Bumps [github.com/in-toto/attestation](https://github.com/in-toto/attestation) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/in-toto/attestation/releases) - [Commits](https://github.com/in-toto/attestation/compare/v1.1.1...v1.1.2) --- updated-dependencies: - dependency-name: github.com/in-toto/attestation dependency-version: 1.1.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 289fd83a5..66383962f 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/hashicorp/go-version v1.3.0 github.com/henvic/httpretty v0.1.4 github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec - github.com/in-toto/attestation v1.1.1 + github.com/in-toto/attestation v1.1.2 github.com/joho/godotenv v1.5.1 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/mattn/go-colorable v0.1.14 diff --git a/go.sum b/go.sum index 95f7ed75d..094016356 100644 --- a/go.sum +++ b/go.sum @@ -304,8 +304,8 @@ github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef h1:A9HsByNhogrvm9cWb github.com/howeyc/gopass v0.0.0-20210920133722-c8aef6fb66ef/go.mod h1:lADxMC39cJJqL93Duh1xhAs4I2Zs8mKS89XWXFGp9cs= github.com/huandu/xstrings v1.5.0 h1:2ag3IFq9ZDANvthTwTiqSSZLjDc+BedvHPAp5tJy2TI= github.com/huandu/xstrings v1.5.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/in-toto/attestation v1.1.1 h1:QD3d+oATQ0dFsWoNh5oT0udQ3tUrOsZZ0Fc3tSgWbzI= -github.com/in-toto/attestation v1.1.1/go.mod h1:Dcq1zVwA2V7Qin8I7rgOi+i837wEf/mOZwRm047Sjys= +github.com/in-toto/attestation v1.1.2 h1:MBFn6lsMq6dptQZJBhalXTcWMb/aJy3V+GX3VYj/V1E= +github.com/in-toto/attestation v1.1.2/go.mod h1:gYFddHMZj3DiQ0b62ltNi1Vj5rC879bTmBbrv9CRHpM= github.com/in-toto/in-toto-golang v0.9.0 h1:tHny7ac4KgtsfrG6ybU8gVOZux2H8jN05AXJ9EBM1XU= github.com/in-toto/in-toto-golang v0.9.0/go.mod h1:xsBVrVsHNsB61++S6Dy2vWosKhuA3lUTQd+eF9HdeMo= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= From da9ed6a3368b3db53ed716f7b921b5b70008b6de Mon Sep 17 00:00:00 2001 From: William Martin Date: Mon, 16 Jun 2025 18:02:47 +0200 Subject: [PATCH 16/29] Quote filenames suggested at the end of worklow run --- pkg/cmd/workflow/run/run.go | 2 +- pkg/cmd/workflow/run/run_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cmd/workflow/run/run.go b/pkg/cmd/workflow/run/run.go index def3cf9e4..2acd1d4cc 100644 --- a/pkg/cmd/workflow/run/run.go +++ b/pkg/cmd/workflow/run/run.go @@ -330,7 +330,7 @@ func runRun(opts *RunOptions) error { fmt.Fprintln(out) fmt.Fprintf(out, "To see runs for this workflow, try: %s\n", - cs.Boldf("gh run list --workflow=%s", workflow.Base())) + cs.Boldf("gh run list --workflow=%q", workflow.Base())) } return nil diff --git a/pkg/cmd/workflow/run/run_test.go b/pkg/cmd/workflow/run/run_test.go index ee1bc5a1e..b121a573d 100644 --- a/pkg/cmd/workflow/run/run_test.go +++ b/pkg/cmd/workflow/run/run_test.go @@ -447,7 +447,7 @@ jobs: "ref": "trunk", }, httpStubs: stubs, - wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=workflow.yml\n", + wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=\"workflow.yml\"\n", }, { name: "nontty good JSON", @@ -494,7 +494,7 @@ jobs: "ref": "good-branch", }, httpStubs: stubs, - wantOut: "✓ Created workflow_dispatch event for workflow.yml at good-branch\n\nTo see runs for this workflow, try: gh run list --workflow=workflow.yml\n", + wantOut: "✓ Created workflow_dispatch event for workflow.yml at good-branch\n\nTo see runs for this workflow, try: gh run list --workflow=\"workflow.yml\"\n", }, { // TODO this test is somewhat silly; it's more of a placeholder in case I decide to handle the API error more elegantly @@ -634,7 +634,7 @@ jobs: "inputs": map[string]interface{}{}, "ref": "trunk", }, - wantOut: "✓ Created workflow_dispatch event for minimal.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=minimal.yml\n", + wantOut: "✓ Created workflow_dispatch event for minimal.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=\"minimal.yml\"\n", }, { name: "prompt", @@ -682,7 +682,7 @@ jobs: }, "ref": "trunk", }, - wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=workflow.yml\n", + wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=\"workflow.yml\"\n", }, { name: "prompt, workflow choice input", @@ -731,7 +731,7 @@ jobs: }, "ref": "trunk", }, - wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=workflow.yml\n", + wantOut: "✓ Created workflow_dispatch event for workflow.yml at trunk\n\nTo see runs for this workflow, try: gh run list --workflow=\"workflow.yml\"\n", }, { name: "prompt, workflow choice missing input", From 7fa213251c305d7d6f99cdbd9bef17b6d3dc2603 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 16 Jun 2025 10:14:38 -0600 Subject: [PATCH 17/29] Fix script path for help-wanted check --- .github/workflows/pr-help-wanted.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml index 5475d2eff..0dd10c647 100644 --- a/.github/workflows/pr-help-wanted.yml +++ b/.github/workflows/pr-help-wanted.yml @@ -26,4 +26,4 @@ jobs: fi # Run the script to check for issues without help-wanted label - bash .github/scripts/check-help-wanted.sh ${{ github.event.pull_request.html_url }} + bash .github/workflows/scripts/check-help-wanted.sh ${{ github.event.pull_request.html_url }} From c7b1afd293f73d09664ce4333492c203c827256b Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Mon, 16 Jun 2025 13:36:37 -0400 Subject: [PATCH 18/29] Fixes #11126 These changes will cause GitHub Advanced Security to ignore the auto-generated content around 3rd party dependencies used by `cli/cli` from static code analysis and secret scanning. For more information: - https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning - https://docs.github.com/en/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/excluding-folders-and-files-from-secret-scanning --- .github/secret_scanning.yml | 3 +++ .github/workflows/codeql.yml | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .github/secret_scanning.yml diff --git a/.github/secret_scanning.yml b/.github/secret_scanning.yml new file mode 100644 index 000000000..83ee7b460 --- /dev/null +++ b/.github/secret_scanning.yml @@ -0,0 +1,3 @@ +paths-ignore: + - 'third-party/**' + - 'third-party-licenses.*.md' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d74e1c142..37bbb0607 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -32,6 +32,10 @@ jobs: with: languages: ${{ matrix.language }} queries: security-and-quality + config: | + paths-ignore: + - 'third-party/**' + - 'third-party-licenses.*.md' - name: Setup Go if: matrix.language == 'go' From 7d1b5d2ce09242bd1d1716d50789b81937e1faf5 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 16 Jun 2025 11:47:48 -0600 Subject: [PATCH 19/29] Fix repo checkout in help-wanted check --- .github/workflows/pr-help-wanted.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml index 0dd10c647..0d7245836 100644 --- a/.github/workflows/pr-help-wanted.yml +++ b/.github/workflows/pr-help-wanted.yml @@ -12,6 +12,9 @@ jobs: check-help-wanted: runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check for issues without help-wanted label env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 31b3dc1ba6c77ca446b8b5c210864db5a0070ebe Mon Sep 17 00:00:00 2001 From: William Martin Date: Mon, 16 Jun 2025 20:46:24 +0200 Subject: [PATCH 20/29] Ensure gh executes in workflow check script --- .github/workflows/pr-help-wanted.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml index 5475d2eff..0b86cae85 100644 --- a/.github/workflows/pr-help-wanted.yml +++ b/.github/workflows/pr-help-wanted.yml @@ -20,8 +20,7 @@ jobs: if: !github.event.pull_request.draft run: | # Skip if PR is from a bot or org member - if [ "$PR_AUTHOR_TYPE" = "Bot" ] || "gh api orgs/cli/public_members/${PR_AUTHOR}" --silent 2>/dev/null - then + if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/"${PR_AUTHOR}" --silent 2>/dev/null; then exit 0 fi From fa3402f7834b4ef8265b40a328f9d068e1076728 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:53:45 -0600 Subject: [PATCH 21/29] Improve help wanted check skipping logic --- .github/workflows/pr-help-wanted.yml | 6 +----- .github/workflows/scripts/check-help-wanted.sh | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-help-wanted.yml b/.github/workflows/pr-help-wanted.yml index 313e91e14..3482ecd08 100644 --- a/.github/workflows/pr-help-wanted.yml +++ b/.github/workflows/pr-help-wanted.yml @@ -20,12 +20,8 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_AUTHOR: ${{ github.event.pull_request.user.login }} PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }} + PR_AUTHOR_ASSOCIATION: ${{ github.event.pull_request.author_association }} if: "!github.event.pull_request.draft" run: | - # Skip if PR is from a bot or org member - if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/"${PR_AUTHOR}" --silent 2>/dev/null; then - exit 0 - fi - # Run the script to check for issues without help-wanted label bash .github/workflows/scripts/check-help-wanted.sh ${{ github.event.pull_request.html_url }} diff --git a/.github/workflows/scripts/check-help-wanted.sh b/.github/workflows/scripts/check-help-wanted.sh index 59c12fecd..5c3223761 100755 --- a/.github/workflows/scripts/check-help-wanted.sh +++ b/.github/workflows/scripts/check-help-wanted.sh @@ -12,6 +12,12 @@ if [ -z "$PR_URL" ]; then exit 1 fi +# Skip if PR is from a bot or org member +if [ "$PR_AUTHOR_TYPE" = "Bot" ] || [ "$PR_AUTHOR_ASSOCIATION" = "MEMBER" ]; then + echo "Skipping check for PR #$PR_URL as it is from a bot ($PR_AUTHOR_TYPE) or an org member ($PR_AUTHOR_ASSOCIATION)" + exit 0 +fi + # Extract PR number from URL for logging PR_NUM="$(basename "$PR_URL")" From 9e161cda4e69de3845f29787fd00718e184b5f03 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:20:20 -0600 Subject: [PATCH 22/29] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/scripts/check-help-wanted.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scripts/check-help-wanted.sh b/.github/workflows/scripts/check-help-wanted.sh index 5c3223761..d316e8bde 100755 --- a/.github/workflows/scripts/check-help-wanted.sh +++ b/.github/workflows/scripts/check-help-wanted.sh @@ -13,8 +13,8 @@ if [ -z "$PR_URL" ]; then fi # Skip if PR is from a bot or org member -if [ "$PR_AUTHOR_TYPE" = "Bot" ] || [ "$PR_AUTHOR_ASSOCIATION" = "MEMBER" ]; then - echo "Skipping check for PR #$PR_URL as it is from a bot ($PR_AUTHOR_TYPE) or an org member ($PR_AUTHOR_ASSOCIATION)" +if [ "$PR_AUTHOR_TYPE" = "Bot" ] || [ "$PR_AUTHOR_ASSOCIATION" = "MEMBER" ] || [ "$PR_AUTHOR_ASSOCIATION" = "OWNER" ]; then + echo "Skipping check for PR #$PR_URL as it is from a bot ($PR_AUTHOR_TYPE) or an org member ($PR_AUTHOR_ASSOCIATION: MEMBER/OWNER)" exit 0 fi From 86c251154e88b32362761ea5f1fa71a85e1d25fb Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 17 Jun 2025 11:43:14 +0200 Subject: [PATCH 23/29] Merge pull request #11121 from cli/11101-use-golangci-lint-version-2 Bump golangci-lint to v2 --- .github/workflows/lint.yml | 22 ++++++---------------- .golangci.yml | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f1ae1e522..48e8539d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,17 +27,7 @@ jobs: with: go-version-file: 'go.mod' - - name: Verify dependencies - run: | - go mod verify - go mod download - - LINT_VERSION=1.63.4 - curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \ - tar xz --strip-components 1 --wildcards \*/golangci-lint - mkdir -p bin && mv golangci-lint bin/ - - - name: Run checks + - name: Ensure go.mod and go.sum are up to date run: | STATUS=0 assert-nothing-changed() { @@ -49,10 +39,10 @@ jobs: STATUS=1 fi } - - assert-nothing-changed go fmt ./... assert-nothing-changed go mod tidy - - bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$? - exit $STATUS + + - name: golangci-lint + uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 + with: + version: v2.1.6 diff --git a/.golangci.yml b/.golangci.yml index ff7f37014..861198dd8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,7 +1,17 @@ +version: "2" + linters: enable: - - gofmt - - nolintlint + - nolintlint + disable: + # The following linters are disabled purely because this config was migrated to v2 where they are in the default + # set, and we should have separate work to enable them if we truly want them. + - staticcheck + - errcheck + +formatters: + enable: + - gofmt issues: max-issues-per-linter: 0 From b4cd2273d857208ff3be0d469da2563985fd188c Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 17 Jun 2025 11:13:03 +0200 Subject: [PATCH 24/29] Bump to Go 1.24 --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 66383962f..238a06eb1 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/cli/cli/v2 -go 1.23.0 +go 1.24 -toolchain go1.23.5 +toolchain go1.24.4 require ( github.com/AlecAivazis/survey/v2 v2.3.7 From 49ed6c46810bc4d62dbe89ba48e0cd2964fc6324 Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 17 Jun 2025 11:13:45 +0200 Subject: [PATCH 25/29] Use t.Chdir in tests --- pkg/cmd/extension/command_test.go | 7 +++--- pkg/cmd/extension/manager_test.go | 27 ++++++++--------------- pkg/cmd/release/download/download_test.go | 11 +-------- pkg/cmdutil/args_test.go | 15 ++----------- 4 files changed, 15 insertions(+), 45 deletions(-) diff --git a/pkg/cmd/extension/command_test.go b/pkg/cmd/extension/command_test.go index 76741714a..7001c8f1a 100644 --- a/pkg/cmd/extension/command_test.go +++ b/pkg/cmd/extension/command_test.go @@ -23,15 +23,14 @@ import ( "github.com/cli/cli/v2/pkg/iostreams" "github.com/spf13/cobra" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestNewCmdExtension(t *testing.T) { tempDir := t.TempDir() - oldWd, _ := os.Getwd() localExtensionTempDir := filepath.Join(tempDir, "gh-hello") - assert.NoError(t, os.MkdirAll(localExtensionTempDir, 0755)) - assert.NoError(t, os.Chdir(localExtensionTempDir)) - t.Cleanup(func() { _ = os.Chdir(oldWd) }) + require.NoError(t, os.MkdirAll(localExtensionTempDir, 0755)) + t.Chdir(localExtensionTempDir) tests := []struct { name string diff --git a/pkg/cmd/extension/manager_test.go b/pkg/cmd/extension/manager_test.go index 167af3439..e933f0bdf 100644 --- a/pkg/cmd/extension/manager_test.go +++ b/pkg/cmd/extension/manager_test.go @@ -1251,9 +1251,10 @@ func TestManager_repo_not_found(t *testing.T) { } func TestManager_Create(t *testing.T) { - chdirTemp(t) + tempDir := t.TempDir() + t.Chdir(tempDir) err := os.MkdirAll("gh-test", 0755) - assert.NoError(t, err) + require.NoError(t, err) ios, _, stdout, stderr := iostreams.Test() @@ -1279,9 +1280,10 @@ func TestManager_Create(t *testing.T) { } func TestManager_Create_go_binary(t *testing.T) { - chdirTemp(t) + tempDir := t.TempDir() + t.Chdir(tempDir) err := os.MkdirAll("gh-test", 0755) - assert.NoError(t, err) + require.NoError(t, err) reg := httpmock.Registry{} defer reg.Verify(t) @@ -1329,9 +1331,10 @@ func TestManager_Create_go_binary(t *testing.T) { } func TestManager_Create_other_binary(t *testing.T) { - chdirTemp(t) + tempDir := t.TempDir() + t.Chdir(tempDir) err := os.MkdirAll("gh-test", 0755) - assert.NoError(t, err) + require.NoError(t, err) ios, _, stdout, stderr := iostreams.Test() @@ -1392,18 +1395,6 @@ func Test_ensurePrefixed(t *testing.T) { } } -// chdirTemp changes the current working directory to a temporary directory for the duration of the test. -func chdirTemp(t *testing.T) { - oldWd, _ := os.Getwd() - tempDir := t.TempDir() - if err := os.Chdir(tempDir); err != nil { - t.Fatal(err) - } - t.Cleanup(func() { - _ = os.Chdir(oldWd) - }) -} - func fileNames(files []os.DirEntry) []string { names := make([]string, len(files)) for i, f := range files { diff --git a/pkg/cmd/release/download/download_test.go b/pkg/cmd/release/download/download_test.go index 9337c9b65..37c0e3c02 100644 --- a/pkg/cmd/release/download/download_test.go +++ b/pkg/cmd/release/download/download_test.go @@ -174,11 +174,6 @@ func Test_NewCmdDownload(t *testing.T) { } func Test_downloadRun(t *testing.T) { - oldwd, err := os.Getwd() - if err != nil { - t.Fatalf("could not determine working directory: %v", err) - } - tests := []struct { name string isTTY bool @@ -526,11 +521,7 @@ func Test_downloadRun(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tempDir := t.TempDir() - if err := os.Chdir(tempDir); err == nil { - t.Cleanup(func() { _ = os.Chdir(oldwd) }) - } else { - t.Fatal(err) - } + t.Chdir(tempDir) ios, _, stdout, stderr := iostreams.Test() ios.SetStdoutTTY(tt.isTTY) diff --git a/pkg/cmdutil/args_test.go b/pkg/cmdutil/args_test.go index 4e880dd27..58f0dc0b6 100644 --- a/pkg/cmdutil/args_test.go +++ b/pkg/cmdutil/args_test.go @@ -210,17 +210,10 @@ func createTestDir(t *testing.T) (cleanupFn func()) { rootDir := t.TempDir() // Move workspace to temporary directory - cwd, err := os.Getwd() - if err != nil { - t.Fatal(err) - } - err = os.Chdir(rootDir) - if err != nil { - t.Fatal(err) - } + t.Chdir(rootDir) // Make subdirectories - err = os.Mkdir(filepath.Join(rootDir, "subDir1"), 0755) + err := os.Mkdir(filepath.Join(rootDir, "subDir1"), 0755) if err != nil { t.Fatal(err) } @@ -253,10 +246,6 @@ func createTestDir(t *testing.T) (cleanupFn func()) { cleanupFn = func() { os.RemoveAll(rootDir) - err = os.Chdir(cwd) - if err != nil { - t.Fatal(err) - } } return cleanupFn } From f55443d7b02810c96c3ceb57695fc2c08cc27c37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 10:05:53 +0000 Subject: [PATCH 26/29] chore(deps): bump github.com/google/go-containerregistry Bumps [github.com/google/go-containerregistry](https://github.com/google/go-containerregistry) from 0.20.3 to 0.20.6. - [Release notes](https://github.com/google/go-containerregistry/releases) - [Changelog](https://github.com/google/go-containerregistry/blob/main/.goreleaser.yml) - [Commits](https://github.com/google/go-containerregistry/compare/v0.20.3...v0.20.6) --- updated-dependencies: - dependency-name: github.com/google/go-containerregistry dependency-version: 0.20.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- go.mod | 34 ++++++++++++------------- go.sum | 80 +++++++++++++++++++++++++++++----------------------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/go.mod b/go.mod index 238a06eb1..e5d499aee 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/gdamore/tcell/v2 v2.5.4 github.com/golang/snappy v0.0.4 github.com/google/go-cmp v0.7.0 - github.com/google/go-containerregistry v0.20.3 + github.com/google/go-containerregistry v0.20.6 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/gorilla/websocket v1.5.3 github.com/hashicorp/go-multierror v1.1.1 @@ -52,10 +52,10 @@ require ( github.com/theupdateframework/go-tuf/v2 v2.1.1 github.com/yuin/goldmark v1.7.12 github.com/zalando/go-keyring v0.2.5 - golang.org/x/crypto v0.38.0 - golang.org/x/sync v0.14.0 + golang.org/x/crypto v0.39.0 + golang.org/x/sync v0.15.0 golang.org/x/term v0.32.0 - golang.org/x/text v0.25.0 + golang.org/x/text v0.26.0 google.golang.org/grpc v1.72.2 google.golang.org/protobuf v1.36.6 gopkg.in/h2non/gock.v1 v1.1.2 @@ -86,13 +86,13 @@ require ( github.com/cli/shurcooL-graphql v0.0.4 // indirect github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 // indirect - github.com/danieljoos/wincred v1.2.1 // indirect + github.com/danieljoos/wincred v1.2.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/digitorus/pkcs7 v0.0.0-20230818184609-3a137a874352 // indirect github.com/dlclark/regexp2 v1.11.0 // indirect - github.com/docker/cli v27.5.0+incompatible // indirect + github.com/docker/cli v28.2.2+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker-credential-helpers v0.8.2 // indirect + github.com/docker/docker-credential-helpers v0.9.3 // indirect github.com/dustin/go-humanize v1.0.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/fatih/color v1.16.0 // indirect @@ -100,7 +100,7 @@ require ( github.com/gdamore/encoding v1.0.0 // indirect github.com/go-chi/chi v4.1.2+incompatible // indirect github.com/go-jose/go-jose/v4 v4.0.5 // indirect - github.com/go-logr/logr v1.4.2 // indirect + github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.23.0 // indirect github.com/go-openapi/errors v0.22.1 // indirect @@ -126,7 +126,7 @@ require ( github.com/itchyny/timefmt-go v0.1.5 // indirect github.com/jedisct1/go-minisign v0.0.0-20211028175153-1c139d1cc84b // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/klauspost/compress v1.17.11 // indirect + github.com/klauspost/compress v1.18.0 // indirect github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mailru/easyjson v0.9.0 // indirect @@ -144,7 +144,7 @@ require ( github.com/muesli/termenv v0.16.0 // indirect github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0 // indirect + github.com/opencontainers/image-spec v1.1.1 // indirect github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect @@ -171,21 +171,21 @@ require ( github.com/thlib/go-timezone-local v0.0.0-20210907160436-ef149e42d28e // indirect github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect github.com/transparency-dev/merkle v0.0.2 // indirect - github.com/vbatts/tar-split v0.11.6 // indirect + github.com/vbatts/tar-split v0.12.1 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect github.com/yuin/goldmark-emoji v1.0.5 // indirect go.mongodb.org/mongo-driver v1.14.0 // indirect go.opentelemetry.io/auto/sdk v1.1.0 // indirect - go.opentelemetry.io/otel v1.35.0 // indirect - go.opentelemetry.io/otel/metric v1.35.0 // indirect - go.opentelemetry.io/otel/trace v1.35.0 // indirect + go.opentelemetry.io/otel v1.36.0 // indirect + go.opentelemetry.io/otel/metric v1.36.0 // indirect + go.opentelemetry.io/otel/trace v1.36.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc // indirect - golang.org/x/mod v0.24.0 // indirect - golang.org/x/net v0.40.0 // indirect + golang.org/x/mod v0.25.0 // indirect + golang.org/x/net v0.41.0 // indirect golang.org/x/sys v0.33.0 // indirect - golang.org/x/tools v0.29.0 // indirect + golang.org/x/tools v0.34.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect k8s.io/klog/v2 v2.130.1 // indirect diff --git a/go.sum b/go.sum index 094016356..f0f2bb5ed 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ cloud.google.com/go/auth v0.16.0 h1:Pd8P1s9WkcrBE2n/PhAwKsdrR35V3Sg2II9B+ndM3CU= cloud.google.com/go/auth v0.16.0/go.mod h1:1howDHJ5IETh/LwYs3ZxvlkXF48aSqqJUM+5o02dNOI= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= -cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I= -cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= +cloud.google.com/go/compute/metadata v0.7.0 h1:PBWF+iiAerVNe8UCHxdOt6eHLVc3ydFeOCw78U8ytSU= +cloud.google.com/go/compute/metadata v0.7.0/go.mod h1:j5MvL9PprKL39t166CoB1uVHfQMs4tFQZZcKwksXUjo= cloud.google.com/go/iam v1.5.0 h1:QlLcVMhbLGOjRcGe6VTGGTyQib8dRLK2B/kYNV0+2xs= cloud.google.com/go/iam v1.5.0/go.mod h1:U+DOtKQltF/LxPEtcDLoobcsZMilSRwR7mgNL7knOpo= cloud.google.com/go/kms v1.21.2 h1:c/PRUSMNQ8zXrc1sdAUnsenWWaNXN+PzTXfXOcSFdoE= @@ -160,8 +160,8 @@ github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s= github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE= github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7 h1:vU+EP9ZuFUCYE0NYLwTSob+3LNEJATzNfP/DC7SWGWI= github.com/cyberphone/json-canonicalization v0.0.0-20220623050100-57a0ce2678a7/go.mod h1:uzvlm1mxhHkdfqitSA92i7Se+S9ksOn3a3qmv/kyOCw= -github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= -github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= +github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0= +github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -175,12 +175,12 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= -github.com/docker/cli v27.5.0+incompatible h1:aMphQkcGtpHixwwhAXJT1rrK/detk2JIvDaFkLctbGM= -github.com/docker/cli v27.5.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.2.2+incompatible h1:qzx5BNUDFqlvyq4AHzdNB7gSyVTmU4cgsyN9SdInc1A= +github.com/docker/cli v28.2.2+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= -github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= +github.com/docker/docker-credential-helpers v0.9.3 h1:gAm/VtF9wgqJMoxzT3Gj5p4AqIjCBS4wrsOh9yRqcz8= +github.com/docker/docker-credential-helpers v0.9.3/go.mod h1:x+4Gbw9aGmChi3qTLZj8Dfn0TD20M/fuWy0E5+WDeCo= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= @@ -205,8 +205,8 @@ github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= -github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC03zFCU= @@ -247,8 +247,8 @@ github.com/google/certificate-transparency-go v1.3.1 h1:akbcTfQg0iZlANZLn0L9xOeW github.com/google/certificate-transparency-go v1.3.1/go.mod h1:gg+UQlx6caKEDQ9EElFOujyxEQEfOiQzAt6782Bvi8k= 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.20.3 h1:oNx7IdTI936V8CQRveCjaxOiegWwvM7kqkbXTpyiovI= -github.com/google/go-containerregistry v0.20.3/go.mod h1:w00pIgBRDVUDFM6bq+Qx8lwNWK+cxgCuX1vd3PIBDNI= +github.com/google/go-containerregistry v0.20.6 h1:cvWX87UxxLgaH76b4hIvya6Dzz9qHB31qAwjAohdSTU= +github.com/google/go-containerregistry v0.20.6/go.mod h1:T0x8MuoAoKX/873bkeSfLD2FAkwCDf9/HZgsFJ02E2Y= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0= @@ -338,8 +338,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= -github.com/klauspost/compress v1.17.11 h1:In6xLpyWOi1+C7tXUUWv2ot1QvBjxevKAaI6IXrJmUc= -github.com/klauspost/compress v1.17.11/go.mod h1:pMDklpSncoRMuLFrf1W9Ss9KT+0rH90U12bZKk7uwG0= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -402,8 +402,8 @@ github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= -github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= @@ -515,8 +515,8 @@ github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 h1:e/5i7d4oYZ+C github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399/go.mod h1:LdwHTNJT99C5fTAzDz0ud328OgXz+gierycbcIx2fRs= github.com/transparency-dev/merkle v0.0.2 h1:Q9nBoQcZcgPamMkGn7ghV8XiTZ/kRxn1yCG81+twTK4= github.com/transparency-dev/merkle v0.0.2/go.mod h1:pqSy+OXefQ1EDUVmAJ8MUhHB9TXGuzVAT58PqBoHz1A= -github.com/vbatts/tar-split v0.11.6 h1:4SjTW5+PU11n6fZenf2IPoV8/tz3AaYHMWjf23envGs= -github.com/vbatts/tar-split v0.11.6/go.mod h1:dqKNtesIOr2j2Qv3W/cHjnvk9I8+G7oAkFDFN6TCBEI= +github.com/vbatts/tar-split v0.12.1 h1:CqKoORW7BUWBe7UL/iqTVvkTBOF8UvOMKOIZykxnnbo= +github.com/vbatts/tar-split v0.12.1/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -533,18 +533,18 @@ go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJyS go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0 h1:x7wzEgXfnzJcHDwStJT+mxOz4etr2EcexjqhBvmoakw= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.60.0/go.mod h1:rg+RlpR5dKwaS95IyyZqj5Wd4E13lk/msnTS0Xl9lJM= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 h1:sbiXRNDSWJOTobXh5HyQKjq6wUC5tNybqjIqDpAY4CU= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0/go.mod h1:69uWxva0WgAA/4bu2Yy70SLDBwZXuQ6PbBpbsa5iZrQ= -go.opentelemetry.io/otel v1.35.0 h1:xKWKPxrxB6OtMCbmMY021CqC45J+3Onta9MqjhnusiQ= -go.opentelemetry.io/otel v1.35.0/go.mod h1:UEqy8Zp11hpkUrL73gSlELM0DupHoiq72dR+Zqel/+Y= -go.opentelemetry.io/otel/metric v1.35.0 h1:0znxYu2SNyuMSQT4Y9WDWej0VpcsxkuklLa4/siN90M= -go.opentelemetry.io/otel/metric v1.35.0/go.mod h1:nKVFgxBZ2fReX6IlyW28MgZojkoAkJGaE8CpgeAU3oE= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= +go.opentelemetry.io/otel v1.36.0 h1:UumtzIklRBY6cI/lllNZlALOF5nNIzJVb16APdvgTXg= +go.opentelemetry.io/otel v1.36.0/go.mod h1:/TcFMXYjyRNh8khOAO9ybYkqaDBb/70aVwkNML4pP8E= +go.opentelemetry.io/otel/metric v1.36.0 h1:MoWPKVhQvJ+eeXWHFBOPoBOi20jh6Iq2CcCREuTYufE= +go.opentelemetry.io/otel/metric v1.36.0/go.mod h1:zC7Ks+yeyJt4xig9DEw9kuUFe5C3zLbVjV2PzT6qzbs= go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/trace v1.35.0 h1:dPpEfJu1sDIqruz7BHFG3c7528f6ddfSWfFDVt/xgMs= -go.opentelemetry.io/otel/trace v1.35.0/go.mod h1:WUk7DtFp1Aw2MkvqGdwiXYDZZNvA/1J8o6xRXLrIkyc= +go.opentelemetry.io/otel/trace v1.36.0 h1:ahxWNuqZjpdiFAyrIoQ4GIiAIhxAunQR6MUoKrsNd4w= +go.opentelemetry.io/otel/trace v1.36.0/go.mod h1:gQ+OnDZzrybY4k4seLzPAWNwVBBVlF2szhehOBB/tGA= go.step.sm/crypto v0.63.0 h1:U1QGELQqJ85oDfeNFE2V52cow1rvy0m3MekG3wFmyXY= go.step.sm/crypto v0.63.0/go.mod h1:aj3LETmCZeSil1DMq3BlbhDBcN86+mmKrHZtXWyc0L4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= @@ -555,24 +555,24 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8= -golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw= +golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM= +golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U= golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc h1:O9NuF4s+E/PvMIy+9IUZB9znFwUIXEWSstNjek6VpVg= golang.org/x/exp v0.0.0-20240531132922-fd00a4e0eefc/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= -golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= +golang.org/x/mod v0.25.0 h1:n7a+ZbQKQA/Ysbyb0/6IbB1H/X41mKgbhfv7AfG/44w= +golang.org/x/mod v0.25.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.40.0 h1:79Xs7wF06Gbdcg4kdCCIQArK11Z1hr5POQ6+fIYHNuY= -golang.org/x/net v0.40.0/go.mod h1:y0hY0exeL2Pku80/zKK7tpntoX23cqL3Oa6njdgRtds= -golang.org/x/oauth2 v0.29.0 h1:WdYw2tdTK1S8olAzWHdgeqfy+Mtm9XNhv/xJsY65d98= -golang.org/x/oauth2 v0.29.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= +golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw= +golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA= +golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= +golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.14.0 h1:woo0S4Yywslg6hp4eUFjTVOyKt0RookbpAHG4c1HmhQ= -golang.org/x/sync v0.14.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= +golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -594,15 +594,15 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4= -golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA= +golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= +golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.34.0 h1:qIpSLOxeCYGg9TrcJokLBG4KFA6d795g0xkBkiESGlo= +golang.org/x/tools v0.34.0/go.mod h1:pAP9OwEaY1CAW3HOmg3hLZC5Z0CCmzjAF2UQMSqNARg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.230.0 h1:2u1hni3E+UXAXrONrrkfWpi/V6cyKVAbfGVeGtC3OxM= google.golang.org/api v0.230.0/go.mod h1:aqvtoMk7YkiXx+6U12arQFExiRV9D/ekvMCwCd/TksQ= From 1ac3f064f3ef4d94f6ea4962862a13913e0af725 Mon Sep 17 00:00:00 2001 From: Vibhakar Solanki Date: Tue, 6 May 2025 18:10:50 +0530 Subject: [PATCH 27/29] docs: update install command for Debian Make sure that `sources.list.d` exists before trying to populate `github-cli.list` --- docs/install_linux.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/install_linux.md b/docs/install_linux.md index 43ba876a1..b1e9ac829 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -19,6 +19,7 @@ Install: && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && sudo mkdir -p -m 755 /etc/apt/sources.list.d \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ && sudo apt update \ && sudo apt install gh -y From 50e4a4ad15c9f87d4600f24d1c1c17d7a6050928 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 17 Jun 2025 08:41:14 -0600 Subject: [PATCH 28/29] Fix step order for CodeQL workflow --- .github/workflows/codeql.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 37bbb0607..06d9bc81f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -27,6 +27,12 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - name: Setup Go + if: matrix.language == 'go' + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: @@ -37,12 +43,6 @@ jobs: - 'third-party/**' - 'third-party-licenses.*.md' - - name: Setup Go - if: matrix.language == 'go' - uses: actions/setup-go@v5 - with: - go-version-file: 'go.mod' - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 with: From 6b36060d586b55b46ee52f898f3d637333cddfba Mon Sep 17 00:00:00 2001 From: William Martin Date: Tue, 17 Jun 2025 16:43:25 +0200 Subject: [PATCH 29/29] Update docs/install_linux.md --- docs/install_linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install_linux.md b/docs/install_linux.md index 09342c802..719a9f2d0 100644 --- a/docs/install_linux.md +++ b/docs/install_linux.md @@ -165,7 +165,7 @@ pkg install gh ### MidnightBSD -MidnightBSD users can install from mports +MidnightBSD users can install from [mports](https://www.midnightbsd.org/documentation/mports/index.html) ```bash cd /usr/mports/devel/gh/ && make install clean