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

323 pulling request code review comment via GitHub rest api #330

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

crepesAlot
Copy link
Collaborator

Using the REST API to download review comments from Pull Requests using the GET /repos/{owner}/{repo}/pulls/comments endpoint.

- Added `create_file_directory` function
- Added `create_file_path` helper function
- Added @export to functions
- Added some more detail to function description
- Added discussion filepath under github issue tracker
- Updated `vignetts/download_github_comments.Rmd`
- Added pull request comments to parse_github_replies function to `R/github.R`
- Added new getter function to `R/config.R`
- Updated configuration files with new file paths to save data from new endpoint
@crepesAlot crepesAlot linked an issue Dec 5, 2024 that may be closed by this pull request
4 tasks
Copy link
Collaborator

@RavenMarQ RavenMarQ left a comment

Choose a reason for hiding this comment

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

A review of the 12/4/2024 edition of the download_github_comment.Rmd

@@ -12,10 +12,19 @@ vignette: >

# Introduction


In this Vignette, we show how to download GitHub comments from both Issue and Pull Requests. This data may be useful if development communication occurs through issues or pull requests in GitHub in addition or instead of mailing lists. For details on how to merge various communication sources, see the `reply_communication_showcase.Rmd` notebook. The parsed communication table from GitHub comments by `parse_github_comments` has the same format as the mailing list and JIRA comments tables. In turn, the function expects as input the table generated at the end of this notebook.
Copy link
Collaborator

Choose a reason for hiding this comment

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

"This data may be useful if development communication occurs through issues or pull requests in GitHub in addition or instead of mailing lists"

is not a well-worded or clear sentence. If I am understanding it correctly, maybe something along the lines of:

Downloading comments may be useful if communication during development occurs through issue or pull requests in addition, or in lieu of, mailing lists.

Clarifying ideas you're attempting to convey, especially with all of these nouns in one sentence, by elaborating terms like "development communication" to something understandable, rewording "addition or instead of" helps, or even what "data" is (in this case comments). This applies to all explanations, pretend as if the user has little-to-no knowledge of the functionality and terminology. In this case, throughout the notebook, possibly think of changing "development communication" to the self-explanatory "communication during development", or just explicitly explain it. The reason I say this is because my tired brain read "development communication" as "communication that's developing", and we need to find less ways to confuse our users.

Also, please show us or put a sample block of the expected parsed communication table or the expected input table- we want to reduce the amount of notebook jumping as much as possible

vignettes/download_github_comments.Rmd Show resolved Hide resolved
vignettes/download_github_comments.Rmd Show resolved Hide resolved
vignettes/download_github_comments.Rmd Show resolved Hide resolved
@@ -125,7 +131,6 @@ all_issue_files <- lapply(list.files(save_path_issue_refresh, full.names = TRUE)
# Parse each JSON file using the refresh parser
all_issue <- lapply(all_issue_files, github_parse_search_issues_refresh)


# Combine all the data tables
all_issues_combined <- rbindlist(all_issue, fill = TRUE)

Copy link
Collaborator

Choose a reason for hiding this comment

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

For "Issues by Customized Queries", can you explain what parameters they can change? Why or when they would use such a function?

@@ -218,9 +222,9 @@ head(all_issues_combined) %>%

The Refresh parser also parses issue data but the folder 'refresh_issues', parsing data retrieved from the search endpoint. In this notebook, that is data from the REFRESH issues portion saved to issue_search directory.
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is that first sentence trying to convey? The two parts seemingly don't correlate?

  1. The Refresh parser also parses issue data but the folder 'refresh_issues'
  2. Parsing data retrieved from the search endpoint
    Neither of these make sense alone, nor together. Unless the second is describing 'refresh_issues', it still does not make sense EVEN if we ignore it.

Also, do not meta-refer to the notebook like in "REFRESH issues portion". Find some way to say that the data retrieved from the ran functions is saved to issue_search directory.

vignettes/download_github_comments.Rmd Show resolved Hide resolved
vignettes/download_github_comments.Rmd Show resolved Hide resolved
@RavenMarQ
Copy link
Collaborator

You should also tell users if they which type(s) of GitHub tokens they can use, as well as the permissions they need to run the notebook- it should be explicitly explained so the users do not need do much other than consult the notebook.

Copy link
Collaborator

@daomcgill daomcgill left a comment

Choose a reason for hiding this comment

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

@crepesAlot I was able to run through your notebook. I made some comments, but overall it looks good. I was able to understand what the notebook is about, and how to use it. The biggest issue I ran into was the github token file in the config part.

vignettes/download_github_comments.Rmd Show resolved Hide resolved
vignettes/download_github_comments.Rmd Show resolved Hide resolved
vignettes/download_github_comments.Rmd Show resolved Hide resolved
@carlosparadis
Copy link
Member

@daomcgill can you mark "request changes" as part of your review process here?

@carlosparadis
Copy link
Member

@RavenMarQ same for you Raven, just so it is easier to know the status of your revisions. Appreciate if you could ask the others to do the same on the other PRs so it is more clear you reviewed each other's PR

@daomcgill
Copy link
Collaborator

@carlosparadis should I repost the review to do this?

@carlosparadis
Copy link
Member

@daomcgill No need to duplicate the comments, I would just click on the green review button for the pop-up and mark request for changes with a note "see comments posted in line for the PR Discussions". Please share with the group to do the same, it will be very confusing if the comments are re-added. Thank you for asking!

@carlosparadis
Copy link
Member

*In the PR Conversation tab, not discussion sorry

Copy link
Collaborator

@daomcgill daomcgill left a comment

Choose a reason for hiding this comment

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

see comments posted in line for the PR Discussions

@carlosparadis
Copy link
Member

@daomcgill this is perfect Dao, thank you. The review requests gets hyperlink towards the end so that makes easier to find what is pending. I should have asked everyone to do the reviews as a group instead of comment so they were all grouped together but it is still fine like this. Once the changes are done, and you and Raven agree, you can both change to Accept.

@RavenMarQ please do the same as Dao did with the request for changes and whichever other PRs you reviewed. Thank you!

@@ -12,10 +12,19 @@ vignette: >

# Introduction
Copy link
Collaborator

Choose a reason for hiding this comment

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

see comments posted in line for the PR Discussions

@carlosparadis carlosparadis changed the title 323 pulling request comment via GitHub rest api 323 pulling request code review comment via GitHub rest api Dec 9, 2024
- Updated notebook to include section on where to place created tokens to use endpoints.
- Updated pr_comments function documentation
- Made refresh function to use function parameter for the save_folder_path instead of a pre-assigned variable.
- Updated various verbose print statements
- Changed the way the function obtains filepaths from config file.
- Retrieves `pull_request_review_id` from JSON file to refer to the review comment made when creating the review.
Copy link
Collaborator

@daomcgill daomcgill left a comment

Choose a reason for hiding this comment

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

Changes resolved, though I will note that it looks like my suggestion for adding more info for .ssh folder was not included.

@crepesAlot
Copy link
Collaborator Author

@daomcgill You think the section for .ssh folder was insufficient? What do you think should be added to the explanation?

@daomcgill
Copy link
Collaborator

Wait, sorry. I did not see a section at all so that is my fault. Could you link the lines of code?

@daomcgill
Copy link
Collaborator

@crepesAlot I see it now. Yeah, I think that is sufficient. My bad!

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.

Pulling Request Comment via GitHub REST API
4 participants