Commit graph

15 commits

Author SHA1 Message Date
Sinan Sonmez (Chaush)
0a1e7a1fdc
Add --delete-last option to pr comment and issue comment (#10596)
* deletion for issues with confirmation flag

* add handling for interaction case

* finish implementation for issues

* finish the implementation for issues

* finalize the implementation for PR

* fix missing --yes flag for PR

* address PR comments related to feedbacks

* improve CommentablePreRun for pre checks

* improve confirmation prompt and truncate long comment body

* address PR comments on tests

* Truncate comment for confirmation prompt

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Improve test case descriptions

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Fix mock comment body

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Remove irrelevant prompt stub

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Use `opts.Interactive` as TTY indicator

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Fix expected `Interactive` value

Signed-off-by: Babak K. Shandiz <babakks@github.com>

* Polish `TestNewCmdComment`

Signed-off-by: Babak K. Shandiz <babakks@github.com>

---------

Signed-off-by: Babak K. Shandiz <babakks@github.com>
Co-authored-by: Babak K. Shandiz <babakks@github.com>
2025-05-01 14:12:55 +01:00
latzskim
e516e5ed5d [gh issue/pr comment] Create a comment if no comment already 2025-02-12 21:04:22 +01:00
vilmibm
42c017b887 use Prompter in Commentable 2022-10-19 13:05:00 -07:00
Seito Tanaka
e523d50176
Add support for editing last issue/pr comment (#6384) 2022-10-18 08:10:12 +00:00
Mislav Marohnić
57f49d9f8a issue/pr comment: improve docs as it relates to editor 2022-02-18 18:38:44 +01:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Reto Hablützel
f6e9734f17 add more hints to docs 2021-09-25 08:38:26 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +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
Cristian Dominguez
8a0d5b0e43 Add note about current branch detection 2021-04-13 12:30:07 -03: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ć
d5fb817dfc Remove unnecessary BodyFile field 2021-03-15 15:12:41 +01:00
Cristian Dominguez
8bfe64d593 Accept --body-file flag if --body is supported 2021-03-15 15:12:41 +01:00
Sam Coe
9d062ed8fc
Normalize pr command arguments 2021-02-23 09:17:35 -08:00
Sam Coe
a26fba7800
Comment on pull requests 2021-01-21 09:47:38 -08:00