Commit graph

7412 commits

Author SHA1 Message Date
Stanislav Ochotnický
40be4b366c Ignore run-id when providing also job for rerun
This makes the behaviour consistent with gh run view.
2024-04-17 13:49:16 +02:00
William Martin
fd4f2c9c1f
Merge pull request #8620 from heaths/merge-json
Merge JSON responses from `gh api`
2024-04-17 11:45:13 +02:00
richterdavid
8009e79113
Update install_linux.md (#8950)
Co-authored-by: richterdavid <richterdavid@nospam.me>
Co-authored-by: William Martin <williammartin@github.com>
2024-04-16 17:37:25 +02:00
Heath Stewart
2758b80013
Remove unnecessary --help comment 2024-04-15 21:38:16 -07:00
Matthew Hughes
71404e7a6f
Fix go directive in go.mod (#8956) 2024-04-15 16:58:19 +02:00
Andy Feller
e069ab3b6c
Merge pull request #8935 from babakks/8508-add-skip-ssh-key-option 2024-04-15 10:03:51 -04:00
William Martin
05b37e70b2
Merge pull request #8957 from matthewhughes934/fix-go-ci-cache-contention
Fix cache contention in Go CI jobs
2024-04-15 12:29:41 +02:00
William Martin
22bc365365
Merge pull request #8958 from matthewhughes934/tidy-go-mod
Tidy `go.mod`
2024-04-15 12:24:15 +02:00
Babak K. Shandiz
1992fdeb1a
Use filepath.Join to support different platforms
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-14 00:09:53 +01:00
Babak K. Shandiz
d241259d4e
Run go mod tidy
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-13 21:17:36 +01:00
Babak K. Shandiz
f05a5ccb6b
Merge branch 'trunk' into 8508-add-skip-ssh-key-option
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-13 21:17:16 +01:00
Babak K. Shandiz
a269032fd3
Refactor into table tests
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-13 21:13:12 +01:00
Babak K. Shandiz
2c6343ad56
Explain --skip-ssh-key usage in long doc
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-13 15:47:44 +01:00
Matthew Hughes
d4169eadb7 Tidy go.mod
I.e. the result of `go mod tidy`. This is currently causing failures on
`trunk` CI, e.g.[1]

[1] https://github.com/cli/cli/actions/runs/8664231876/job/23760159399
2024-04-12 17:39:44 +01:00
Matthew Hughes
0d6bd6d53c Fix cache contention in Go CI jobs
Fix the `Set up go` and `Restore Go modules cache` steps both trying to
read/write the same contents. Since the `setup-go` step runs first this
results in the "restore cache" step trying to write the same contents
under `~/go/pkg/mod` which results in errors like (e.g. random
example[1]):

    /usr/bin/tar -xf /home/runner/work/_temp/6d12957f-f226-455e-b99c-fa7ee8c962cb/cache.tzst -P -C /home/runner/work/cli/cli --use-compress-program unzstd
    /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/net@v0.21.0/go.sum: Cannot open: File exists
    Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/net@v0.21.0/proxy/proxy.go: Cannot open: File exists
    Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/net@v0.21.0/proxy/socks5.go: Cannot open: File exists
    Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/net@v0.21.0/proxy/dial_test.go: Cannot open: File exists

Since restoring fails, the cache job thinks no cache hit was made and
proceeds to try and save, but since it may well have fetched a valid
cache this can also error (again, see[1]):

    Post job cleanup.
    /usr/bin/tar --posix -cf cache.tzst --exclude cache.tzst -P -C /home/runner/work/cli/cli --files-from manifest.txt --use-compress-program zstdmt
    Failed to save: Unable to reserve cache with key go-Linux-1b4ae53bfd76c3b70f62d419e17f36544d0a1331f04b13d2a942e7752e3789c3, another job may be creating this cache. More details: Cache already exists. Scope: refs/heads/trunk, Key: go-Linux-1b4ae53bfd76c3b70f62d419e17f36544d0a1331f04b13d2a942e7752e3789c3, Version: 2a8d0f2be1a88abb057cd9fcea9832bd16e7ab71798dbf93cd890eb9add83cf6

To avoid this, just rely on the caching functionality of the `seutp-go`
action.

For some context, It appears this cache behaviour was added with
cb7315c85d when these workflows were still
run with `setup-go@v2`:

    $ git show cb7315c85d3c0e010ba117ca7e692ed6f18f16c5:{.github/workflows/go.yml,.github/workflows/lint.yml} | grep 'actions/setup-go'
            uses: actions/setup-go@v2
            uses: actions/setup-go@v2

which is before caching behaviour was added (with `v3.2.0`[2]).

[1] https://github.com/cli/cli/actions/runs/8654869114/job/23732868571
[2] https://github.com/actions/setup-go/releases/tag/v3.2.0
2024-04-12 17:36:45 +01:00
Andy Feller
a42450e9a3
Merge pull request #8949 from steiza/steiza/multi-attestation
Add support to `attestation` command for more predicate types.
2024-04-12 11:12:59 -04:00
Meredith Lancaster
02158e896b
Fix attestation cmd offline unit test failure (#8933)
* pass policy to Verify method

Signed-off-by: Meredith Lancaster <malancas@github.com>

* remove policy argument from SigstoreVerifier constructor

Signed-off-by: Meredith Lancaster <malancas@github.com>

* add SigstoreVerifier interface and introduce mock SigstoreVerifier struct for unit testing

Signed-off-by: Meredith Lancaster <malancas@github.com>

* gofmt

Signed-off-by: Meredith Lancaster <malancas@github.com>

* rename LiveSigstoreVerifier constructor

Signed-off-by: Meredith Lancaster <malancas@github.com>

* pr feedback, add todos for tests that need to be reimplemented

Signed-off-by: Meredith Lancaster <malancas@github.com>

* remove unused import

Signed-off-by: Meredith Lancaster <malancas@github.com>

* add more missing TODO statements

Signed-off-by: Meredith Lancaster <malancas@github.com>

* update skipped test

Signed-off-by: Meredith Lancaster <malancas@github.com>

---------

Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-04-11 18:09:10 -06:00
Zach Steindler
f0a1e2707c Change subcommands default to be more user friendly
Signed-off-by: Zach Steindler <steiza@github.com>
2024-04-10 10:11:33 -04:00
Zach Steindler
2b293c4840 Add unit test, update naming, ensure DSSE envelope is in-toto
Signed-off-by: Zach Steindler <steiza@github.com>
2024-04-10 09:49:34 -04:00
Zach Steindler
c96fb7c553 Updates from linter feedback
Signed-off-by: Zach Steindler <steiza@github.com>
2024-04-09 17:34:45 -04:00
Zach Steindler
643f4031b2 Add support to attestation command for more predicate types.
Before, we required all attestations have predicateType
https://slsa.dev/provenance/v1. This allows you to use other predicate
types, and adds the ability to filter responses from the API for a
particular predicate type.

Signed-off-by: Zach Steindler <steiza@github.com>
2024-04-09 17:26:32 -04:00
Andy Feller
88a7e529ab
Merge pull request #8762 from Ebonsignori/8761/allow-multiple-items-in-nested-array
allow multiple items in nested array
2024-04-09 14:23:19 -04:00
Andy Feller
6a55528882
Merge pull request #8899 from babakks/8679-include-num-selected-repos
Include `numSelectedRepos` in JSON output of `gh secret list`
2024-04-09 13:18:50 -04:00
William Martin
a76230454a
Merge pull request #8945 from cli/wm/you-didnt-see-nothin
Close zip file in run view tests
2024-04-08 17:02:09 +02:00
William Martin
61584b83cb Close zip file in run view tests 2024-04-08 16:50:43 +02:00
William Martin
3ba976a3a4
Merge pull request #8944 from cli/wm/ensure-run-log-cache-creates-cache-dir
Ensure run log cache creates cache dir if it doesn't exist
2024-04-08 16:02:21 +02:00
William Martin
bbeccd69ad Ensure run log cache creates cache dir if it doesn't exist 2024-04-08 15:51:29 +02:00
Babak K. Shandiz
8839ee7ddf
Test --skip-ssh-key is captured correctly
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-06 13:11:02 +01:00
Babak K. Shandiz
0a77c56c44
Add test to verify skipped SSH key prompts
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-06 12:47:09 +01:00
Babak K. Shandiz
cf9699bbbb
Add --skip-ssh-key to options
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-06 12:46:05 +01:00
Babak K. Shandiz
3a3450fec5
Add SkipSSHKey field to LoginOptions
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-04-06 12:45:26 +01:00
Evan Bonsignori
b43a287e78
Merge pull request #1 from cli/8761/allow-multiple-items-in-nested-array
Add tests for non-happy field paths
2024-04-05 14:48:11 -07:00
Andy Feller
b722dd4151 Add tests for non-happy field paths
This commit as a suite of test around different combination of `gh api` field scenarios that result in errors.

In the course of creating this test, there were 2 scenarios that did not raise an error as expected involving overriding an existing map value.
2024-04-05 17:21:28 -04:00
William Martin
3be7a02fec
Merge pull request #8932 from cli/wm/fix-api-cache-test
Fix api cache test
2024-04-05 17:10:20 +02:00
William Martin
9738d68bba Fix api cache test 2024-04-05 16:47:29 +02:00
William Martin
3aa3d61108
Merge pull request #8929 from cli/wm/parse-url-no-nakaed-return
Remove naked returns from git ParseURL
2024-04-05 16:33:09 +02:00
William Martin
b0b147e60c Use testify in git url tests 2024-04-05 16:07:04 +02:00
William Martin
b6239238c8
Merge pull request #8931 from cli/wm/run-log-cache-stronger-abstraction
Create stronger run log cache abstraction
2024-04-05 16:00:28 +02:00
William Martin
c2aee1e402 Ensure cache dir is always available in RunLogCache 2024-04-05 15:39:33 +02:00
William Martin
103586a94c Remove RunLogCache interface 2024-04-05 15:33:49 +02:00
William Martin
a3ffc1ca33 Use real Run Log Cache in run view tests 2024-04-05 15:18:18 +02:00
William Martin
e644dc50d6 Capture error on Run Log Cache Exists 2024-04-05 15:16:12 +02:00
Andy Feller
b0a3975948
Merge pull request #8882 from zdrve/zdrve/job-name-prefix
Anchor the log filename to the start
2024-04-05 09:11:50 -04:00
William Martin
a89d50fc63 Rework Run Log Cache so that cache dir is injected 2024-04-05 14:59:24 +02:00
William Martin
f808dcee62 Expose CacheDir on Config 2024-04-05 14:58:12 +02:00
Andy Feller
0a2ede0279
Merge pull request #8837 from t4kamura/fix-cannot-lock-pr-url
Fixed `gh pr lock/unlock` not working when URL is passed
2024-04-05 08:29:35 -04:00
Andy Feller
1540a37fee
Merge branch 'trunk' into fix-cannot-lock-pr-url 2024-04-05 08:13:44 -04:00
William Martin
1b57b0f917 Minorly refactor scheme normalization in git ParseURL 2024-04-05 12:29:27 +02:00
William Martin
2c2a09c73e Test for parsing error in git ParseURL 2024-04-05 12:25:24 +02:00
William Martin
27f3d62d02 Remove naked returns from git ParseURL 2024-04-05 12:23:47 +02:00