Commit graph

384 commits

Author SHA1 Message Date
Yuki Hirasawa
4f0264e37b
spelling: possible (#5157) 2022-02-02 16:54:09 +01:00
Mislav Marohnić
4a3ef50d2d
Standardize pager output across commands (#5141)
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view

Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
2022-02-01 08:36:51 +01:00
Kevin Lee
0d143ca89c
Consistent punctuation in command usages (#5139)
* Fix spelling and grammatical errors in command docs
* Add periods for consistency across the long command descriptions
* Format imports
2022-01-31 10:56:12 +00:00
Sam Coe
f0b60e3530
Add non-local PR template support (#5097)
* Add non-local PR template support

* Consolidate template support functions

* Change back query name
2022-01-29 07:41:24 +00:00
Nate Smith
3a088e4df5
Merge pull request #5069 from hirasawayuki/fix-pr-checks-cmd
Fix duplicates check results returned by `gh pr checks`
2022-01-26 16:46:32 -06:00
Sam Coe
603502febf
Allow PR create to create PRs with numerical branch names (#5090) 2022-01-25 07:22:28 +02:00
Des Preston
2e07d0f32c
pr status: show number of approvals (#4240)
If the base branch has no minimum approval requirements, show "N Approved"
reviews. Otherwise, show "N/X Approved".

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-01-21 15:58:15 +00:00
hirasawayuki
b0fd9c6f04 Fix duplicates check results returned by gh pr checks 2022-01-21 00:02:42 +09:00
Nate Smith
4b415f80d7
Merge pull request #5022 from cli/config-defaults
add GetOrDefault and related methods to Config
2022-01-17 10:44:28 -06:00
Mislav Marohnić
44775f87c8 Add nolint directives to allow-list current lint violations 2022-01-14 19:52:52 +01:00
Mislav Marohnić
a33b5a55c4 Have NewAskStubber perform auto-cleanup 2022-01-14 18:52:00 +01:00
Mislav Marohnić
30c5ef23ee Merge remote-tracking branch 'origin' into ask-stubber 2022-01-14 17:41:08 +01:00
Mislav Marohnić
456d55ead9 Have a single Render function handle all Markdown rendering 2022-01-13 19:39:43 +01:00
Mislav Marohnić
c839d3ba1d Check for unused ask stubs at the end of the test 2022-01-13 12:23:42 +01:00
Mislav Marohnić
90ec1089ef Port pr create tests to the new ask stubber 2022-01-12 23:57:19 +01:00
Mislav Marohnić
3c443efbed Improve Survey prompt stubber for tests
Both SurveyAsk and SurveyAskOne methods now share the same sets of
stubs, making it possible to change which of these methods is used in
the implementation without breaking tests.

A new method `AskStubber.StubPrompt("<prompt>")` is added as test helper
to supersede old Stub and StubOne methods. The new helper matches on
prompt messages rather than on field names, enabling tests to be written
based on what the user would see rather than coupling to implementation
details.

The new stubber also allows verifying whether a Select or MultiSelect
was rendered with the expected set of options. Furthermore, if a stubbed
value is not present among those options, the stubber will panic instead
of continuing normally.

Stubbed Selects with an int instead of a string target receiver are now
transparently handled. The values for Select stubs are always strings in
tests, but the stubber will write an int answer if the receiver expects
one as a selected index instead of a selected string value.

Lastly, this set of changes improves test resiliency since the stubs are
now matched based on prompt message (or field name for legacy stubs
created with Stub) instead of sequentially, enabling the implementation
to reorder the prompts without breaking existing tests.
2022-01-12 23:51:21 +01:00
Carl Tablante
ad8d7bb02e
#4386 Display a user's name in metadata survey for assignees and reviewers (#4420)
Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-12 08:52:22 +00:00
nate smith
562f1b3d0d add GetOrDefault functionality to config 2022-01-11 14:56:58 -06:00
Ayush Rawal
ca25026613
Avoid showing non-open PRs on the default branch (#4285)
Co-authored-by: Andrew Hsu <xuzuan@gmail.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-20 18:46:12 +00:00
Cristian Dominguez
f2d23d8c88
Allow editing commit subject when squash-merging a PR (#3344)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-20 18:25:17 +00:00
Mislav Marohnić
db50b54513 Simplify GraphQL mutations whose response we are not interested in 2021-12-08 13:35:19 +01:00
Des Preston
886f5e0e78 Avoid race condition when updating labels
Update labels using the `addLabelsToLabelable` and
`removeLabelsFromLabelable` mutations instead of via the `updateIssue`
mutation that replaces the entire set of labels. This prevents the edit
operation from clobbering any unseen changes to the list of labels.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-08 13:29:47 +01:00
Tomohiro Nishimura
a9d397be69
Add --generate-notes flag to gh release create command. (#4467) 2021-12-08 15:20:59 +04:00
Mislav Marohnić
c33eb3bee1 pr diff: support very long lines 2021-12-01 17:03:11 +01:00
Mislav Marohnić
4a6aa0e938 pr diff: respect global NO_COLOR/CLICOLOR_FORCE settings
In the absence of an explicit `--color` setting, or when `--color=auto`
is passed, the pr diff command should fall back to respecting the global
colorization setting as inferred from the environment.
2021-12-01 17:03:11 +01:00
Parth
c987c5711d
pr merge: pull after switching branches (#4748) 2021-11-29 18:26:35 +01:00
Parth
39bd9aafdc
pr merge: allow deleting remote branch if local branch does not exist (#4769) 2021-11-24 16:50:25 +01:00
Mislav Marohnić
c8d5a6be02 Accept pull requests in issue edit argument 2021-11-23 20:39:19 +01:00
Mislav Marohnić
f99a149eb2 Improve issue reopen re: overfetching, handling PRs
- `issue reopen` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue reopen` now accepts either issue or pull number as argument.
2021-11-23 19:39:40 +01:00
Mislav Marohnić
07cad386a5 Improve issue close re: overfetching, handling PRs
- `issue close` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue close` now accepts either issue or pull number as argument.
2021-11-23 19:38:55 +01:00
Sam Coe
260716a9f8
Repace shurcool/graphql with cli/shurcool-graphql 2021-11-17 12:57:43 -08:00
Alan Donovan
2f7f224c9e
Merge pull request #4584 from cli/FlagErrorf
Add FlagErrorf; encapsulate FlagError.error
2021-10-21 14:14:05 -04:00
Jose Garcia
bbea5ac95e
codespace: progress indication, logging (#4555)
* Rework logging, showing progress, and printing from `codespace` commands
* Change rendering of the general progress indicator so that it's visible on both dark and light backgrounds
* The progress indicator now "spins" faster

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-10-21 18:04:04 +02:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
stdtom
9468e9e7df
Fix copy/paste mistake in docs 2021-10-21 12:34:20 +02:00
Mislav Marohnić
f6b33572fd
Merge pull request #4279 from SiarheiFedartsou/sf-pr-list-head-filter
Add `--head` filter to `gh pr list`
2021-10-14 20:54:56 +02:00
Mislav Marohnić
e4c8aa3b2b Add tests for pr diff --patch 2021-10-08 13:53:19 +02:00
Adarsh K Kumar
e0897fd8e8 #2720 | Add patch flag to pull-request diff command 2021-10-07 23:09:21 +05:30
Mislav Marohnić
c4ec0a65ba
Merge pull request #4363 from RasmusWL/patch-1
Also set `pushRemote` on `gh pr checkout` from fork
2021-09-30 12:01:47 +02:00
Nate Smith
425bc64859
Merge pull request #4090 from bchadwic/pr-checks
Revised pending and skipped symbols for pr checks / run commands
2021-09-27 09:25:21 -07:00
Reto Hablützel
f6e9734f17 add more hints to docs 2021-09-25 08:38:26 +02:00
Rasmus Wriedt Larsen
9e3893e104 Also set pushRemote on gh pr checkout from fork
As explained in https://git-scm.com/docs/git-config#Documentation/git-config.txt-branchltnamegtremote
if you have `remote.pushDefault` set in your global gitconfig (like I
do), then _that_ setting will take precedence over
`branch.<name>.remote` 😞

However, `branch.<name>.pushRemote` will take precedence over your
`remote.pushDefault` setting, such that
`gh pr checkout 123 && make changes && git push` will just work, even if
you have `remote.pushDefault` set 💪
2021-09-24 16:38:25 +00:00
Sam
02ed5a9666
Merge pull request #4316 from SiarheiFedartsou/sf-pulls-draft
Add `--draft` and `--non-draft` filters to `gh pr list`
2021-09-20 12:07:52 -07:00
Sam Coe
d14715f1e3
Convert bool to string early for pr list draft flag 2021-09-20 11:29:37 -07:00
Siarhei Fedartsou
6a34f53c6c Change pr list --draft UX 2021-09-17 22:05:47 +03:00
Siarhei Fedartsou
1926971a76 Remove non-relevant test 2021-09-12 21:04:03 +03:00
Siarhei Fedartsou
f3053c3628 fix tests 2021-09-12 20:58:13 +03:00
Siarhei Fedartsou
373d1efb58 format code 2021-09-12 20:50:21 +03:00
Siarhei Fedartsou
11466fda12 Add --draft and --non-draft filters to gh pr list 2021-09-12 20:48:23 +03:00
Mislav Marohnić
619333adb6 Avoid using error values to pass information about the search cap 2021-09-06 16:09:18 +02:00