Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gh for openSUSE:Factory checked in at 2024-07-15 19:48:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gh (Old) and /work/SRC/openSUSE:Factory/.gh.new.17339 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gh" Mon Jul 15 19:48:12 2024 rev:57 rq:1187339 version:2.52.0 Changes: -------- --- /work/SRC/openSUSE:Factory/gh/gh.changes 2024-06-17 19:28:58.633117346 +0200 +++ /work/SRC/openSUSE:Factory/.gh.new.17339/gh.changes 2024-07-15 19:48:20.769618025 +0200 @@ -1,0 +2,10 @@ +Sat Jul 6 20:51:12 UTC 2024 - Andreas Stieger <andreas.stie...@gmx.de> + +- Update to version 2.52.0: + * Attestation Verification - Buffer Fix + * Remove beta note from attestation top level command + * Removed beta note from `gh at download`. + * Removed beta note from `gh at verify`, clarified reusable workflows use case. + * add `-a` flag to `gh run list` + +------------------------------------------------------------------- Old: ---- cli-2.51.0.tar.zst New: ---- cli-2.52.0.tar.zst ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gh.spec ++++++ --- /var/tmp/diff_new_pack.tXmcrG/_old 2024-07-15 19:48:24.325749358 +0200 +++ /var/tmp/diff_new_pack.tXmcrG/_new 2024-07-15 19:48:24.329749507 +0200 @@ -2,6 +2,7 @@ # spec file for package gh # # Copyright (c) 2024 SUSE LLC +# Copyright (c) 2024 Andreas Stieger <andreas.stie...@gmx.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +20,7 @@ %define goflags "-buildmode=pie -trimpath -mod=vendor -modcacherw" %define sname cli Name: gh -Version: 2.51.0 +Version: 2.52.0 Release: 0 Summary: The official CLI for GitHub License: MIT ++++++ _service ++++++ --- /var/tmp/diff_new_pack.tXmcrG/_old 2024-07-15 19:48:24.357750540 +0200 +++ /var/tmp/diff_new_pack.tXmcrG/_new 2024-07-15 19:48:24.361750688 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/cli/cli</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v2.51.0</param> + <param name="revision">v2.52.0</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> @@ -16,7 +16,7 @@ <param name="compression">zst</param> </service> <service name="go_modules" mode="manual"> - <param name="archive">cli-2.51.0.tar.zst</param> + <param name="archive">cli-2.52.0.tar.zst</param> </service> </services> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.tXmcrG/_old 2024-07-15 19:48:24.385751574 +0200 +++ /var/tmp/diff_new_pack.tXmcrG/_new 2024-07-15 19:48:24.389751722 +0200 @@ -1,6 +1,8 @@ <servicedata> -<service name="tar_scm"> - <param name="url">https://github.com/cli/cli</param> - <param name="changesrevision">f647131e1d19da4d470cfeb5e936589e12e42960</param></service></servicedata> + <service name="tar_scm"> + <param name="url">https://github.com/cli/cli</param> + <param name="changesrevision">467550a14aa6e26f6872d684279e6604ed6ca7e7</param> + </service> +</servicedata> (No newline at EOF) ++++++ cli-2.51.0.tar.zst -> cli-2.52.0.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/.github/workflows/deployment.yml new/cli-2.52.0/.github/workflows/deployment.yml --- old/cli-2.51.0/.github/workflows/deployment.yml 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/.github/workflows/deployment.yml 2024-06-24 20:08:39.000000000 +0200 @@ -299,7 +299,7 @@ rpmsign --addsign dist/*.rpm - name: Attest release artifacts if: inputs.environment == 'production' - uses: actions/attest-build-provenance@49df96e17e918a15956db358890b08e61c704919 # v1.2.0 + uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2 with: subject-path: "dist/gh_*" - name: Run createrepo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/go.mod new/cli-2.52.0/go.mod --- old/cli-2.51.0/go.mod 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/go.mod 2024-06-24 20:08:39.000000000 +0200 @@ -20,9 +20,9 @@ github.com/gabriel-vasile/mimetype v1.4.4 github.com/gdamore/tcell/v2 v2.5.4 github.com/google/go-cmp v0.6.0 - github.com/google/go-containerregistry v0.19.1 + github.com/google/go-containerregistry v0.19.2 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 - github.com/gorilla/websocket v1.5.2 + github.com/gorilla/websocket v1.5.3 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-version v1.3.0 github.com/henvic/httpretty v0.1.3 @@ -39,7 +39,7 @@ github.com/shurcooL/githubv4 v0.0.0-20230704064427-599ae7bbf278 github.com/sigstore/protobuf-specs v0.3.2 github.com/sigstore/sigstore-go v0.3.0 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/zalando/go-keyring v0.2.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/go.sum new/cli-2.52.0/go.sum --- old/cli-2.51.0/go.sum 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/go.sum 2024-06-24 20:08:39.000000000 +0200 @@ -109,7 +109,6 @@ github.com/containerd/stargz-snapshotter/estargz v0.14.3 h1:OqlDCK3ZVUO6C3B/5FSkDwbkEETK84kQgEeFwDC+62k= github.com/containerd/stargz-snapshotter/estargz v0.14.3/go.mod h1:KY//uOCIkSuNAHhJogcZtrNHdKrA99/FCCRjE3HD36o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= @@ -198,8 +197,8 @@ github.com/google/certificate-transparency-go v1.1.8/go.mod h1:bV/o8r0TBKRf1X//iiiSgWrvII4d7/8OiA+3vG26gI8= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-containerregistry v0.19.1 h1:yMQ62Al6/V0Z7CqIrrS1iYoA5/oQCm88DeNujc7C1KY= -github.com/google/go-containerregistry v0.19.1/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= +github.com/google/go-containerregistry v0.19.2 h1:TannFKE1QSajsP6hPWb5oJNgKe1IKjHukIKDUmvsV6w= +github.com/google/go-containerregistry v0.19.2/go.mod h1:YCMFNQeeXeLF+dnhhWkqDItx/JSkH01j1Kis4PsjzFI= 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.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= @@ -218,8 +217,8 @@ github.com/googleapis/gax-go/v2 v2.12.3/go.mod h1:AKloxT6GtNbaLm8QTNSidHUVsHYcBHwWRvkNFJUQcS4= github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/websocket v1.5.2 h1:qoW6V1GT3aZxybsbC6oLnailWnB+qTMVwMreOso9XUw= -github.com/gorilla/websocket v1.5.2/go.mod h1:0n9H61RBAcf5/38py2MCYbxzPIY9rOkpvvMT24Rqs30= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -411,8 +410,8 @@ github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/attestation/attestation.go new/cli-2.52.0/pkg/cmd/attestation/attestation.go --- old/cli-2.51.0/pkg/cmd/attestation/attestation.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/attestation/attestation.go 2024-06-24 20:08:39.000000000 +0200 @@ -17,8 +17,6 @@ Short: "Work with artifact attestations", Aliases: []string{"at"}, Long: heredoc.Doc(` - ### NOTE: This feature is currently in beta, and subject to change. - Download and verify artifact attestations. `), } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/attestation/verification/attestation.go new/cli-2.52.0/pkg/cmd/attestation/verification/attestation.go --- old/cli-2.51.0/pkg/cmd/attestation/verification/attestation.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/attestation/verification/attestation.go 2024-06-24 20:08:39.000000000 +0200 @@ -73,21 +73,21 @@ attestations := []*api.Attestation{} - scanner := bufio.NewScanner(file) - for scanner.Scan() { - b := scanner.Bytes() + reader := bufio.NewReader(file) + + var line []byte + line, err = reader.ReadBytes('\n') + for err == nil { var bundle bundle.ProtobufBundle bundle.Bundle = new(protobundle.Bundle) - err = bundle.UnmarshalJSON(b) + err = bundle.UnmarshalJSON(line) if err != nil { return nil, fmt.Errorf("failed to unmarshal bundle from JSON: %v", err) } a := api.Attestation{Bundle: &bundle} attestations = append(attestations, &a) - } - if err := scanner.Err(); err != nil { - return nil, err + line, err = reader.ReadBytes('\n') } return attestations, nil diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/attestation/verify/verify.go new/cli-2.52.0/pkg/cmd/attestation/verify/verify.go --- old/cli-2.51.0/pkg/cmd/attestation/verify/verify.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/attestation/verify/verify.go 2024-06-24 20:08:39.000000000 +0200 @@ -25,18 +25,22 @@ Args: cmdutil.ExactArgs(1, "must specify file path or container image URI, as well as one of --owner or --repo"), Short: "Verify an artifact's integrity using attestations", Long: heredoc.Docf(` - ### NOTE: This feature is currently in beta, and subject to change. - Verify the integrity and provenance of an artifact using its associated cryptographically signed attestations. - The command requires either: + In order to verify an attestation, you must validate the identity of the Actions + workflow that produced the attestation (a.k.a. the signer workflow). Given this + identity, the verification process checks the signatures in the attestations, + and confirms that the attestation refers to provided artifact. + + To specify the artifact, the command requires: * a file path to an artifact, or * a container image URI (e.g. %[1]soci://<image-uri>%[1]s) * (note that if you provide an OCI URL, you must already be authenticated with its container registry) - In addition, the command requires either: + To fetch the attestation, and validate the identity of the signer, the command + requires either: * the %[1]s--repo%[1]s flag (e.g. --repo github/example). * the %[1]s--owner%[1]s flag (e.g. --owner github), or @@ -54,27 +58,38 @@ To see the full results that are generated upon successful verification, i.e. for use with a policy engine, provide the %[1]s--format=json%[1]s flag. - The attestation's certificate's Subject Alternative Name (SAN) identifies the entity - responsible for creating the attestation, which most of the time will be a GitHub - Actions workflow file located inside your repository. By default, this command uses + The signer workflow's identity is validated against the Subject Alternative Name (SAN) + within the attestation certificate. Often, the signer workflow is the + same workflow that started the run and generated the attestation, and will be + located inside your repository. For this reason, by default this command uses either the %[1]s--repo%[1]s or the %[1]s--owner%[1]s flag value to validate the SAN. - However, if you generate attestations with a reusable workflow then the SAN will - identify the reusable workflow â which may or may not be located inside your %[1]s--repo%[1]s - or %[1]s--owner%[1]s. In these situations, you can use the %[1]s--cert-identity%[1]s or - %[1]s--cert-identity-regex%[1]s flags to specify the reusable workflow's URI. + However, sometimes the caller workflow is not the same workflow that + performed the signing. If your attestation was generated via a reusable + workflow, then that reusable workflow is the signer whose identity needs to be + validated. In this situation, the signer workflow may or may not be located + inside your %[1]s--repo%[1]s or %[1]s--owner%[1]s. + + When using reusable workflows, use the %[1]s--signer-repo%[1]s, %[1]s--signer-workflow%[1]s, + or %[1]s--cert-identity%[1]s flags to validate the signer workflow's identity. For more policy verification options, see the other available flags. `, "`"), Example: heredoc.Doc(` - # Verify a local artifact linked with a repository + # Verify an artifact linked with a repository $ gh attestation verify example.bin --repo github/example - # Verify a local artifact linked with an organization + # Verify an artifact linked with an organization $ gh attestation verify example.bin --owner github - # Verify an OCI image using locally stored attestations + # Verify an artifact and output the full verification result + $ gh attestation verify example.bin --owner github --format json + + # Verify an OCI image using attestations stored on disk $ gh attestation verify oci://<image-uri> --owner github --bundle sha256:foo.jsonl + + # Verify an artifact signed with a reusable workflow + $ gh attestation verify example.bin --owner github --signer-repo actions/example `), // PreRunE is used to validate flags before the command is run // If an error is returned, its message will be printed to the terminal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/run/list/list.go new/cli-2.52.0/pkg/cmd/run/list/list.go --- old/cli-2.51.0/pkg/cmd/run/list/list.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/run/list/list.go 2024-06-24 20:08:39.000000000 +0200 @@ -5,6 +5,8 @@ "net/http" "time" + "github.com/MakeNowJust/heredoc" + "github.com/cli/cli/v2/api" "github.com/cli/cli/v2/internal/ghrepo" "github.com/cli/cli/v2/internal/tableprinter" @@ -35,6 +37,7 @@ Event string Created string Commit string + All bool now time.Time } @@ -52,8 +55,14 @@ } cmd := &cobra.Command{ - Use: "list", - Short: "List recent workflow runs", + Use: "list", + Short: "List recent workflow runs", + Long: heredoc.Docf(` + List recent workflow runs. + + Note that providing the %[1]sworkflow_name%[1]s to the %[1]s-w%[1]s flag will not fetch disabled workflows. + Also pass the %[1]s-a%[1]s flag to fetch disabled workflow runs using the %[1]sworkflow_name%[1]s and the %[1]s-w%[1]s flag. + `, "`"), Aliases: []string{"ls"}, Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { @@ -79,6 +88,7 @@ cmd.Flags().StringVarP(&opts.Event, "event", "e", "", "Filter runs by which `event` triggered the run") cmd.Flags().StringVarP(&opts.Created, "created", "", "", "Filter runs by the `date` it was created") cmd.Flags().StringVarP(&opts.Commit, "commit", "c", "", "Filter runs by the `SHA` of the commit") + cmd.Flags().BoolVarP(&opts.All, "all", "a", false, "Include disabled workflows") cmdutil.StringEnumFlag(cmd, &opts.Status, "status", "s", "", shared.AllStatuses, "Filter runs by status") cmdutil.AddJSONFlags(cmd, &opts.Exporter, shared.RunFields) @@ -110,10 +120,14 @@ opts.IO.StartProgressIndicator() if opts.WorkflowSelector != "" { + // initially the workflow state is limited to 'active' states := []workflowShared.WorkflowState{workflowShared.Active} - if workflow, err := workflowShared.ResolveWorkflow( - opts.Prompter, opts.IO, client, baseRepo, false, opts.WorkflowSelector, - states); err == nil { + if opts.All { + // the all flag tells us to add the remaining workflow states + // note: this will be incomplete if more workflow states are added to `workflowShared` + states = append(states, workflowShared.DisabledManually, workflowShared.DisabledInactivity) + } + if workflow, err := workflowShared.ResolveWorkflow(opts.Prompter, opts.IO, client, baseRepo, false, opts.WorkflowSelector, states); err == nil { filters.WorkflowID = workflow.ID filters.WorkflowName = workflow.Name } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/run/list/list_test.go new/cli-2.52.0/pkg/cmd/run/list/list_test.go --- old/cli-2.51.0/pkg/cmd/run/list/list_test.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/run/list/list_test.go 2024-06-24 20:08:39.000000000 +0200 @@ -2,6 +2,7 @@ import ( "bytes" + "fmt" "io" "net/http" "net/url" @@ -182,6 +183,156 @@ `), }, { + name: "inactive disabled workflow selected", + opts: &ListOptions{ + Limit: defaultLimit, + now: shared.TestRunStartTime.Add(time.Minute*4 + time.Second*34), + WorkflowSelector: "d. inact", + All: false, + }, + isTTY: true, + stubs: func(reg *httpmock.Registry) { + // Uses abbreviated names and commit messages because of output column limit + workflow := workflowShared.Workflow{ + Name: "d. inact", + ID: 1206, + Path: ".github/workflows/disabledInactivity.yml", + State: workflowShared.DisabledInactivity, + } + + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/workflows"), + httpmock.JSONResponse(workflowShared.WorkflowsPayload{ + Workflows: []workflowShared.Workflow{ + workflow, + }, + })) + }, + wantErr: true, + wantErrMsg: "could not find any workflows named d. inact", + }, + { + name: "inactive disabled workflow selected and all states applied", + opts: &ListOptions{ + Limit: defaultLimit, + now: shared.TestRunStartTime.Add(time.Minute*4 + time.Second*34), + WorkflowSelector: "d. inact", + All: true, + }, + isTTY: true, + stubs: func(reg *httpmock.Registry) { + // Uses abbreviated names and commit messages because of output column limit + workflow := workflowShared.Workflow{ + Name: "d. inact", + ID: 1206, + Path: ".github/workflows/disabledInactivity.yml", + State: workflowShared.DisabledInactivity, + } + + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/workflows"), + httpmock.JSONResponse(workflowShared.WorkflowsPayload{ + Workflows: []workflowShared.Workflow{ + workflow, + }, + })) + reg.Register( + httpmock.REST("GET", fmt.Sprintf("repos/OWNER/REPO/actions/workflows/%d/runs", workflow.ID)), + httpmock.JSONResponse(shared.RunsPayload{ + WorkflowRuns: []shared.Run{ + shared.TestRunWithWorkflowAndCommit(workflow.ID, 101, shared.Completed, shared.TimedOut, "dicto"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 102, shared.InProgress, shared.TimedOut, "diito"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 103, shared.Completed, shared.Success, "dics"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 104, shared.Completed, shared.Cancelled, "dicc"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 105, shared.Completed, shared.Failure, "dicf"), + }, + })) + }, + wantOut: heredoc.Doc(` + STATUS TITLE WORKFLOW BRANCH EVENT ID ELAPSED AGE + X dicto d. inact trunk push 101 4m34s about 4 minutes ago + * diito d. inact trunk push 102 4m34s about 4 minutes ago + â dics d. inact trunk push 103 4m34s about 4 minutes ago + X dicc d. inact trunk push 104 4m34s about 4 minutes ago + X dicf d. inact trunk push 105 4m34s about 4 minutes ago + `), + }, + { + name: "manually disabled workflow selected", + opts: &ListOptions{ + Limit: defaultLimit, + now: shared.TestRunStartTime.Add(time.Minute*4 + time.Second*34), + WorkflowSelector: "d. man", + All: false, + }, + isTTY: true, + stubs: func(reg *httpmock.Registry) { + // Uses abbreviated names and commit messages because of output column limit + workflow := workflowShared.Workflow{ + Name: "d. man", + ID: 456, + Path: ".github/workflows/disabled.yml", + State: workflowShared.DisabledManually, + } + + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/workflows"), + httpmock.JSONResponse(workflowShared.WorkflowsPayload{ + Workflows: []workflowShared.Workflow{ + workflow, + }, + })) + }, + wantErr: true, + wantErrMsg: "could not find any workflows named d. man", + }, + { + name: "manually disabled workflow selected and all states applied", + opts: &ListOptions{ + Limit: defaultLimit, + now: shared.TestRunStartTime.Add(time.Minute*4 + time.Second*34), + WorkflowSelector: "d. man", + All: true, + }, + isTTY: true, + stubs: func(reg *httpmock.Registry) { + // Uses abbreviated names and commit messages because of output column limit + workflow := workflowShared.Workflow{ + Name: "d. man", + ID: 456, + Path: ".github/workflows/disabled.yml", + State: workflowShared.DisabledManually, + } + + reg.Register( + httpmock.REST("GET", "repos/OWNER/REPO/actions/workflows"), + httpmock.JSONResponse(workflowShared.WorkflowsPayload{ + Workflows: []workflowShared.Workflow{ + workflow, + }, + })) + reg.Register( + httpmock.REST("GET", fmt.Sprintf("repos/OWNER/REPO/actions/workflows/%d/runs", workflow.ID)), + httpmock.JSONResponse(shared.RunsPayload{ + WorkflowRuns: []shared.Run{ + shared.TestRunWithWorkflowAndCommit(workflow.ID, 201, shared.Completed, shared.TimedOut, "dmcto"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 202, shared.InProgress, shared.TimedOut, "dmito"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 203, shared.Completed, shared.Success, "dmcs"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 204, shared.Completed, shared.Cancelled, "dmcc"), + shared.TestRunWithWorkflowAndCommit(workflow.ID, 205, shared.Completed, shared.Failure, "dmcf"), + }, + })) + }, + wantOut: heredoc.Doc(` + STATUS TITLE WORKFLOW BRANCH EVENT ID ELAPSED AGE + X dmcto d. man trunk push 201 4m34s about 4 minutes ago + * dmito d. man trunk push 202 4m34s about 4 minutes ago + â dmcs d. man trunk push 203 4m34s about 4 minutes ago + X dmcc d. man trunk push 204 4m34s about 4 minutes ago + X dmcf d. man trunk push 205 4m34s about 4 minutes ago + `), + }, + { name: "default arguments nontty", opts: &ListOptions{ Limit: defaultLimit, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/cli-2.51.0/pkg/cmd/run/shared/test.go new/cli-2.52.0/pkg/cmd/run/shared/test.go --- old/cli-2.51.0/pkg/cmd/run/shared/test.go 2024-06-13 14:33:06.000000000 +0200 +++ new/cli-2.52.0/pkg/cmd/run/shared/test.go 2024-06-24 20:08:39.000000000 +0200 @@ -15,21 +15,25 @@ } func TestRunWithCommit(id int64, s Status, c Conclusion, commit string) Run { + return TestRunWithWorkflowAndCommit(123, id, s, c, commit) +} + +func TestRunWithWorkflowAndCommit(workflowId, runId int64, s Status, c Conclusion, commit string) Run { return Run{ - WorkflowID: 123, - ID: id, + WorkflowID: workflowId, + ID: runId, CreatedAt: TestRunStartTime, UpdatedAt: TestRunStartTime.Add(time.Minute*4 + time.Second*34), Status: s, Conclusion: c, Event: "push", HeadBranch: "trunk", - JobsURL: fmt.Sprintf("https://api.github.com/runs/%d/jobs", id), + JobsURL: fmt.Sprintf("https://api.github.com/runs/%d/jobs", runId), HeadCommit: Commit{ Message: commit, }, HeadSha: "1234567890", - URL: fmt.Sprintf("https://github.com/runs/%d", id), + URL: fmt.Sprintf("https://github.com/runs/%d", runId), HeadRepository: Repo{ Owner: struct{ Login string }{Login: "OWNER"}, Name: "REPO", ++++++ vendor.tar.gz ++++++ /work/SRC/openSUSE:Factory/gh/vendor.tar.gz /work/SRC/openSUSE:Factory/.gh.new.17339/vendor.tar.gz differ: char 5, line 1