Commit graph

92 commits

Author SHA1 Message Date
Luke Karrys
c847e935f1
pr create --body-file can read from stdin (#5461) 2022-04-14 06:32:26 +00:00
Christopher Nethercott
933a91e18e
Add "new" alias to "create" commands (#5388)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-11 16:48:34 +02:00
Daniel Le
24ba3540b7 generateCompareURL uses url.PathEscape instead of url.QueryEscape
For ctx.{BaseBranch,HeadBranchLabel}.
2022-03-30 13:01:24 +08: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
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ć
90ec1089ef Port pr create tests to the new ask stubber 2022-01-12 23:57:19 +01:00
nate smith
562f1b3d0d add GetOrDefault functionality to config 2022-01-11 14:56:58 -06:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Mislav Marohnić
606deaf134 Allow setting empty body via editor in issue/pr create 2021-06-04 21:50:51 +02:00
Mislav Marohnić
bc3bb97c43 Merge remote-tracking branch 'origin' into pr-lookup-refactor 2021-05-17 17:41:38 +02:00
Mislav Marohnić
3cbd5b4934
Add repo fork --org functionality (#3611)
Co-authored-by: Gowtham Munukutla <gowtham.m81197@gmail.com>
2021-05-10 17:09:03 +02:00
Mislav Marohnić
c50d390cf5 Fix tests 2021-05-07 22:09:58 +02:00
Cristian Dominguez
2f94adabb2
Use T.TempDir for temporary dirs in tests (#3580) 2021-05-07 12:21:26 +02:00
Mislav Marohnić
9bdc63c4ca Eliminate API overfetching in pr commands
This completely rewrites the PR lookup mechanism so that the caller
must specify the GraphQL fields to query for each PR. Additionally, this
fixes some export problems with `pr view --json`.

Features:

- Each pr command now gets assigned a concept of a Finder. This makes it
  easier to stub the PR in tests without having to stub the underlying
  HTTP calls or git invocations.

- `pr view --web` is much faster since it only fetches the "url" field.

- `pr diff 123` now skips a whole API call where a whole PR was
  unnecessarily preloaded just to access its diff in a subsequent call.

- PullRequestGraphQL query builder is now used to construct queries.

- A bunch of individual commands are now freed of having to know about
  concepts such as BaseRepo, Branch, Config, or Remotes.
2021-04-30 20:34:36 +02:00
Sasha Gerrand
f70bdcf982
Corrects a typo in pr create docs 2021-04-27 11:57:42 +01:00
Mislav Marohnić
57536e7b0d 💅 cleanup URL length checking 2021-03-30 19:12:31 +02:00
Cristian Dominguez
fb39c38c85 Disable preview option in prompts if URL size is too long 2021-03-30 19:12:31 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Mislav Marohnić
e96d974331
Merge pull request #3023 from cli/cancel-error-status
Issue/pr create: exit with nonzero status code when "Cancel" was chosen
2021-03-04 13:45:11 +01:00
Mislav Marohnić
2ebdde1ddd Exit with status code "2" on user cancellation errors
This also stops printing "interrupt" after Ctrl-C is pressed.
2021-03-02 13:48:44 +01:00
Mislav Marohnić
3efa764305 Avoid the issue/pr recovery mechanism handling Ctrl-C keypress in prompts
Either InterruptErr or SilentErr will be present when the user has
chosen "Cancel" or pressed Ctrl-C in prompts. We don't want the recovery
mechanism to kick in these cases because the cancellation was likely
willingly initiated by the user.
2021-02-23 20:09:03 +01:00
Mislav Marohnić
fff051468e Avoid triggering recovery mechanism when cancelling issue/pr create 2021-02-23 19:42:41 +01:00
Mislav Marohnić
b0b90afa87 issue/pr create: exit with nonzero status code when "Cancel" was chosen
This is to indicate that the command had not finished successfully.
2021-02-23 17:06:29 +01:00
Mislav Marohnić
fee7adf9ba Add issue create -F <file> flag and tests 2021-02-23 14:25:32 +01:00
castaneai
13c3c6543b Add pr create --body-file flag 2021-02-23 12:58:34 +01:00
Mislav Marohnić
83bb1bfd9d Port pr create to new templates implementation 2021-02-10 18:20:57 +01:00
Mislav Marohnić
47baf8fb10 pr create: explain how to link an issue 2021-02-03 22:17:31 +01:00
Mislav Marohnić
8cba14b564 💅 cleanup command stub assertions 2021-01-25 13:13:36 +01:00
Devon Romanko
e39c9d8f9f remove new uses of InitCmdStubber after rebase 2021-01-23 08:31:49 -05:00
Devon Romanko
ac5bfc09b8 remove use of deprecated InitCmdStubber 2021-01-23 08:22:11 -05:00
AliabbasMerchant
1c54db4919 fix: Project Argument working along with --web flag 2021-01-22 23:07:00 +01:00
Mislav Marohnić
e334a1f10c Add docs for using @me to reference self 2021-01-22 22:14:47 +01:00
Mislav Marohnić
73da25a96d Use concrete type instead of an interface to avoid forced casting 2021-01-22 22:05:33 +01:00
Mislav Marohnić
28c2d042e7 Extend @me replacing behavior to issue list 2021-01-22 22:05:33 +01:00
Mislav Marohnić
06cf2c9f81 Merge remote-tracking branch 'origin' into cmd-stub-new 2021-01-22 16:31:29 +01:00
Nate Smith
d25938e223
Merge pull request #2808 from KarelCoudijzer/fork-hang
Show progress while creating a new pull request
2021-01-21 14:54:15 -08:00
vilmibm
05d39ebd0d remove garbling spinner
one of the three new spinners produced less than ideal output when a
push happened; the other two do enhance the create experience and i
think we can get away without one for push.
2021-01-21 14:53:19 -08:00
Björn Heinrichs
c9f79271b1
Add --maintainer-edit flag (#2250)
* Add --maintainer-edit flag

Closes #2213 while retaining backwards compatibility.

* Fix linting

* Adjust documentation and validation

* Negate logic and fix build errors

* rename to no-maintainer-edit

* test

* use a positive option instead of negative

Co-authored-by: vilmibm <vilmibm@github.com>
2021-01-20 14:51:27 -08:00
Karel Coudijzer
a7b9e3916c Show progress while creating pr 2021-01-19 22:19:10 +01:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Cristian Dominguez
45f4a1f087 Equal: flip arguments position 2021-01-18 21:00:59 -03:00
Mislav Marohnić
c308f1cd91 Prevent further use of SetPrepareCmd and InitCmdStubber 2021-01-18 22:44:53 +01:00
Cristian Dominguez
3afb1d0b1a Use Testify assertions in test 2021-01-16 19:19:30 -03:00
Cristian Dominguez
ce151420f3 Migrate legacy tests 2021-01-11 21:07:19 -03:00
Mislav Marohnić
f4152454f2
Merge pull request #2472 from cristiand391/preserve-metadata-state
Prompt: avoid resetting PR/issue metadata
2020-12-03 18:51:29 +01:00
Mislav Marohnić
8db2027c99 Allow interactive pr create even if we failed to look up commits 2020-12-03 18:02:24 +01:00
Mislav Marohnić
be39f4363b Make MetadataSurvey testable by accepting an interface 2020-12-03 17:47:40 +01:00
Mislav Marohnić
8e1f736775
Merge pull request #2519 from cli/issue-create-browser-fix
Fix respecting chosen action in interactive `issue create`
2020-12-02 13:02:16 +01:00