Commit graph

7836 commits

Author SHA1 Message Date
Cody Soyland
ea1a3da1eb
Rename ProtobufBundle to Bundle
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-04 16:45:02 -04:00
Cody Soyland
8446079656
Upgrade to sigstore-go v0.6.1
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-09-04 16:38:13 -04:00
Meredith Lancaster
34d7ef7a0e
gh attestation verify handles empty JSONL files (#9541)
* handle empty jsonl files

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

* check processed attestations slice length

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

* update err name and message

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

---------

Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-09-04 10:31:41 -06:00
Aryan Bhosale
9a0a7d427e
verify 2nd artifact without swapping order (#9532)
* verify 2nd artifact without swapping order

possible solution to https://github.com/cli/cli/issues/9521#issuecomment-2310686619?

* copy the mentioned test file and adds some extra lines

* rm unnecessary import

* Update pkg/cmd/attestation/verification/attestation_test.go

Co-authored-by: Meredith Lancaster <malancas@users.noreply.github.com>

* gofmt

---------

Co-authored-by: Meredith Lancaster <malancas@users.noreply.github.com>
2024-09-04 08:57:56 -06:00
William Martin
2bd3c22903
Merge pull request #9555 from crystalstall/trunk
chore: fix some function names
2024-09-02 11:43:32 +02:00
crystalstall
5562c1489f chore: fix some function names
Signed-off-by: crystalstall <crystalruby@qq.com>
2024-09-02 15:18:42 +08:00
Zongle Wang
192f57ef42
Improve the help message for -F (#9525)
Changing to `release-notes.md` from `changelog.md` may help users better contextually understand usage.

Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2024-08-28 11:00:46 -07:00
Andy Feller
327451627c
Merge pull request #9509 from muzimuzhi/typo/repo-sync
Fix doc typo for `repo sync`
2024-08-28 09:29:24 -04:00
dependabot[bot]
b8db372d71
build(deps): bump actions/attest-build-provenance from 1.4.1 to 1.4.2 (#9518)
Bumps [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](310b0a4a3b...6149ea5740)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2024-08-26 10:26:42 -07:00
Aryan Bhosale
8305a49c3f
"offline" verification using the bundle of attestations without any additional handling of the file (#9523) 2024-08-26 09:58:29 -06:00
Andy Feller
19daa35c81
Merge pull request #9482 from benebsiny/cli-9153
fix the trimming of log filenames for `gh run view`
2024-08-22 15:23:06 -04:00
Andy Feller
2695983e40
Merge pull request #9495 from muzimuzhi/web/drop-trailing-space-in-flag
Drop surplus trailing space char in flag names in web
2024-08-22 15:12:40 -04:00
Yukai Chou
687a43fe89 Drop surplus trailing space char in flag names in web
Introduced by 92cb2cc7 (more closely match cobra default val display,
2023-12-05).
2024-08-23 02:15:07 +08:00
Tyler McGoffin
91eb34011c
Remove Internal from gh repo create prompt when owner is not an org (#9465)
* Remove `Internal` from `gh repo create` prompt when owner is not an org

Closes #9464

Internal repos only exist for organizations, so when a user selects their
personal namespace to create a repo using `gh repo create`, `Internal`
should not be an option in the `Visibility` prompt.

This should avoid the additional quirk where if the user selects
`Internal` while creating a personal repo and then proceeds to add any
of the README, .gitignore, or LICENSE files prompted for later, the repo
will not error and instead get created as a `Public` repo. This has the
potential for a user to unknowingly leak sensitive info intended to go
into a non-public repo.

* Refactor prompter with test coverage

By extracting the repo visibility options to its own function,
getRepoVisibilityOptions, we're able to directly test the behavior
introduced with this change. This breaks the testing pattern established
here thus far, but may be a good example of the direction we should
explore for a future refactor.

* Add failing tests to check for error with internal vis in non-org repos

There is a bug in the code, currently, where a user repo can attempt to be
created as with `--internal` visibility flag  when that is not an option
for non-org repos. It fails at the API level if the --gitignore,
--license, or --add-readme flags are not included, but silently falls back
to Public visibility if one of them is included.

Because this bug already existed, this commit adds the tests to ensure
that both scenarios described above are captured accurately by the test
suite. A fix for the latter scenario will be coming in a future commit

* Add Exclude to httpmock registry and implement in Test_repoCreate

Upon attempting to make the previous commit pass, I realized that it was
actually impossible to test what I wanted to. The tests in the previous
commit were behaving as expected given the bug that commit described, but
upon attempting to implement a solution I realized that the tests were
only testing the mocks and not the code functionality itself.

Essentially, when the code to fix the bug was implemented, the tests were
failing because the mocks required to test the buggy behavior were no
longer being called. To make the tests pass, I'd have to rewrite them, but
were I to remove the bug fix, the tests would no longer fail.

This pointed me to a gap in our httpmocks - the ability to intentionally
exclude api calls. The behavior I'm trying to test, here, is that we stop
executing when a certain condition is met, and therefore won't make any
subsequent api calls down the chain.

This implements the Exclude method on the registry such that it will fail
if an excluded api pattern is called. I have refactored the tests in
Test_repoCreate to use the Exclude mock for testing.

* Add error if user attempts to create repo with --internal flag

This was previously failing at either the API if no other flags were
included or falling back to creating a public repo if one of gitignore,
license, or add-readme were included.

* Add testing for error messages in gh repo create

In the previous commits, we've introduced a new error when a user tries to
create an Internal repo not owned by an organization. This adds tests to
verify that the error we are getting is, in fact, the one associated with
this use case and not some random error.
2024-08-22 10:01:16 -07:00
Yukai Chou
2374e82633 Fix doc typo for repo sync 2024-08-23 00:17:31 +08:00
Eugene
ef9069a1b0
Merge pull request #9421 from cli/eugene/attestation/fetch-oci-bundle
Fetch bundle from OCI registry for verify
2024-08-22 09:54:03 -04:00
Yukai Chou
c81ccab4b8
Quote repo names consistently in gh repo sync stdout (#9491)
* Quote repo names consistently in `gh repo sync` stdout

* Update tests
2024-08-21 12:20:45 -07:00
Andy Feller
779a1203b6
Merge pull request #9471 from heaths/issue9470
Always print URL scheme to stdout
2024-08-21 14:46:52 -04:00
Eugene
e21d053faf
Merge branch 'trunk' into eugene/attestation/fetch-oci-bundle 2024-08-21 12:24:08 -04:00
ejahnGithub
0d38a2fd8e fixed the test 2024-08-21 10:52:42 -04:00
ejahnGithub
47a8f4bbdd update error message 2024-08-20 16:14:39 -04:00
Andy Feller
95a2f95f75
Merge pull request #9453 from cli/jtmcg/project-v2-syntax-in-search
Update `--project <number>` flags in `gh search` to `owner/number`
2024-08-20 07:42:17 -04:00
Andy Feller
4f681aaee1
Merge pull request #9477 from benebsiny/cli-9496
fix behavior for `gh issue develop -b does-not-exist-on-remote`
2024-08-19 16:42:07 -04:00
ejahnGithub
3fd309bdde rename flag to bundle-from-oci 2024-08-19 10:29:01 -04:00
William Martin
4283adbc40
Merge pull request #9396 from bryanhonof/trunk
Add Flox as an installation option
2024-08-19 13:59:35 +02:00
William Martin
d40175fbe5 Add flox to linux installation instructions 2024-08-19 13:48:45 +02:00
William Martin
7187db418b
Merge pull request #9439 from arunsathiya/update/9205-pr-checks-json-help-doc
cmd/pr/checks: Describe bucket and state JSON fields
2024-08-19 12:53:04 +02:00
benebsiny
64415df08d fix the trimming of log filenames for gh run view 2024-08-18 16:57:19 +08:00
EBIBO
08aafc5484
Update pkg/cmd/issue/develop/develop.go
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-08-18 09:25:39 +08:00
EBIBO
04b4122e61
Update api/queries_branch_issue_reference.go
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-08-18 09:25:30 +08:00
benebsiny
e269d43c5a add testing 2024-08-17 13:47:02 +08:00
benebsiny
216c283e03 Merge branch 'trunk' into cli-9496 2024-08-17 12:05:17 +08:00
benebsiny
56e1cdae9e fix behavior for issue develop -b non-exist-branch 2024-08-17 12:04:09 +08:00
Arun
800f99d9fa Describe bucket and state JSON fields in pr checks command
While the `state` field corresponds 1:1 with different GitHub Actions
states, the `bucket` field is an abstraction of the CLI that lacked
documentation. This both adds documentation about the existence of the
`bucket` field and enumerates the possible values.
2024-08-16 15:26:27 -07:00
Prabhat Kumar Sahu
1886fb46ab
Fix pr checks exit code (#9452)
* Enhance  with exit code documentation

* Add new error message for PR check

* Refine gh pr checks: Add exit code 8

* Update EXIT CODES section format in man page generation
2024-08-16 14:30:11 -07:00
Heath Stewart
6b9a0aa89f
Check http scheme as well
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-08-16 10:11:53 -07:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
Heath Stewart
009838a8db
Always print URL scheme to stdout
Fixes #9470
2024-08-16 10:11:46 -07:00
Fredrik Skogman
255f5301d5
Merge pull request #9467 from cli/attestation-tuf-root-update
Update attestation TUF root
2024-08-16 08:40:55 +02:00
Kynan Ware
0140e3de66
Merge pull request #9468 from cli/BagToad-external-contributors-note
Add note for external contributors to `working-with-us.md`
2024-08-15 15:47:56 -06:00
Andy Feller
0e690fad0e
Merge pull request #9462 from cli/9394-update-go-extension-workflow-template-to-reflect-recent-enhancements-to-cligh-extension-precompile
Update Go and other extension workflow templates to reflect recent enhancements to `cli/gh-extension-precompile`
2024-08-15 13:43:42 -04:00
Eugene
04e111db03
Merge branch 'trunk' into eugene/attestation/fetch-oci-bundle 2024-08-15 13:31:41 -04:00
Kynan Ware
d707102958
Add a note about external contributors to working-with-us.md 2024-08-15 11:24:40 -06:00
Cody Soyland
4618a267de
Update attestation TUF root
Signed-off-by: Cody Soyland <codysoyland@github.com>
2024-08-15 13:06:54 -04:00
ejahnGithub
05891965d0 udpate the options 2024-08-15 11:56:28 -04:00
Kynan Ware
5b7070f027
include required permissions to generate attestations 2024-08-14 15:16:45 -06:00
dependabot[bot]
0835642d3f
build(deps): bump github.com/creack/pty from 1.1.21 to 1.1.23 (#9459)
Bumps [github.com/creack/pty](https://github.com/creack/pty) from 1.1.21 to 1.1.23.
- [Release notes](https://github.com/creack/pty/releases)
- [Commits](https://github.com/creack/pty/compare/v1.1.21...v1.1.23)

---
updated-dependencies:
- dependency-name: github.com/creack/pty
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 11:35:19 -07:00
Kynan Ware
820f4f3469
Do not generate build attestations for otherBinWorkflow.yml 2024-08-14 12:02:11 -06:00
bagtoad
025dcc8e95 Use latest checkout version, generate attestations, and specify go version file input. 2024-08-14 10:20:41 -06:00
Cody Soyland
9e27af999e
Merge pull request #9442 from cli/require-sigstore-bundle-v0.3
Require Sigstore Bundle v0.2+ when verifying with `gh attestation`
2024-08-13 13:56:11 -04:00