From b70f9c1ddaaea026c0795d2058e0063b9438995b Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Tue, 13 May 2025 14:30:32 +0100 Subject: [PATCH 01/10] Add example usage of `--head` option Signed-off-by: Babak K. Shandiz --- pkg/cmd/pr/list/list.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/pr/list/list.go b/pkg/cmd/pr/list/list.go index 0b86d5e11..8837c66fb 100644 --- a/pkg/cmd/pr/list/list.go +++ b/pkg/cmd/pr/list/list.go @@ -64,6 +64,9 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman # List PRs authored by you $ gh pr list --author "@me" + # List PRs with a specific head branch name + $ gh pr list --head "typo" + # List only PRs with all of the given labels $ gh pr list --label bug --label "priority 1" From 59a585de9ca3cf0a71b9d2e4b7b12d37693cb6b2 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Tue, 13 May 2025 14:52:13 +0100 Subject: [PATCH 02/10] Mention created PR's URL will be printed upon success Signed-off-by: Babak K. Shandiz --- pkg/cmd/pr/create/create.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/cmd/pr/create/create.go b/pkg/cmd/pr/create/create.go index 1d980b68d..705f46023 100644 --- a/pkg/cmd/pr/create/create.go +++ b/pkg/cmd/pr/create/create.go @@ -201,6 +201,8 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co Long: heredoc.Docf(` Create a pull request on GitHub. + Upon success, the URL of the created pull request will be printed. + When the current branch isn't fully pushed to a git remote, a prompt will ask where to push the branch and offer an option to fork the base repository. Use %[1]s--head%[1]s to explicitly skip any forking or pushing behavior. From bb5e10d41f9568765b013a2e723e12aa5139e991 Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Fri, 23 May 2025 10:58:48 +0100 Subject: [PATCH 03/10] test(run): add tests for `RenderJobs` and `RenderJobsCompact` Signed-off-by: Babak K. Shandiz --- pkg/cmd/run/shared/presentation_test.go | 398 ++++++++++++++++++++++++ 1 file changed, 398 insertions(+) create mode 100644 pkg/cmd/run/shared/presentation_test.go diff --git a/pkg/cmd/run/shared/presentation_test.go b/pkg/cmd/run/shared/presentation_test.go new file mode 100644 index 000000000..f91e38907 --- /dev/null +++ b/pkg/cmd/run/shared/presentation_test.go @@ -0,0 +1,398 @@ +package shared + +import ( + "testing" + "time" + + "github.com/MakeNowJust/heredoc" + "github.com/cli/cli/v2/pkg/iostreams" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestRenderJobs(t *testing.T) { + startedAt, err := time.Parse(time.RFC3339, "2009-03-19T00:00:00Z") + require.NoError(t, err) + completedAt, err := time.Parse(time.RFC3339, "2009-03-19T00:01:00Z") + require.NoError(t, err) + + tests := []struct { + name string + jobs []Job + wantVerbose string + wantNormal string + wantCompact string + }{ + { + name: "nil jobs", + jobs: nil, + }, + { + name: "empty jobs", + jobs: []Job{}, + }, + { + // This is not a real-world case, but nevertheless the code should + // be able to handle that without error/panic. + name: "in-progress job without steps", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + Status: InProgress, + }, + }, + wantCompact: heredoc.Doc(` + * foo (ID 999)`), + wantNormal: heredoc.Doc(` + * foo (ID 999)`), + wantVerbose: heredoc.Doc(` + * foo (ID 999)`), + }, + { + // This is not a real-world case, but nevertheless the code should + // be able to handle that without error/panic. + name: "successful job without steps", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + }, + }, + wantCompact: heredoc.Doc(` + ✓ foo in 1m0s (ID 999)`), + wantNormal: heredoc.Doc(` + ✓ foo in 1m0s (ID 999)`), + wantVerbose: heredoc.Doc(` + ✓ foo in 1m0s (ID 999)`), + }, + { + // This is not a real-world case, but nevertheless the code should + // be able to handle that without error/panic. + name: "failed job without steps", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + }, + }, + wantCompact: heredoc.Doc(` + X foo in 1m0s (ID 999)`), + wantNormal: heredoc.Doc(` + X foo in 1m0s (ID 999)`), + wantVerbose: heredoc.Doc(` + X foo in 1m0s (ID 999)`), + }, + { + name: "in-progress job with various step status values", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + Status: InProgress, + Steps: []Step{ + { + Name: "passed", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "skipped", + Status: Completed, + Conclusion: Skipped, + Number: 2, + }, + { + Name: "failed 1", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Number: 3, + }, + { + Name: "failed 2", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Number: 4, + }, + { + Name: "in-progress", + StartedAt: startedAt, + Status: InProgress, + Number: 5, + }, + { + Name: "pending", + Status: Pending, + Number: 6, + }, + }, + }, + }, + wantCompact: heredoc.Doc(` + * foo (ID 999) + X failed 1 + X failed 2 + * in-progress`), + wantNormal: heredoc.Doc(` + * foo (ID 999)`), + wantVerbose: heredoc.Doc(` + * foo (ID 999) + ✓ passed + - skipped + X failed 1 + X failed 2 + * in-progress + * pending`), + }, + { + // As of my observations (babakks) when there is a failed step, the + // job run is marked as failed. In other words, a successful job run + // cannot have any failed steps. That's why there's no failed steps + // in this test case. + name: "successful job with various step status values", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Steps: []Step{ + { + Name: "passed 1", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "skipped", + Status: Completed, + Conclusion: Skipped, + Number: 2, + }, + { + Name: "passed 2", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 3, + }, + }, + }, + }, + wantCompact: heredoc.Doc(` + ✓ foo in 1m0s (ID 999)`), + wantNormal: heredoc.Doc(` + ✓ foo in 1m0s (ID 999)`), + wantVerbose: heredoc.Doc(` + ✓ foo in 1m0s (ID 999) + ✓ passed 1 + - skipped + ✓ passed 2`), + }, + { + name: "failed job with various step status values", + jobs: []Job{ + { + Name: "foo", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Steps: []Step{ + { + Name: "passed 1", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "skipped", + Status: Completed, + Conclusion: Skipped, + Number: 2, + }, + { + Name: "failed 1", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Number: 3, + }, + { + Name: "failed 2", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Number: 4, + }, + { + Name: "passed 2", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 5, + }, + }, + }, + }, + wantCompact: heredoc.Doc(` + X foo in 1m0s (ID 999) + X failed 1 + X failed 2`), + wantNormal: heredoc.Doc(` + X foo in 1m0s (ID 999) + ✓ passed 1 + - skipped + X failed 1 + X failed 2 + ✓ passed 2`), + wantVerbose: heredoc.Doc(` + X foo in 1m0s (ID 999) + ✓ passed 1 + - skipped + X failed 1 + X failed 2 + ✓ passed 2`), + }, + { + name: "multiple jobs", + jobs: []Job{ + { + Name: "in-progress", + ID: 999, + StartedAt: startedAt, + Status: InProgress, + Steps: []Step{ + { + Name: "passed", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "in-progress", + StartedAt: startedAt, + Status: InProgress, + Number: 2, + }, + }, + }, + { + Name: "successful", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Steps: []Step{ + { + Name: "passed", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "skipped", + Status: Completed, + Conclusion: Skipped, + Number: 2, + }, + }, + }, + { + Name: "failed", + ID: 999, + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Steps: []Step{ + { + Name: "passed", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Success, + Number: 1, + }, + { + Name: "failed", + StartedAt: startedAt, + CompletedAt: completedAt, + Status: Completed, + Conclusion: Failure, + Number: 2, + }, + }, + }, + }, + wantCompact: heredoc.Doc(` + * in-progress (ID 999) + * in-progress + ✓ successful in 1m0s (ID 999) + X failed in 1m0s (ID 999) + X failed`), + wantNormal: heredoc.Doc(` + * in-progress (ID 999) + ✓ successful in 1m0s (ID 999) + X failed in 1m0s (ID 999) + ✓ passed + X failed`), + wantVerbose: heredoc.Doc(` + * in-progress (ID 999) + ✓ passed + * in-progress + ✓ successful in 1m0s (ID 999) + ✓ passed + - skipped + X failed in 1m0s (ID 999) + ✓ passed + X failed`), + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gotCompact := RenderJobsCompact(&iostreams.ColorScheme{}, tt.jobs) + assert.Equal(t, tt.wantCompact, gotCompact, "unexpected compact mode output") + + gotNormal := RenderJobs(&iostreams.ColorScheme{}, tt.jobs, false) + assert.Equal(t, tt.wantNormal, gotNormal, "unexpected normal mode output") + + gotVerbose := RenderJobs(&iostreams.ColorScheme{}, tt.jobs, true) + assert.Equal(t, tt.wantVerbose, gotVerbose, "unexpected verbose mode output") + }) + } +} From 22504bfa96de77ec654371608427a2265e32a929 Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Mon, 26 May 2025 09:45:00 -0600 Subject: [PATCH 04/10] feat(update): add `updateable` build tag for update notifications --- internal/ghcmd/cmd.go | 8 -------- internal/ghcmd/update_disabled.go | 11 +++++++++++ internal/ghcmd/update_enabled.go | 11 +++++++++++ script/build.go | 4 +++- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 internal/ghcmd/update_disabled.go create mode 100644 internal/ghcmd/update_enabled.go diff --git a/internal/ghcmd/cmd.go b/internal/ghcmd/cmd.go index bd901b78e..9fc5bcefe 100644 --- a/internal/ghcmd/cmd.go +++ b/internal/ghcmd/cmd.go @@ -29,14 +29,6 @@ import ( "github.com/spf13/cobra" ) -// updaterEnabled is a statically linked build property set in gh formula within homebrew/homebrew-core -// used to control whether users are notified of newer GitHub CLI releases. -// This needs to be set to 'cli/cli' as it affects where update.CheckForUpdate() checks for releases. -// It is unclear whether this means that only homebrew builds will check for updates or not. -// Development builds leave this empty as impossible to determine if newer or not. -// For more information, . -var updaterEnabled = "" - type exitCode int const ( diff --git a/internal/ghcmd/update_disabled.go b/internal/ghcmd/update_disabled.go new file mode 100644 index 000000000..3fb7a7f4f --- /dev/null +++ b/internal/ghcmd/update_disabled.go @@ -0,0 +1,11 @@ +//go:build !updateable + +package ghcmd + +// updaterEnabled is a statically linked build property set in gh formula within homebrew/homebrew-core +// used to control whether users are notified of newer GitHub CLI releases. +// This needs to be set to 'cli/cli' as it affects where update.CheckForUpdate() checks for releases. +// It is unclear whether this means that only homebrew builds will check for updates or not. +// Development builds leave this empty as impossible to determine if newer or not. +// For more information, . +var updaterEnabled = "" diff --git a/internal/ghcmd/update_enabled.go b/internal/ghcmd/update_enabled.go new file mode 100644 index 000000000..5a136885b --- /dev/null +++ b/internal/ghcmd/update_enabled.go @@ -0,0 +1,11 @@ +//go:build updateable + +package ghcmd + +// updaterEnabled is a statically linked build property set in gh formula within homebrew/homebrew-core +// used to control whether users are notified of newer GitHub CLI releases. +// This needs to be set to 'cli/cli' as it affects where update.CheckForUpdate() checks for releases. +// It is unclear whether this means that only homebrew builds will check for updates or not. +// Development builds leave this empty as impossible to determine if newer or not. +// For more information, . +var updaterEnabled = "cli/cli" diff --git a/script/build.go b/script/build.go index d7085f590..08a193ffc 100644 --- a/script/build.go +++ b/script/build.go @@ -53,7 +53,9 @@ var tasks = map[string]func(string) error{ ldflags = fmt.Sprintf("-X github.com/cli/cli/v2/internal/authflow.oauthClientID=%s %s", os.Getenv("GH_OAUTH_CLIENT_ID"), ldflags) } - return run("go", "build", "-trimpath", "-ldflags", ldflags, "-o", exe, "./cmd/gh") + buildTags, _ := os.LookupEnv("GO_BUILDTAGS") + + return run("go", "build", "-trimpath", "-tags", buildTags, "-ldflags", ldflags, "-o", exe, "./cmd/gh") }, "manpages": func(_ string) error { return run("go", "run", "./cmd/gen-docs", "--man-page", "--doc-path", "./share/man/man1/") From 3e3b9adb455fe1aaac8b9ee8826c74726389e75d Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 27 May 2025 10:11:03 -0600 Subject: [PATCH 05/10] Refactor build tag logic Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- script/build.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/build.go b/script/build.go index 08a193ffc..2ea0088af 100644 --- a/script/build.go +++ b/script/build.go @@ -55,7 +55,13 @@ var tasks = map[string]func(string) error{ buildTags, _ := os.LookupEnv("GO_BUILDTAGS") - return run("go", "build", "-trimpath", "-tags", buildTags, "-ldflags", ldflags, "-o", exe, "./cmd/gh") + args := []string{"go", "build", "-trimpath"} + if buildTags != "" { + args = append(args, "-tags", buildTags) + } + args = append(args, "-ldflags", ldflags, "-o", exe, "./cmd/gh") + + return run(args...) }, "manpages": func(_ string) error { return run("go", "run", "./cmd/gen-docs", "--man-page", "--doc-path", "./share/man/man1/") From dd4095d0163a8218d3fb6e37235f5eb7ece434fe Mon Sep 17 00:00:00 2001 From: Kynan Ware <47394200+BagToad@users.noreply.github.com> Date: Tue, 27 May 2025 13:05:47 -0600 Subject: [PATCH 06/10] doc(update): improve comments on updaterEnabled --- internal/ghcmd/update_disabled.go | 7 +------ internal/ghcmd/update_enabled.go | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/internal/ghcmd/update_disabled.go b/internal/ghcmd/update_disabled.go index 3fb7a7f4f..3d9fa4e57 100644 --- a/internal/ghcmd/update_disabled.go +++ b/internal/ghcmd/update_disabled.go @@ -2,10 +2,5 @@ package ghcmd -// updaterEnabled is a statically linked build property set in gh formula within homebrew/homebrew-core -// used to control whether users are notified of newer GitHub CLI releases. -// This needs to be set to 'cli/cli' as it affects where update.CheckForUpdate() checks for releases. -// It is unclear whether this means that only homebrew builds will check for updates or not. -// Development builds leave this empty as impossible to determine if newer or not. -// For more information, . +// See update_enabled.go comment for more information. var updaterEnabled = "" diff --git a/internal/ghcmd/update_enabled.go b/internal/ghcmd/update_enabled.go index 5a136885b..3eb9eba4f 100644 --- a/internal/ghcmd/update_enabled.go +++ b/internal/ghcmd/update_enabled.go @@ -2,10 +2,17 @@ package ghcmd -// updaterEnabled is a statically linked build property set in gh formula within homebrew/homebrew-core -// used to control whether users are notified of newer GitHub CLI releases. -// This needs to be set to 'cli/cli' as it affects where update.CheckForUpdate() checks for releases. -// It is unclear whether this means that only homebrew builds will check for updates or not. -// Development builds leave this empty as impossible to determine if newer or not. -// For more information, . +// `updateable` is a build tag set in the gh formula within homebrew/homebrew-core +// and is used to control whether users are notified of newer GitHub CLI releases. +// +// Currently, updaterEnabled needs to be set to 'cli/cli' as it affects where +// update.CheckForUpdate() checks for releases. It is unclear to what extent +// this updaterEnabled is being used by unofficial forks or builds, so we decided +// to leave it available for injection as a string variable for now. +// +// Development builds do not generate update messages by default. +// +// For more information, see: +// - the Homebrew formula for gh: . +// - a discussion about adding this build tag: . var updaterEnabled = "cli/cli" From aa64bb5708673a57813135957075a754ee2e4c5e Mon Sep 17 00:00:00 2001 From: "Babak K. Shandiz" Date: Wed, 28 May 2025 12:55:11 +0100 Subject: [PATCH 07/10] docs(pr list): mention `--head` does not support `:` syntax Signed-off-by: Babak K. Shandiz --- pkg/cmd/pr/list/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/pr/list/list.go b/pkg/cmd/pr/list/list.go index 8837c66fb..7188df1a5 100644 --- a/pkg/cmd/pr/list/list.go +++ b/pkg/cmd/pr/list/list.go @@ -105,7 +105,7 @@ func NewCmdList(f *cmdutil.Factory, runF func(*ListOptions) error) *cobra.Comman cmd.Flags().IntVarP(&opts.LimitResults, "limit", "L", 30, "Maximum number of items to fetch") cmdutil.StringEnumFlag(cmd, &opts.State, "state", "s", "open", []string{"open", "closed", "merged", "all"}, "Filter by state") cmd.Flags().StringVarP(&opts.BaseBranch, "base", "B", "", "Filter by base branch") - cmd.Flags().StringVarP(&opts.HeadBranch, "head", "H", "", "Filter by head branch") + cmd.Flags().StringVarP(&opts.HeadBranch, "head", "H", "", `Filter by head branch (":" syntax not supported)`) cmd.Flags().StringSliceVarP(&opts.Labels, "label", "l", nil, "Filter by label") cmd.Flags().StringVarP(&opts.Author, "author", "A", "", "Filter by author") cmd.Flags().StringVar(&appAuthor, "app", "", "Filter by GitHub App author") From 19e1178a32fd5e06469386cb42eedf6d0991efaa Mon Sep 17 00:00:00 2001 From: phanium <91544758+phanen@users.noreply.github.com> Date: Wed, 28 May 2025 21:40:14 +0800 Subject: [PATCH 08/10] fix: `gh gist edit` panic when no file in a gist (#10627) * fix: `gh gist edit` panic when no file in a gist * fix: improve error message Signed-off-by: Babak K. Shandiz --------- Signed-off-by: Babak K. Shandiz Co-authored-by: Babak K. Shandiz --- pkg/cmd/gist/edit/edit.go | 2 ++ pkg/cmd/gist/edit/edit_test.go | 24 ++++++++++++++++++++++++ pkg/cmd/gist/shared/shared.go | 3 +++ pkg/cmd/gist/shared/shared_test.go | 27 +++++++++++++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/pkg/cmd/gist/edit/edit.go b/pkg/cmd/gist/edit/edit.go index e0d6e3b84..9e74adf62 100644 --- a/pkg/cmd/gist/edit/edit.go +++ b/pkg/cmd/gist/edit/edit.go @@ -236,6 +236,8 @@ func editRun(opts *EditOptions) error { if filename == "" { if len(candidates) == 1 { filename = candidates[0] + } else if len(candidates) == 0 { + return errors.New("no file in the gist") } else { if !opts.IO.CanPrompt() { return errors.New("unsure what file to edit; either specify --filename or run interactively") diff --git a/pkg/cmd/gist/edit/edit_test.go b/pkg/cmd/gist/edit/edit_test.go index 728f6e894..12cdf8169 100644 --- a/pkg/cmd/gist/edit/edit_test.go +++ b/pkg/cmd/gist/edit/edit_test.go @@ -557,6 +557,30 @@ func Test_editRun(t *testing.T) { }, wantErr: "gist ID or URL required when not running interactively", }, + { + name: "edit no-file gist (#10626)", + opts: &EditOptions{ + Selector: "1234", + }, + mockGist: &shared.Gist{ + ID: "1234", + Files: map[string]*shared.GistFile{}, + Owner: &shared.GistOwner{Login: "octocat"}, + }, + wantErr: "no file in the gist", + }, + { + name: "edit no-file gist, nil map (#10626)", + opts: &EditOptions{ + Selector: "1234", + }, + mockGist: &shared.Gist{ + ID: "1234", + Files: nil, + Owner: &shared.GistOwner{Login: "octocat"}, + }, + wantErr: "no file in the gist", + }, } for _, tt := range tests { diff --git a/pkg/cmd/gist/shared/shared.go b/pkg/cmd/gist/shared/shared.go index fc63f56ce..99a5524ee 100644 --- a/pkg/cmd/gist/shared/shared.go +++ b/pkg/cmd/gist/shared/shared.go @@ -44,6 +44,9 @@ func (g Gist) Filename() string { for fn := range g.Files { filenames = append(filenames, fn) } + if len(filenames) == 0 { + return "" + } sort.Strings(filenames) return filenames[0] } diff --git a/pkg/cmd/gist/shared/shared_test.go b/pkg/cmd/gist/shared/shared_test.go index 15b14a939..0bc1e1f11 100644 --- a/pkg/cmd/gist/shared/shared_test.go +++ b/pkg/cmd/gist/shared/shared_test.go @@ -163,6 +163,33 @@ func TestPromptGists(t *testing.T) { response: `{ "data": { "viewer": { "gists": { "nodes": [] } } } }`, wantOut: Gist{}, }, + { + name: "prompt list contains no-file gist (#10626)", + prompterStubs: func(pm *prompter.MockPrompter) { + pm.RegisterSelect("Select a gist", + []string{" about 6 hours ago", "gistfile0.txt about 6 hours ago"}, + func(_, _ string, opts []string) (int, error) { + return prompter.IndexFor(opts, " about 6 hours ago") + }) + }, + response: `{ "data": { "viewer": { "gists": { "nodes": [ + { + "name": "1234", + "files": [], + "description": "", + "updatedAt": "%[1]v", + "isPublic": true + }, + { + "name": "5678", + "files": [{ "name": "gistfile0.txt" }], + "description": "", + "updatedAt": "%[1]v", + "isPublic": true + } + ] } } } }`, + wantOut: Gist{ID: "1234", Files: map[string]*GistFile{}, UpdatedAt: sixHoursAgo, Public: true}, + }, } ios, _, _, _ := iostreams.Test() From f8e092cbb7bb83cf7dc8620f4875142dc7a69c12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 14:26:37 +0000 Subject: [PATCH 09/10] chore(deps): bump github.com/yuin/goldmark from 1.7.8 to 1.7.12 Bumps [github.com/yuin/goldmark](https://github.com/yuin/goldmark) from 1.7.8 to 1.7.12. - [Release notes](https://github.com/yuin/goldmark/releases) - [Commits](https://github.com/yuin/goldmark/compare/v1.7.8...v1.7.12) --- updated-dependencies: - dependency-name: github.com/yuin/goldmark dependency-version: 1.7.12 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..e527f0446 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( github.com/spf13/cobra v1.9.1 github.com/spf13/pflag v1.0.6 github.com/stretchr/testify v1.10.0 - github.com/yuin/goldmark v1.7.8 + 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 diff --git a/go.sum b/go.sum index 8d50af689..81f17a75c 100644 --- a/go.sum +++ b/go.sum @@ -521,8 +521,8 @@ github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavM 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= github.com/yuin/goldmark v1.7.1/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= -github.com/yuin/goldmark v1.7.8 h1:iERMLn0/QJeHFhxSt3p6PeN9mGnvIKSpG9YYorDMnic= -github.com/yuin/goldmark v1.7.8/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E= +github.com/yuin/goldmark v1.7.12 h1:YwGP/rrea2/CnCtUHgjuolG/PnMxdQtPMO5PvaE2/nY= +github.com/yuin/goldmark v1.7.12/go.mod h1:ip/1k0VRfGynBgxOz0yCqHrbZXhcjxyuS66Brc7iBKg= github.com/yuin/goldmark-emoji v1.0.5 h1:EMVWyCGPlXJfUXBXpuMu+ii3TIaxbVBnEX9uaDC4cIk= github.com/yuin/goldmark-emoji v1.0.5/go.mod h1:tTkZEbwu5wkPmgTcitqddVxY9osFZiavD+r4AzQrh1U= github.com/zalando/go-keyring v0.2.5 h1:Bc2HHpjALryKD62ppdEzaFG6VxL6Bc+5v0LYpN8Lba8= From 8fcb206de4731bb42de81d6dc563895f71ab7efb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 15:47:41 +0000 Subject: [PATCH 10/10] chore(deps): bump github.com/sigstore/protobuf-specs from 0.4.1 to 0.4.2 Bumps [github.com/sigstore/protobuf-specs](https://github.com/sigstore/protobuf-specs) from 0.4.1 to 0.4.2. - [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.1...v0.4.2) --- updated-dependencies: - dependency-name: github.com/sigstore/protobuf-specs dependency-version: 0.4.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..a8cdad760 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,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.1 + github.com/sigstore/protobuf-specs v0.4.2 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 8d50af689..3063ddf4c 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.1 h1:5SsMqZbdkcO/DNHudaxuCUEjj6x29tS2Xby1BxGU7Zc= -github.com/sigstore/protobuf-specs v0.4.1/go.mod h1:+gXR+38nIa2oEupqDdzg4qSBT0Os+sP7oYv6alWewWc= +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/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=