mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
feat(issue): gh-style issue list, view, create, edit, close and reopen
issue list renders through the shared table: a context line, ID TITLE LABELS [STATE] [KIND] AUTHOR UPDATED with relative times on a terminal, the ID colored by state and linked, and a stable tab-separated column set when piped; empty results say so on stderr. It gains -s -L -l -a -A -m -S -w, @me, comma-separated label and milestone filters, and --web. issue view, edit, close and reopen accept #N, OWNER/REPO#N and issue URLs. Mutations report "✓ Created/Edited/Closed issue alice/x#5 (title)" on a terminal; issue create prints the new issue's URL on stdout (also as issue new), and close and reopen skip issues already in that state with a ! line and take -c/--comment. issue create and edit gain the gh short flags and singular --add-label, --remove-label, --add-assignee and --remove-assignee (the plural names still work), and create gains --web. The interactive create form asks for the title and body, then "What's next?" (submit, add metadata or cancel), without a confirmation after it; the edit form names the issue it edits. Every issue command has help text with examples and completes its flags and issue numbers. Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
18 files changed
+789
-376
No files matched your search
@@ -200,7 +200,7 @@ func TestRawJSONCommandsKeepJQToThemselves(t *testing.T) {
|
||||
func TestUnknownFlagsSuggestSimilarFlags(t *testing.T) {
|
||||
requireUsageBeforeRequests(t, "unknown flag: --lable; did you mean --label?", "issue", "list", "--lable", "bug")
|
||||
requireUsageBeforeRequests(t, "unknown flag: --stat; did you mean --state?", "issue", "list", "--stat", "open")
|
||||
requireUsageBeforeRequests(t, "unknown flag: --add-label; did you mean --add-labels?", "issue", "edit", "1", "--add-label", "bug")
|
||||
requireUsageBeforeRequests(t, "unknown flag: --add-lable; did you mean --add-label?", "issue", "edit", "1", "--add-lable", "bug")
|
||||
deps, _, _ := testDeps(t)
|
||||
err := Execute(context.Background(), deps, []string{"issue", "list", "--zzzzzz"})
|
||||
require.Equal(t, clierr.Usage, clierr.ExitCode(err))
|
||||
@@ -251,7 +251,7 @@ func TestCommandHelpShowsRelevantFlagsOnly(t *testing.T) {
|
||||
for _, want := range []string{
|
||||
"\nUSAGE\n tea issue list [flags]\n",
|
||||
"\nALIASES\n tea issue ls\n",
|
||||
"\nFLAGS\n --assignee string ",
|
||||
"\nFLAGS\n -a, --assignee string ",
|
||||
"\nINHERITED FLAGS\n -R, --repo OWNER/REPO ",
|
||||
"\n --json fields ",
|
||||
"\n -q, --jq expression ",
|
||||
@@ -323,7 +323,7 @@ func TestHelpTopicsAndUnknownTopics(t *testing.T) {
|
||||
values, _ := complete(t, deps, out, "help", "e")
|
||||
require.Equal(t, []string{"environment\tEnvironment variables and global flags", "exit-codes\tExit codes used by tea"}, values)
|
||||
values, _ = complete(t, deps, out, "help", "issue", "l")
|
||||
require.Equal(t, []string{"list\tList repository issues"}, values)
|
||||
require.Equal(t, []string{"list\tList issues in a repository"}, values)
|
||||
}
|
||||
|
||||
func TestVerbAndFlagAliases(t *testing.T) {
|
||||
@@ -424,17 +424,11 @@ const (
|
||||
issue attachment list
|
||||
issue attachment upload
|
||||
issue attachment view
|
||||
issue close
|
||||
issue comment create
|
||||
issue comment delete
|
||||
issue comment edit
|
||||
issue comment list
|
||||
issue comment view
|
||||
issue create
|
||||
issue edit
|
||||
issue list
|
||||
issue reopen
|
||||
issue view
|
||||
label create
|
||||
label delete
|
||||
label edit
|
||||
@@ -469,7 +463,6 @@ const (
|
||||
time reset
|
||||
`
|
||||
longsToWrite = `
|
||||
issue
|
||||
issue attachment
|
||||
issue comment
|
||||
label
|
||||
|
||||
Reference in new issue
Block a user