Commit graph

4720 commits

Author SHA1 Message Date
Andy Feller
f61961907e Update configuration support for accessible colors
- added support for `accessible_colors` configuration setting in `gh config` commandset
- updated default configuration file to contain `accessible_colors: disabled`
- add `GH_ACCESSIBLE_COLORS` env var to `gh environment`
- generated mocks via `go generate ./...` including previously missed prompter changes
2025-04-17 15:57:49 -04:00
Andy Feller
0ef0c42665
Merge pull request #10767 from leudz/fix-9749
Fix multi pages search for gh search
2025-04-16 16:57:12 -04:00
Kynan Ware
bff4db1309
Merge pull request #10773 from cli/kw/opt-into-no-spinners
Introduce option to opt-out of spinners
2025-04-16 14:44:45 -06:00
leudz
4a885899d6 Add comments for Total 2025-04-16 20:46:29 +02:00
Andy Feller
ba390db71f PR feedback
- update local variables to communicate what they are
- added docblock explaining search results populated
2025-04-16 14:22:29 -04:00
Kynan Ware
dabb29bd36 test(factory): remove needless nil check 2025-04-16 11:21:39 -06:00
Kynan Ware
1dbb01a1d1 doc(help): add documentation for GH_SPINNER_DISABLED 2025-04-16 11:17:23 -06:00
Kynan Ware
056d292f26 doc(iostreams): comment behavior of textual progress indicator 2025-04-16 11:13:58 -06:00
Kynan Ware
290e78c904 test(iostreams): update test description 2025-04-16 11:05:36 -06:00
Andy Feller
becd936e7b Update searcher tests
This commit moves the remaining searcher tests from using JSON marshaled types to using JSON responses for consistency.  There appears to be a weird JSON marshaling error with search.Repository that does not map `Name` field in the process.

Additionally, the test scenarios around pulling multiple pages beneath the total results have been updated to demonstrate that the REST API returns full pages in both of these cases, which is below the total number of results.
2025-04-15 17:13:43 -04:00
William Martin
a9dbda6913 Rework ref usage when finding and creating PRs 2025-04-15 13:38:10 -06:00
Kynan Ware
028caa3823 docs(pr create): clarify BaseRepo type in submitPR 2025-04-15 13:38:10 -06:00
Kynan Ware
339e1a25f3 docs(pr create): add link for user:branch syntax 2025-04-15 13:38:10 -06:00
Kynan Ware
76de5f07ca test(pr finder): run test in parallel 2025-04-15 13:38:10 -06:00
Kynan Ware
bf7bf99f54 fix(pr create & stubs): handle exitcode in stubs 2025-04-15 13:38:10 -06:00
Kynan Ware
81d00a36f8 fix(pr create): use existing local variables
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-04-15 13:38:10 -06:00
Kynan Ware
15ea861b79 docs(pr create): help text, doc user:branch syntax
Document the user:branch syntax for the `--head`` flag in `gh pr create`.
2025-04-15 13:38:10 -06:00
Kynan Ware
7bb5d71f4c doc(pr create): improve head repo resolution comments
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-04-15 13:38:10 -06:00
Kynan Ware
041f02c980 docs(pr create): standard <user>:<branch> syntax
Standardize <user>:<branch> syntax wherever it is described in comments.
2025-04-15 13:38:10 -06:00
Kynan Ware
6dae35b442 test(finder): change assert to require
Co-authored-by: Andy Feller <andyfeller@github.com>
2025-04-15 13:38:10 -06:00
Kynan Ware
e9e57f3ee3 doc(pr create): fix typo in comments
Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2025-04-15 13:38:10 -06:00
Kynan Ware
d524cbddc2 docs(pr create): clarify comment on head branch syntax 2025-04-15 13:38:10 -06:00
Kynan Ware
e999976b3d refactor(pr create): add PullRequestRefs HasHead 2025-04-15 13:38:10 -06:00
Kynan Ware
54da786bec fix(pr create): update error handling 2025-04-15 13:38:10 -06:00
Kynan Ware
bab7dc650b test(pr create): update repo owner names in tests 2025-04-15 13:38:10 -06:00
Kynan Ware
da235b134b tests(pr create): remove irrelevant comments 2025-04-15 13:38:10 -06:00
Kynan Ware
9b96e6cded doc(pr create): fix typo in test comments
Co-authored-by: Tyler McGoffin <jtmcg@github.com>
2025-04-15 13:38:10 -06:00
Kynan Ware
911079c744 docs(pr create): add comments 2025-04-15 13:38:10 -06:00
Kynan Ware
cf58910ac0 refactor(pr create): named headRefName var 2025-04-15 13:38:10 -06:00
Kynan Ware
9f1cb0cd54 refactor(pr create): simplify head remote logic 2025-04-15 13:38:10 -06:00
Kynan Ware
f50dac53cb docs(pr create): fix <repo_name>:<branch> desc. 2025-04-15 13:38:10 -06:00
Kynan Ware
c0c5d9123d refactor(pr create): use GetPRHeadLabel()
Use PrRefs.GetPRHeadLabel() instead of headBranchLabel.
Also remove headBranchLabel from CreateContext struct.

To do this, we needed a new identifier for when the head repo should be
created via a new fork of the base repo. Previously, this was done by
checking if the head repo was nil, but if we want to call
GetPRHeadLabel(), it requires a non-nil head repo to construct the
headBranchLabel. So, instead of the head repo being nil to signal
a fork, we pass a new forkHeadRepo bool in the CreateContext struct.
This also makes the decision to fork more intentional; now the decision
is made clearly instead of if the headRepo happens to be nil.
2025-04-15 13:38:10 -06:00
Kynan Ware
178fb40515 refactor(pr create): Use PrRefs in CreateContext
Replace BaseRepo, HeadRepo, HeadBranch with PrRefs in CreateContext struct.
2025-04-15 13:38:10 -06:00
Kynan Ware
c3087cde99 refactor(pr create): Refactor NewCreateContext
- Use prRefs instead of local vars more.
- Rename variables for readability.
- Improve comments.
- Refactor tests.
2025-04-15 13:38:10 -06:00
Kynan Ware
10e3949348 refactor(pr create): use prRefs.GetPRHeadLabel() 2025-04-15 13:38:10 -06:00
Kynan Ware
84a35ca381 refactor: rename IsPushEnabled for clarity 2025-04-15 13:38:10 -06:00
Kynan Ware
dc486258cb test(pr create): test --head=<remote>:<branch> 2025-04-15 13:38:10 -06:00
Kynan Ware
6db9048557 refactor: Refactor pr create
Refactor pr create by reducing flapping `isPushEnabled` between true and false.
`isPushEnabled` is now also set to `true` by default, logically aligning with the
behavior description in the help text.
2025-04-15 13:38:10 -06:00
Kynan Ware
a8d01c70cd feat: support @{push} revision syntax 2025-04-15 13:38:10 -06:00
Kynan Ware
b61b2298d2 doc: fix PullRequestRefs comment 2025-04-15 13:38:10 -06:00
Andy Feller
bdfd51ca7f Fix search tests around totals, initialization
This commit is focused on fixing the `searcher` tests for a few reasons:

1. Correcting the `.Total` logic in the previous commit caused changes to tests to fail
2. Tests involving results that exceed the max per page have been improved with new initialize helper, allowing testing table scenarios to be self contained
3. Tests that stub JSON response payloads have been standardized on maps rather than GitHub type primitives (Repository, Issue, Commit, Code, etc)
4. Tests had some minor formatting changes to make them easier to understand and maintain
2025-04-15 14:43:10 -04:00
Meredith Lancaster
6dbb3fe541
Merge pull request #10750 from malancas/refactor-sigstore-verifier-logic
Refactor Sigstore verifier logic
2025-04-15 09:05:47 -06:00
Andy Feller
f928cb1e19 Fix remaining search logic totals 2025-04-15 08:36:45 -04:00
Andy Feller
15ff7ba465 Restore result.Total logic, fix formatting
This change restores the original logic of passing the search total count logic as is to the result.

Additionally, this undoes some of the contributor's formatting changes that increase the changed lines to review.
2025-04-15 08:00:47 -04:00
Kynan Ware
f283d6d11c feat(iostreams): textual progress indicator does not clear screen
This bypasses the `spinner` package for the textual progress indicator for users
with the spinner disabled out of concerns for accessibility, specifically
with screen readers:

- The `spinner` package will continuously re-draw the screen. I wasn't
able to have this cause problems with my Mac screen reader, but it's
nonetheless a concern that other screen readers may not handle this
screen re-drawing well.
- The `spinner` package clears any progress indicator messages from the screen
when stopping the progress indicator or changing its label.
This is a problem because it interrupts screen readers and leaves no way
to recover what the loading message was by scrolling up in the terminal.

NOTE: this new implementation still interrupts the screen reader when
the a new label is printed, but it does not clear the screen. This makes
the loading messages recoverable, at least.
2025-04-14 19:30:05 -06:00
Kynan Ware
3eba461afb fix(iostreams): spinner env var is now in factory
- Move env var evaluation to the factory defaults.
- Use only the label for the spinner instead of adding
"working..." every time. "working..." remains the default
when no label is provided.
2025-04-14 15:07:11 -06:00
Kynan Ware
3aadd51096 feat(iostreams): Option to opt out of spinners 2025-04-11 16:18:50 -06:00
William Martin
408e21ebdd
Merge pull request #10769 from cli/babakks/fix-job-log-resolution
Fix job log resolution to skip legacy logs in favour of normal/new ones
2025-04-11 16:16:39 +02:00
Babak K. Shandiz
f337ce90a0
Explain job log resolution reason
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 14:51:39 +01:00
William Martin
2a2678116f
Merge pull request #10609 from iamazeem/10228-gh-ext
[gh ext] Fix `GitKind` extension directory path
2025-04-11 15:51:16 +02:00