Conversation
|
The block of code i created on "pr.go" inside "func prClose" can go outside to a function "func prComment" or something like that, and this function can be reused and called by a single line on prClose (before closing the "PR"), or any place what need comments. |
|
Hey @gabgodbb I went through your PR:
And no, we don't have to make a test case for waiting for the user input. Also, please confirm with the official team, for the exact command name, working and flow, that we are aiming for. (Its always better and recommended to wait for their official acknowledgement, before starting some new feature/enhancement) |
@AliabbasMerchant i installed Visual studio, i was coding on single text Editor.. and installed goLang extension.. the lint errors give on code on code i didnt changed. i got a fresh git clone, and the lint give a lot of that warnings, basically the same warnings... can you help me about this? |
|
@gabgodbb Yes, there are warnings generated by the linter in VSCode. Ignore them. |
|
thank you for the reply @AliabbasMerchant I didnt use the survey because it use "nano". In CONTRIBUTING.md, it say: Please avoid:
Someone explain for me, is possible to use go tools, like all lints check, on my local system? i am using Visual Studio with golang extension. Thank you. |
|
Nano is a text editor that survey uses for some input. The whole of CLI uses survey for input/output. So, you do not need to worry about that. Yes, you can definitely run the linter locally. Although, I dont know how exactly to do that. |
|
@AliabbasMerchant on example, the pr close 2 and 3, will not to run, because it will be on #1 waiting for user input.... so i am think to create --comment on default... and create a --nocomment to dont ask for user input, and let bash commands continue without user interation... |
There was a problem hiding this comment.
Thanks for opening this @gabgodbb. I'd like this PR to focus on the comment for gh pr close and gh pr reopen for now. We're not ready to add gh pr comment yet and the extra focus will keep this PR more focused. Here are some requests before we merge this...
- Can you remove the
gh pr commentcommand for now? - Let's keep
gh pr closeandgh pr reopennon-interactive for now. So to add the comment they will both need a--commentflag.
| "errors" | ||
| "fmt" | ||
| "io" | ||
| "os" // used to input comment |
There was a problem hiding this comment.
It's ok to leave these uncommented
| "os" // used to input comment | |
| "os" |
| package command | ||
|
|
||
| import ( | ||
| "bufio" // used to input comment |
There was a problem hiding this comment.
| "bufio" // used to input comment | |
| "bufio" |
There was a problem hiding this comment.
i did all this fix on anoter new commit
| } | ||
|
|
||
| v4 := githubv4.NewClient(client.http) | ||
| err := v4.Mutate(context.Background(), &mutation, input, nil) |
There was a problem hiding this comment.
This is great, I'm glad you used the githubv4 pattern instead of our old string-based graphql pattern!
|
@probablycorey i removed the "gr pr addcomment" function and put that 2 suggested changes on the same commit.. thank you for review |
|
Thanks @gabgodbb, it looks like there are a few more issues.
I also modified the api function a bit. I changed it to |
|
Cool... Thank you for reviewing |
I Believe is not a good practice sending comment via "parm" and we will get some issues if comment is sent by "--comment parm" while in text having quotes and/or double quotes , anothers special characters and some system variables.. like, PATH and password AND $USER, etc. " --comment "This code must pass on ""; go test ../...; "please run tests The command "go test" will be EXECUTED, on system.. the danger of this if is a command to remove ( "rm" ) or print some variable or executing any code user is pasting or typing.. |
@gabgodbb I see your point and I agree. However, when we enable adding comment via a person's text editor or from standard input, for example, we want to do that in the future and as a separate changeset from this one. So right now, let's just support the optional |
|
@probablycorey i make a new resolution about this, for learning, and it is more simple... just using --coment args, can i close this pr and open a new fresh one? |
|
@gabgodbb For sure, go right ahead! In the future, you can also "reset" your PR by force-pushing entirely different commits to its head branch. That's how I undo my changes if it turns out I have been heading in the wrong direction. |
|
Creating a new PR with --comment option |
done pr #1395, can you check if i deleted my old branch, "Including_pr_Close" |
Summary
closes #1038
Details
This patch include comments on
pr close. The solution can apply topr reopenor anyprcommands what need comments.