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

285 Bugzilla Downloader Refresher #293

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

Conversation

anthonyjlau
Copy link
Collaborator

@anthonyjlau anthonyjlau commented Apr 6, 2024

No description provided.

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,
Copy link
Collaborator Author

@anthonyjlau anthonyjlau Apr 20, 2024

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)

Copy link
Collaborator Author

@anthonyjlau anthonyjlau left a 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,
Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@anthonyjlau
Copy link
Collaborator Author

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.
@carlosparadis
Copy link
Member

@anthonyjlau is this review ready?

@anthonyjlau
Copy link
Collaborator Author

@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.

@carlosparadis
Copy link
Member

@anthonyjlau go for it, I still need to review the other PR first

- 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.
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.

3 participants