Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comment on pull requests #2776

Merged
merged 2 commits into from Jan 21, 2021
Merged

Comment on pull requests #2776

merged 2 commits into from Jan 21, 2021

Conversation

samcoe
Copy link
Contributor

@samcoe samcoe commented Jan 13, 2021

This PR allows for commenting on pull requests. The commenting code for issues and pull requests was very similar so I refactored to extract the commentable.go file which contains the shared functionality.

Additionally after talking with @ampinsk we decided that the initial input type survey was not serving much of a purpose and we decided to replace it with the standard editor survey that prompts the user to open their editor.

closes #517

@samcoe samcoe self-assigned this Jan 13, 2021
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a chance we could reuse the same code, since everything is identical about leaving a comment to an issue vs. the PR?

I worry that this might not be just incidental duplication: we might need to maintain the commenting code, and it might be tricky to remember to duplicate all changes in two places, especially for outside contributors.

@samcoe
Copy link
Contributor Author

samcoe commented Jan 14, 2021

@mislav I went ahead and refactored this to clean up the duplicate code and hopefully make it easier to maintain both comment commands in the future. It seemed like there were a couple different ways to go about this refactor so let me know if you had any other thoughts on it 🙇

@samcoe samcoe requested a review from vilmibm January 14, 2021 21:04
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Love it how you reused most commenting code between issues and PRs by defining a Commentable interface.

My last nit is about the prompt to open the editor. Everything else is 💎💎

pkg/cmd/pr/comment/comment.go Show resolved Hide resolved
pkg/cmd/pr/shared/commentable.go Outdated Show resolved Hide resolved
pkg/cmd/pr/shared/commentable.go Outdated Show resolved Hide resolved
pkg/cmd/pr/comment/comment.go Show resolved Hide resolved
@samcoe samcoe requested a review from mislav January 19, 2021 21:07
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good. Thank you for the hard work!

samcoe and others added 2 commits January 21, 2021 09:47
- "Press Enter" is both bold
- "Enter" is capitalized
- The prompt ends with "..."
@samcoe samcoe merged commit 948088a into trunk Jan 21, 2021
@samcoe samcoe deleted the pr-comments branch January 21, 2021 17:55
@Louisianaanimal

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comment on issues and pull requests from gh
4 participants