tea comands for reviews #131

Closed
opened 2 years ago by 6543 · 8 comments
6543 commented 2 years ago
Collaborator

...

idears: tea pr lgtm

https://github.com/go-gitea/gitea/pull/11224 bring api for reviews - use them

... idears: `tea pr lgtm` https://github.com/go-gitea/gitea/pull/11224 bring api for reviews - use them
6543 added the
kind/feature
label 2 years ago
6543 added this to the v0.5.0 milestone 2 years ago
6543 modified the milestone from v0.5.0 to v0.6.0 2 years ago

I'll try it

I'll try it
Poster
Collaborator
@crapStone https://gitea.com/gitea/go-sdk/src/branch/master/gitea/pull_review.go has the func you need :)

...

idears: tea pr lgtm

https://github.com/go-gitea/gitea/pull/11224 bring api for reviews - use them

so you basically want to approve a pr?

> ... > > idears: `tea pr lgtm` > > https://github.com/go-gitea/gitea/pull/11224 bring api for reviews - use them so you basically want to approve a pr?
Poster
Collaborator

what do you think of:

tea pr lgtm as approve shortcut and tea pr review deny/accept/comment/reject(upcoming...) -text-

what do you think of: `tea pr lgtm` as approve shortcut and `tea pr review deny/accept/comment/reject(upcoming...) -text-`
6543 modified the milestone from v0.6.0 to v0.7.0 2 years ago
Collaborator

@6543 Whats the difference between deny and reject?

I propose

tea pr reject <idx> <comment>     # reject requires a comment
tea pr approve <idx> [<comment>]  # approve may have a comment
tea pr lgtm <idx>                 # alias to approve
tea pr review <idx>               # interactive mode asking for state & comment
@6543 Whats the difference between deny and reject? I propose ``` tea pr reject <idx> <comment> # reject requires a comment tea pr approve <idx> [<comment>] # approve may have a comment tea pr lgtm <idx> # alias to approve tea pr review <idx> # interactive mode asking for state & comment ```
Collaborator

An epic feature idea: Maybe we can pipe in a patch-mail and parse that into code comments? 🤔

So an input like

> diff --git a/cmd/comment.go b/cmd/comment.go
> new file mode 100644
> index 0000000..0ac7b55
> --- /dev/null
> +++ b/cmd/comment.go
> @@ -0,0 +1,56 @@
> +// Copyright 2020 The Gitea Authors. All rights reserved.

2020 is almost over my friend

> +// Use of this source code is governed by a MIT-style
> +// license that can be found in the LICENSE file.
> +
> +package cmd
> +
> +import (
> +       "fmt"
> +       "strings"

would translate to

c := CreatePullReviewComment {
	Path: "cmd/comment.go",
	Body: "2020 is almost over my friend",
	NewLineNum: 1,
}

if called via

cat foo.patch.review | tea pr review 300

If there is a golang git patch parser, this could actually be doable
edit: https://github.com/sourcegraph/go-diff might work

An epic feature idea: Maybe we can pipe in a [patch-mail](https://drewdevault.com/2018/07/02/Email-driven-git.html) and parse that into code comments? 🤔 So an input like ``` > diff --git a/cmd/comment.go b/cmd/comment.go > new file mode 100644 > index 0000000..0ac7b55 > --- /dev/null > +++ b/cmd/comment.go > @@ -0,0 +1,56 @@ > +// Copyright 2020 The Gitea Authors. All rights reserved. 2020 is almost over my friend > +// Use of this source code is governed by a MIT-style > +// license that can be found in the LICENSE file. > + > +package cmd > + > +import ( > + "fmt" > + "strings" ``` would translate to ``` c := CreatePullReviewComment { Path: "cmd/comment.go", Body: "2020 is almost over my friend", NewLineNum: 1, } ``` if called via ``` cat foo.patch.review | tea pr review 300 ``` If there is a golang git patch parser, this could actually be doable edit: https://github.com/sourcegraph/go-diff might work
Poster
Collaborator

@6543 Whats the difference between deny and reject?

I propose

tea pr reject <idx> <comment>     # reject requires a comment
tea pr approve <idx> [<comment>]  # approve may have a comment
tea pr lgtm <idx>                 # alias to approve
tea pr review <idx>               # interactive mode asking for state & comment

missing tea pr comment <idx> <comment> but I think this is it 👍

right I think review is the way to go, since comment indicate you append a comment onto this pull - a subcomand we should add if we show comments of issues/pulls ...

> @6543 Whats the difference between deny and reject? > > I propose > ``` > tea pr reject <idx> <comment> # reject requires a comment > tea pr approve <idx> [<comment>] # approve may have a comment > tea pr lgtm <idx> # alias to approve > tea pr review <idx> # interactive mode asking for state & comment > ``` ~~missing `tea pr comment <idx> <comment>` but I think this is it :+1:~~ right I think review is the way to go, since comment indicate you append a comment onto this pull - a subcomand we should add if we show comments of issues/pulls ...
Owner

@6543 Whats the difference between deny and reject?

I propose

tea pr reject <idx> <comment>     # reject requires a comment
tea pr approve <idx> [<comment>]  # approve may have a comment
tea pr lgtm <idx>                 # alias to approve
tea pr review <idx>               # interactive mode asking for state & comment

I like reject.

> @6543 Whats the difference between deny and reject? > > I propose > ``` > tea pr reject <idx> <comment> # reject requires a comment > tea pr approve <idx> [<comment>] # approve may have a comment > tea pr lgtm <idx> # alias to approve > tea pr review <idx> # interactive mode asking for state & comment > ``` I like reject.
noerw added the
status/has-pull
label 2 years ago
6543 closed this issue 2 years ago
Sign in to join this conversation.
Loading…
There is no content yet.