diff --git a/NAMESPACE b/NAMESPACE index 814ea0b1..84083aa6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/config.R b/R/config.R index e0be0231..4c9a4731 100644 --- a/R/config.R +++ b/R/config.R @@ -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.") @@ -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 ##### diff --git a/man/get_bugzilla_issue_comment_path.Rd b/man/get_bugzilla_issue_comment_path.Rd new file mode 100644 index 00000000..e8832ae1 --- /dev/null +++ b/man/get_bugzilla_issue_comment_path.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/config.R +\name{get_bugzilla_issue_comment_path} +\alias{get_bugzilla_issue_comment_path} +\title{Returns the local folder path for Bugzilla issue comments for a specific project key.} +\usage{ +get_bugzilla_issue_comment_path(config_file, project_key_index) +} +\arguments{ +\item{config_file}{The parsed configuration file obtained from \code{\link{parse_config}}.} + +\item{project_key_index}{The name of the index of the project key (e.g. "project_key_1" or "project_key_2").} +} +\value{ +The local folder path for Bugzilla issue comments for project specified by key `project_key_index`. +} +\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`. +} diff --git a/man/get_bugzilla_issue_path.Rd b/man/get_bugzilla_issue_path.Rd new file mode 100644 index 00000000..f5438062 --- /dev/null +++ b/man/get_bugzilla_issue_path.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/config.R +\name{get_bugzilla_issue_path} +\alias{get_bugzilla_issue_path} +\title{Returns the local folder path for Bugzilla issues for a specific project key.} +\usage{ +get_bugzilla_issue_path(config_file, project_key_index) +} +\arguments{ +\item{config_file}{The parsed configuration file obtained from \code{\link{parse_config}}.} + +\item{project_key_index}{The name of the index of the project key (e.g. "project_key_1" or "project_key_2").} +} +\value{ +The local folder path for Bugzilla issues for project specified by key `project_key_index`. +} +\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`. +} diff --git a/man/get_bugzilla_project_key.Rd b/man/get_bugzilla_project_key.Rd index 13715d40..a29601e6 100644 --- a/man/get_bugzilla_project_key.Rd +++ b/man/get_bugzilla_project_key.Rd @@ -2,20 +2,22 @@ % Please edit documentation in R/config.R \name{get_bugzilla_project_key} \alias{get_bugzilla_project_key} -\title{Returns the name of the Bugzilla project key.} +\title{Returns the name of the Bugzilla project key for a specific project key index.} \usage{ -get_bugzilla_project_key(config_file) +get_bugzilla_project_key(config_file, project_key_index) } \arguments{ \item{config_file}{The parsed configuration file obtained from \code{\link{parse_config}}.} + +\item{project_key_index}{The name of the index of the project key (e.g. "project_key_1" or "project_key_2").} } \value{ -The Bugzilla project key name. +The Bugzilla project key name for project specified by key `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`. +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`. }