-
Notifications
You must be signed in to change notification settings - Fork 12
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
285 Bugzilla Downloader Refresher #293
base: master
Are you sure you want to change the base?
Conversation
This is not finished and has not been tested yet.
The download_bugzilla_rest_issues_comments function now takes 3 more parameters, project_key, comments, and verbose. It is now able to download issues or issues with comments depending on the comments parameter.
R/bugzilla.R
Outdated
save_folder_path, | ||
project_key, | ||
limit_upperbound = 500, | ||
comments = FALSE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside parameter:
comments = c(TRUE, FALSE)
Inside function:
comments <- match.arg(comments)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes on how to refactor bugzilla functions. Delete the existing download_bugzilla_rest_issues.
R/bugzilla.R
Outdated
#' @seealso \code{\link{parse_bugzilla_rest_issues_comments}} a parser function to parse Bugzilla issues and comments data | ||
#' @export | ||
download_bugzilla_rest_issues_comments <- function(bugzilla_site, start_timestamp, save_folder_path, limit_upperbound = 500) { | ||
download_bugzilla_rest_issues_comments <- function(bugzilla_site, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename function to download_bugzilla_rest_issues_comments_by_date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a new function called download_bugzilla_rest_issues_comments. This function should have the exact code logic as this one except it will have a query
parameter.
Then, the download_bugzilla_rest_issues_comments_by_date calls the function (download_bugzilla_rest_issues_comments) specifying the query parameter to be
?creation_time=", start_timestamp, "&include_fields=_default,comments", "&limit=", limit, "&offset=", offset
if comments = TRUE,
or else
?creation_time=", start_timestamp, "&limit=", limit, "&offset=", offset
if comments = FALSE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the refresh function, call the by date function here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for the naming convention of the files is in the download_bugzilla_rest_issues_comments.
I separated the API call into a different function so that it can be used by other queries in the future. I also finished the code for the refresher.
@anthonyjlau is this review ready? |
@carlosparadis The code works and can be reviewed. I wanted to make some more changes to it though to add back the documentation and clean up the variable names. |
@anthonyjlau go for it, I still need to review the other PR first |
I added comments to the downloader functions and fixed the parser.
- One notebook was refactored to expect the use of the getter functions from R/config.R (i #230 contains the getter functions in R/config.R).
- Two getters were added to replace hard-coded paths: get_bugzilla_issue_path() and get_bugzilla_issue_comment_path()
- The project configuration sections of a notebook was incorrectly using the project directory (kaiaulu/) as its working directory rather than the directory that it resides in (/vignettes/) as its working directory.
No description provided.