Commit graph

8177 commits

Author SHA1 Message Date
Meredith Lancaster
93c78a2134 use sigstore specific err
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-30 15:28:34 -06:00
Meredith Lancaster
b44c9d3003 undo policy method changes
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-30 15:23:50 -06:00
Meredith Lancaster
3378b546da simplify if else logic
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-30 12:58:40 -06:00
Meredith Lancaster
41c3ba5fa7 drop sigstore instance for now
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-29 18:19:19 -06:00
Meredith Lancaster
e16b69bd08 cert extension funcs are now policy methods
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-29 17:27:47 -06:00
Meredith Lancaster
e5b2b09a6e move policy functions into methods
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-29 16:41:17 -06:00
Meredith Lancaster
704de0cf37 start building a separate policy struct
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-10-29 15:33:24 -06:00
William Martin
14d339d9ba
Merge pull request #9810 from cli/andyfeller/testscript-extension
Add comprehensive testscript for gh ext commandset
2024-10-28 13:05:32 +01:00
Andy Feller
37da12a9d2 Rename similar to other coarse commandset tests
Based on insights gained from reviewing conventions in #9815 with @jtmcg, I'm renaming this testscript to keep consistent with `gpg-key`, `label`, `ssh-key`, etc.
2024-10-28 12:54:50 +01:00
Andy Feller
911f070936 Skip extension testscript if bash isn't available
As this testscript creates a Bash-based script extension, the testscript should be skipped if it isn't on the path and executable.

Ideally, we would refactor this test to isolate that portion of the tests OR switch to a Go-based extension that can be compiled and run everywhere.
2024-10-28 12:54:50 +01:00
Andy Feller
ed24477fd3 Add comprehensive testscript for gh ext commandset
Rather than multiple separate testscripts per `gh ext` subcommand, this commit adds a comprehensive test around `gh extension` commandset.
2024-10-28 12:54:47 +01:00
William Martin
7066cdeb26
Merge pull request #9815 from cli/andyfeller/testscripts-ruleset
Add comprehensive testscript for `gh ruleset`
2024-10-28 12:52:24 +01:00
Andy Feller
6dc86e5f40 Rename testscript for consistency
Similar to `gpg-key`, `label`, `ssh-key`, this coarse grained testscript should be named after the commandset given it isn't a collection of targeted scenarios.
2024-10-28 12:40:15 +01:00
Andy Feller
c27677bda6 Add comprehensive testscript for gh ruleset 2024-10-28 12:40:12 +01:00
William Martin
f35c123b71
Merge pull request #9816 from cli/jtmcg/testscripts-project
Add acceptance test for `project` command
2024-10-28 12:24:53 +01:00
William Martin
a381ca5dc4
Merge pull request #9821 from cli/hard-fork-go-internal
Update testscript to use hard fork
2024-10-25 18:21:52 +02:00
Tyler McGoffin
7a5dc50324 Modify script to use the project number returned by the api upon creation 2024-10-25 09:03:50 -07:00
William Martin
30d9fc53d1 Update testscript to use hard fork 2024-10-25 16:29:23 +02:00
Tyler McGoffin
7148304344 Add acceptance test for project-create and project-delete 2024-10-24 12:53:52 -07:00
Tyler McGoffin
8b5c5385c7 Add TestProject to acceptance_test.go 2024-10-24 12:18:56 -07:00
Tyler McGoffin
31e8a87598 Alphabetize test functions
While swarming on this, I've encountered many merge conflicts based on
where folks have introduced new test functions. Alphabetizing them should
reduce the number of merge conflicts we encounter while introducing more
of these tests moving forward
2024-10-24 10:01:39 -07:00
Kynan Ware
44ee177607
Merge pull request #9813 from cli/wm/update-acceptance-test-redaction
Note token redaction in Acceptance test README
2024-10-24 10:47:44 -06:00
William Martin
2a2adfed0f
Merge pull request #9787 from cli/jtmcg/testscripts-auth
Add acceptance tests for `gh auth` commands
2024-10-24 18:42:31 +02:00
William Martin
366aea95eb Note token redaction in Acceptance test README 2024-10-24 18:35:30 +02:00
William Martin
0880dc4d79
Merge pull request #9812 from cli/wm-kw/ssh-key-and-org-testscripts.txtar
Add acceptance tests for `org` and `ssh-key` commands
2024-10-24 18:30:47 +02:00
bagtoad
f72a82db99 Refactor gpg-key delete to align with ssh-key delete 2024-10-24 09:59:02 -06:00
bagtoad
2f849f03ff Add acceptance tests for org command 2024-10-24 09:58:06 -06:00
William Martin
d4c70009bf
Adjust environment help for host and tokens (#9809) 2024-10-24 17:54:27 +02:00
William Martin
76e6fbba36 Add SSH Key Acceptance test 2024-10-24 17:46:17 +02:00
William Martin
ff9b0a1c64
Merge pull request #9811 from cli/wm-kw/github-cli-636-add-testscript-for-gpg-key
Add testscripts for gpg-key and label commands
2024-10-24 17:21:02 +02:00
William Martin
4100992d40 Add Acceptance test for label command 2024-10-24 17:00:54 +02:00
bagtoad
f27cddcb92 Add acceptance test for gpg-key 2024-10-24 08:43:40 -06:00
William Martin
fc4d7e44fd
Merge pull request #9804 from cli/wm/redact-tokens-from-acceptance
Use forked testscript for token redaction
2024-10-24 16:24:44 +02:00
William Martin
787a243323 Update go-internal to redact more token types in Acceptance tests 2024-10-24 15:14:51 +02:00
Tyler McGoffin
2b480daf7a Address PR feedback 2024-10-23 13:57:57 -07:00
Andy Feller
8513824ef8
Merge pull request #9805 from cli/kw/clarify-gh-is-available-for-GHEC
Clarify in README that `gh` is supported on GitHub Enterprise Cloud
2024-10-23 16:55:35 -04:00
Kynan Ware
15d86bbdf8
Clarify gh is available for GitHub Enterprise Cloud 2024-10-23 14:44:13 -06:00
Tyler McGoffin
59aedc4e89 Remove comment from gh auth logout 2024-10-23 13:33:17 -07:00
Tyler McGoffin
0614d85027 Add acceptance tests for auth-setup-git and formattedStringToEnv helper func
To test this, I decided to look into the .gitconfig used for the test and
examine the credential helpers. However, the format of the git command is

`git config --get credential.<URL>.helper`

What's awkward about this is that the <URL> depends on the host the user
specified when running the tests, meaning I'd need to create a key like
credential.https://github.com.helper to access what I need while setting
this up.

There was no functionality for string formatting before, so I added the
command formattedStringToEnv which essentially wraps fmt.Sprintf() and
saves the string to an environment variable.

This allowed me to dynamically create the config key in the test.
2024-10-23 13:33:17 -07:00
Phill MV
afa4272bdf
Merge pull request #9797 from cli/phillmv/retry-getting-attestations
`gh at verify` retries fetching attestations if it receives a 5xx
2024-10-23 13:45:09 -04:00
William Martin
2433475d3f Use forked testscript for token redaction 2024-10-23 14:13:26 +02:00
Kynan Ware
e390874fef
Merge pull request #9799 from cli/kw/attestation-use-new-github-previews-terminology
Use new GitHub previews terminology in attestation commands' help docs
2024-10-22 13:20:33 -06:00
Kynan Ware
fd56fec110
Merge pull request #9800 from cli/kw/update-docs-with-github-preview-terminology
Use new GitHub preview terms in `working-with-us.md`
2024-10-22 12:40:14 -06:00
bagtoad
abb2772696 Use new GitHub preview terms in working-with-us.md
Update the "working with us" docs to align with new GitHub previews terminology, replacing `beta` with `public preview`.

https://github.blog/changelog/2024-10-18-new-terminology-for-github-previews/
2024-10-22 10:56:39 -06:00
bagtoad
04add8d68f Use new GitHub previews terminology in attestation
Update attestations commands to align with new GitHub previews terminology, replacing `beta` with `public preview`.

https://github.blog/changelog/2024-10-18-new-terminology-for-github-previews/
2024-10-22 10:50:00 -06:00
Andy Feller
34f1b50acc
Merge pull request #9784 from cli/andyfeller/testscripts-variable
Add acceptance tests for `variable` commands
2024-10-22 10:04:21 -04:00
William Martin
ad7c29dc5c
Merge pull request #9790 from tsukasaI/feature/add-archived-timestamp
Add archivedAt json field to repo view and list
2024-10-22 14:03:58 +02:00
William Martin
a923e33421 Test json flags for repo view and list 2024-10-22 13:38:51 +02:00
Tyler McGoffin
aaf4c4e4e3 Clean up auth-login-logout acceptance test with native functionality
The previous commit introduced two new functions, setEnvVar and
deleteEnvVar that are duplicative of functionality native to testscripts.
This commit switches to the native functionality and removes the
duplicative functions introduced in the previous commit.

Additionally, it removes the `--token` flag that was added to
`gh auth login`
2024-10-21 16:42:48 -07:00
Tyler McGoffin
52daa9cf7d Add --token flag to gh auth login to accept a PAT as a flag
Additionally, this commit adds acceptance testing for `gh auth login` and
`gh auth logout`.

The --token flag was necessary for adding testing for `gh auth login`
because the current implementation with `--with-token` appears to be
broken. It hangs, waiting for user input, but user input doesn't exit it.

Additionally, it appears that `--with-token` is intended to allow for TTY
input of an auth token, but it isn't implemented.

`--with-token` does work when used with the redirect operator `<` when the
token is saved in a file. However, due to limitations of testscripts, I
could not use a file for saving the token in a repeatable manner. Thus,
implementing the `--token` flag seemed like a quick solution to validate
that the direction I was going during testing was valid.

Whether the flag stays or not is up for discussion, and I'd love to get
input on that from the team.
2024-10-21 16:38:10 -07:00