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
bec527d49e Clean up pr/issue comment test names 2025-03-18 16:14:14 -04:00
Andy Feller
a47651df43 Bring issue/PR comment tests up to par, correct
This commit brings the `gh issue comment` and `gh pr comment` tests in line with one another while also addressing some corner cases that weren't previously tested.
2025-03-18 15:56:25 -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
e516e5ed5d [gh issue/pr comment] Create a comment if no comment already 2025-02-12 21:04:22 +01:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
Mislav Marohnić
8d82a96349
Fix fetching issue/PR comments
The "Author" struct was too overloaded in different types of queries that treat struct fields in incompatible ways. This change defines a simpler CommentAuthor struct for use in comments until we can figure out how to query `... on User` information for comments too.
2022-12-23 17:14:06 +01:00
Seito Tanaka
e523d50176
Add support for editing last issue/pr comment (#6384) 2022-10-18 08:10:12 +00:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Mislav Marohnić
1eb790cacd Improve issue comment re: overfetching, handling PRs
- `issue comment` no longer fetches all issue fields and thus avoids the
  problem when loading failed due to token not having access to projects

- `issue comment` now accepts either issue or pull number as argument.
2021-11-23 16:40:14 +01:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +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
Cristian Dominguez
8bfe64d593 Accept --body-file flag if --body is supported 2021-03-15 15:12:41 +01:00
Sam Coe
a26fba7800
Comment on pull requests 2021-01-21 09:47:38 -08:00
Sam Coe
723e9e31ba
Address PR comments 2021-01-11 13:56:17 -08:00
Sam Coe
155507d31d
Make comment command easier to test 2021-01-05 15:14:25 -08:00
Sam Coe
1fc8b66b26
Address PR comments 2021-01-05 10:36:03 -08:00
Sam Coe
f862123071
Modify issue commenting to adhere to designs and add tests 2021-01-05 10:35:09 -08:00
Yuki Osaki
8ef2bb4d14
Comment on issues from editor 2021-01-05 10:35:09 -08:00