Commit graph

11279 commits

Author SHA1 Message Date
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
a5fe37f91b test(pr create): add AT for remote:branch syntax 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
1848beb94b test(pr create): unset gh-resolved 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
cd67c2efcb test(pr create): AT assert head repo and head ref 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
dependabot[bot]
7293c1651e
chore(deps): bump github.com/sigstore/sigstore-go from 0.7.1 to 0.7.2
Bumps [github.com/sigstore/sigstore-go](https://github.com/sigstore/sigstore-go) from 0.7.1 to 0.7.2.
- [Release notes](https://github.com/sigstore/sigstore-go/releases)
- [Commits](https://github.com/sigstore/sigstore-go/compare/v0.7.1...v0.7.2)

---
updated-dependencies:
- dependency-name: github.com/sigstore/sigstore-go
  dependency-version: 0.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-14 14:07:09 +00: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
William Martin
ae7ee522d4
Merge pull request #10770 from cli/wm/doc-unknown-step
Document UNKNOWN STEP in run view
2025-04-11 15:49:28 +02:00
William Martin
48274f3118 Document UNKNOWN STEP in run view 2025-04-11 15:23:18 +02:00
Babak K. Shandiz
b65286125b
Add $ anchor to log file regexps
Signed-off-by: Babak K. Shandiz <babakks@github.com>

This is to make sure we do not pick up the wrong file if there is a
`.txt` sequence in the middle of a job name.
2025-04-11 12:41:31 +01:00
Babak K. Shandiz
2d21b4624c
Test normal job run log is preferred over legacy one
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 12:40:26 +01:00
Babak K. Shandiz
940bd10a1d
Prefer normal job run log file over legacy one
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 12:39:09 +01:00
William Martin
83bd23b080
Merge pull request #10740 from cli/babakks/fallback-to-job-run-logs
Fallback to job run logs when step logs are missing
2025-04-11 11:39:07 +02:00
Babak K. Shandiz
5adf3285ec
Explain when a negative number prefix appears
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:26:14 +01:00
Babak K. Shandiz
d35236948c
Improve explanation for missing step logs
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:17:52 +01:00
Babak K. Shandiz
1bf1153c54
Explain the UNKNWON STEP placeholder
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 10:08:36 +01:00
Babak K. Shandiz
f673b409f7
Replace UNKNOWN with UNKNOWN STEP in job run log
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 09:57:13 +01:00
Babak K. Shandiz
0251a8dd6d
Explain why step logs are preferred
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-11 09:56:17 +01:00
Kynan Ware
dec71dd9e1
Merge pull request #10710 from cli/kw/first-pass-accessible-prompter
Introduce accessible prompter for screen readers (preview)
2025-04-10 17:28:26 -06:00
Kynan Ware
70537de132
test(prompter): fix invalid comment 2025-04-10 17:18:56 -06:00
Kynan Ware
8cd39923fe test(prompter): fix race condition
This test was trying to block on `expect`’ing a string at the same
time the prompt was completed.

This doesn't need to happen for this test. It should just check for
the output from the Input prompt invocation.
2025-04-10 17:09:22 -06:00
Andy Feller
b8cd094ca8 Ensure markdown confirm prompt shows editor name
Apparently, `gh` might not actually have an editor at the time we're prompting
the user if they want to use it for markdown editing.  In the survey package,
there is a function that will handle fallback to the default editor based on
environment variables and parse it in the case the editor contains flags and
arguments for cases like Visual Studio Code.

Additionally, there are no tests for the EditorName function and the fact it
is loaded via `init` makes this difficult to test.

Co-authored-by: Kynan Ware <47394200+BagToad@users.noreply.github.com>
2025-04-10 16:28:58 -06:00
Kynan Ware
20ff409bfc fix(prompter): remove needless default value assignment 2025-04-10 16:28:57 -06:00
Kynan Ware
9eee77a2bf test(prompter): doc how accessible prompter tests work 2025-04-10 10:55:24 -06:00
Kynan Ware
8b70870f4f test(prompter): describe why echo is editorcmd 2025-04-10 10:39:59 -06:00
Kynan Ware
47d603221d test(prompter): use *testing.T instead 2025-04-10 10:37:36 -06:00
Babak K. Shandiz
791e1af828
Add missing gc.AssertExpectations calls
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-10 14:09:49 +01:00
Babak K. Shandiz
f0d4acd501
Add tests for IsPinned method
Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-04-10 14:00:24 +01:00
William Martin
057ad52fdb
Merge pull request #10759 from cli/cosign-no-regex
Simplify cosign verification example by not using a regex.
2025-04-10 12:29:44 +02:00
Fredrik Skogman
512fac2dba
Simplify cosign verification example by not using a regex. 2025-04-10 08:39:12 +02:00
leudz
072534c388 Fix multi pages search for gh search 2025-04-10 07:57:43 +02:00
Kynan Ware
4615069773 chore: go mod tidy 2025-04-09 15:51:02 -06:00