Skip to content

Commit

Permalink
i #230 Bugzilla Getters
Browse files Browse the repository at this point in the history
- added two new bugzilla getter functions get_bugzilla_issue_comment_path and get_bugzilla_issue_path
  • Loading branch information
beydlern committed Oct 9, 2024
1 parent cee5e36 commit 25deb91
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 17 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export(filter_by_file_extension)
export(filter_by_filepath_substring)
export(filter_by_last_files_change)
export(format_name_email)
export(get_bugzilla_issue_comment_path)
export(get_bugzilla_issue_path)
export(get_bugzilla_project_key)
export(get_code_language)
export(get_cveid_regex)
Expand Down
65 changes: 56 additions & 9 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,21 @@ get_github_commit_path <- function(config_file, project_key_index) {

### Bugzilla Functions #####

#' Returns the name of the Bugzilla project key.
#' Returns the name of the Bugzilla project key for a specific project key index.
#'
#' @description This function returns the name of the Bugzilla project key, that
#' is specified in the input parameter `config_file`. The input, `config_file`
#' must be a parsed configuration file. The function will inform the user if
#' the name of the Bugzilla project key exists in the parsed configuration
#' file, `config_file`.
#' @description This function returns the name of the Bugzilla project key for
#' a specific project key, that is specified in the input parameter
#' `config_file`. The input, `config_file` must be a parsed configuration file.
#' The function will inform the user if the name of the Bugzilla project key
#' exists in the parsed configuration file, `config_file`.
#'
#' @param config_file The parsed configuration file obtained from \code{\link{parse_config}}.
#' @return The Bugzilla project key name.
#' @param project_key_index The name of the index of the project key (e.g. "project_key_1" or "project_key_2").
#' @return The Bugzilla project key name for project specified by key `project_key_index`.
#' @export
get_bugzilla_project_key <- function(config_file) {
get_bugzilla_project_key <- function(config_file, project_key_index) {

bugzilla_key <- config_file[["issue_tracker"]][["bugzilla"]][["project_key"]]
bugzilla_key <- config_file[["issue_tracker"]][["bugzilla"]][[project_key_index]][["project_key"]]

if (is.null(bugzilla_key)) {
warning("Attribute does not exist in the configuration file.")
Expand All @@ -508,6 +509,52 @@ get_bugzilla_project_key <- function(config_file) {
return(bugzilla_key)
}

#' Returns the local folder path for Bugzilla issues for a specific project key.
#'
#' @description This function returns the local folder path for Bugzilla issues
#' for a specific project key, that is specified in the input parameter
#' `config_file`. The input, `config_file` must be a parsed configuration file.
#' The function will inform the user if the folder path for Bugzilla issues
#' exists in the parsed configuration file, `config_file`.
#'
#' @param config_file The parsed configuration file obtained from \code{\link{parse_config}}.
#' @param project_key_index The name of the index of the project key (e.g. "project_key_1" or "project_key_2").
#' @return The local folder path for Bugzilla issues for project specified by key `project_key_index`.
#' @export
get_bugzilla_issue_path <- function(config_file, project_key_index) {

issue_path <- config_file[["issue_tracker"]][["bugzilla"]][[project_key_index]][["issues"]]

if (is.null(issue_path)) {
warning("Attribute does not exist in the configuration file.")
}

return(issue_path)
}

#' Returns the local folder path for Bugzilla issue comments for a specific project key.
#'
#' @description This function returns the local folder path for Bugzilla issue
#' comments for a specific project key, that is specified in the input parameter
#' `config_file`. The input, `config_file` must be a parsed configuration file.
#' The function will inform the user if the folder path for Bugzilla issue
#' comments exists in the parsed configuration file, `config_file`.
#'
#' @param config_file The parsed configuration file obtained from \code{\link{parse_config}}.
#' @param project_key_index The name of the index of the project key (e.g. "project_key_1" or "project_key_2").
#' @return The local folder path for Bugzilla issue comments for project specified by key `project_key_index`.
#' @export
get_bugzilla_issue_comment_path <- function(config_file, project_key_index) {

issue_comment_path <- config_file[["issue_tracker"]][["bugzilla"]][[project_key_index]][["issue_comments"]]

if (is.null(issue_comment_path)) {
warning("Attribute does not exist in the configuration file.")
}

return(issue_comment_path)
}

##### Issue Tracker Functions End #####


Expand Down
23 changes: 23 additions & 0 deletions man/get_bugzilla_issue_comment_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/get_bugzilla_issue_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions man/get_bugzilla_project_key.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 25deb91

Please sign in to comment.