Commit graph

20 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
Andy Feller
bbb8213e9c Refactor commentable logic 2025-03-19 07:56:53 -04:00
Andy Feller
018b6d6d07 Initial pass fixing gh issue and gh pr comment
There is still a bit of work to get the gh pr comment tests in order, however this goes a way towards fixing the issue along with acceptance tests.

Also, it turns out some of the issue acceptance tests were really running `pr` tests.
2025-03-17 23:18:36 -04:00
latzskim
26414865c4 Address pr comments 2025-02-19 16:56:23 +01:00
latzskim
e516e5ed5d [gh issue/pr comment] Create a comment if no comment already 2025-02-12 21:04:22 +01:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02: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
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Mislav Marohnić
5986f88565 issue comment: support quotes and arguments in EDITOR value
The `issue comment` command would perform a `filepath.Base()` on the
value of EDITOR and use the result for launching the editor, which is
undesireable for both functional and display purposes:

- For functional purposes, always shellsplit the value of GH_EDITOR or
  EDITOR before we shell out to that process;
- For display purposes, extract the basename only after shellsplitting.
2022-04-29 18:05:39 +02:00
Sam Coe
6fa8e4299c
Add ability to comment on close/reopen of issues/pull requests (#5437) 2022-04-11 17:06:35 +02:00
Mislav Marohnić
0f1aaae57c issue/pr comment: allow using editor in non-interactive mode
The user should be able to `gh config set prompt disabled` and still be
allowed to use `gh issue comment --editor`.
2022-02-18 18:38:55 +01:00
Mislav Marohnić
57f49d9f8a issue/pr comment: improve docs as it relates to editor 2022-02-18 18:38:44 +01:00
Tomohiro Nishimura
a9d397be69
Add --generate-notes flag to gh release create command. (#4467) 2021-12-08 15:20:59 +04: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ć
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
Mislav Marohnić
a70b69e359
Bring the "Press Enter" UI closer to the authentication experience
- "Press Enter" is both bold
- "Enter" is capitalized
- The prompt ends with "..."
2021-01-21 09:47:38 -08:00
Sam Coe
a26fba7800
Comment on pull requests 2021-01-21 09:47:38 -08:00