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

230 abstract config file parsing #288

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
287f95b
i #230 generalized get functions
anthonyjlau Mar 23, 2024
6c323ce
i #230 added new get functions
anthonyjlau Mar 26, 2024
ffb969a
i #230 changed functions that access lists
anthonyjlau Mar 28, 2024
a7b719f
i #230 updated comments, added catches
anthonyjlau Mar 28, 2024
a16ab10
i #230 updated jira and mbox funcs to rtn a list
anthonyjlau Apr 3, 2024
f249709
i #230 added the project_key_index for Jira
anthonyjlau Apr 10, 2024
f6e8e31
i #230 added function to return GitHub keys
anthonyjlau Apr 10, 2024
42fee34
i #288 added changes to github, mail structure
anthonyjlau Apr 28, 2024
b1e4001
fix github checks
carlosparadis Apr 28, 2024
1b1535b
fixes compiling error
carlosparadis Apr 28, 2024
f160003
i #230 added config file changes
anthonyjlau Apr 29, 2024
ba27309
Merge branch 'master' into 230-abstract-config-file-parsing
carlosparadis Apr 29, 2024
4fe896d
Documentation edit for PR reflection test.
beydlern Sep 11, 2024
720c028
Minor Documentation Edit for PR Reflection Test
crepesAlot Sep 12, 2024
ef42bd3
i #230 replace a notebook's paths to get functions
beydlern Sep 20, 2024
c15223c
i #230 removed source call from modified notebook
beydlern Sep 20, 2024
b8d482b
i #230 removed incorrect pathing in config.R
beydlern Sep 24, 2024
f9d20ec
i #230 redefined get functions and updated an .Rmd
beydlern Sep 25, 2024
cccb8ef
i #230 Fix config.R Function Descriptions and Implement Notebooks
beydlern Sep 29, 2024
1219265
i #230 Update and Refactor Conf/ Files
crepesAlot Oct 2, 2024
3202887
Merge branch '230-abstract-config-file-parsing' of https://github.com…
crepesAlot Oct 2, 2024
fda90ae
i #230 Refactored More Notebooks
beydlern Oct 3, 2024
df129df
i #230 Corrected config.R Documentation
beydlern Oct 5, 2024
85f4830
i #230 Organized config.R functions
crepesAlot Oct 9, 2024
cee5e36
i #230 Removed Unused Getters
beydlern Oct 9, 2024
25deb91
i #230 Bugzilla Getters
beydlern Oct 9, 2024
89e768f
i #230 Pipermail Getters
beydlern Oct 10, 2024
cad5c6f
i #230 Mbox and Pipermail Input Getters
beydlern Oct 10, 2024
719650a
i #230 Updated conf/ files
crepesAlot Oct 10, 2024
e352aee
i #230 Understand Tool Getters
beydlern Oct 10, 2024
dbe66c1
Merge branch 'master' into 230-abstract-config-file-parsing
beydlern Oct 10, 2024
15b5e62
i #230 Update NEWS.md
crepesAlot Oct 11, 2024
86bb74b
i #230 Fixed Relative Paths in Notebooks
beydlern Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 43 additions & 43 deletions R/config.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return the tools.yml file
beydlern marked this conversation as resolved.
Show resolved Hide resolved
#' @export
get_tools <- function() {
tool <- yaml::read_yaml("../tools.yml")
tool <- yaml::read_yaml("tools.yml")
beydlern marked this conversation as resolved.
Show resolved Hide resolved
return(tool)
}

Expand All @@ -23,7 +23,7 @@ get_tools <- function() {
#' @return the tool path from tools.yml
#' @export
get_tools_project <- function(tool_name) {
tool <- yaml::read_yaml("../tools.yml")
tool <- yaml::read_yaml("tools.yml")
beydlern marked this conversation as resolved.
Show resolved Hide resolved
tool_path <- tool[[tool_name]]
return(tool_path)
}
Expand All @@ -37,7 +37,7 @@ get_tools_project <- function(tool_name) {
#' @export
get_conf <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
beydlern marked this conversation as resolved.
Show resolved Hide resolved
conf <- yaml::read_yaml(conf_path)

if(is.null(conf)) {
Expand All @@ -55,7 +55,7 @@ get_conf <- function(project_name) {
#' @return the local git repo path
#' @export
get_git_repo_path <- function(project_name) {
conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
beydlern marked this conversation as resolved.
Show resolved Hide resolved
conf <- yaml::read_yaml(conf_path)

git_repo_path <- conf[["version_control"]][["log"]]
Expand All @@ -76,7 +76,7 @@ get_git_repo_path <- function(project_name) {
#' @export
get_git_branches <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

git_branch <- conf[["version_control"]][["branch"]]
Expand All @@ -97,7 +97,7 @@ get_git_branches <- function(project_name) {
#' @export
get_file_extensions <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

file_extensions <- conf[["filter"]][["keep_filepaths_ending_with"]]
Expand All @@ -118,7 +118,7 @@ get_file_extensions <- function(project_name) {
#' @export
get_substring_filepath <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

substring_filepath <- conf[["filter"]][["remove_filepaths_containing"]]
Expand All @@ -139,7 +139,7 @@ get_substring_filepath <- function(project_name) {
#' @export
get_filter_commit_size <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

filter_commit_size <- conf[["filter"]][["remove_filepaths_on_commit_size_greather_than"]]
Expand All @@ -160,7 +160,7 @@ get_filter_commit_size <- function(project_name) {
#' @export
get_uctags_line_types <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

kinds <- conf[["tool"]][["uctags"]][["keep_lines_type"]]
beydlern marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -181,7 +181,7 @@ get_uctags_line_types <- function(project_name) {
#' @export
get_code_language <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

language <- conf[["tool"]][["depends"]][["code_language"]]
Expand All @@ -202,7 +202,7 @@ get_code_language <- function(project_name) {
#' @export
get_keep_dependencies_type <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

keep_dependencies_type <- conf[["tool"]][["depends"]][["keep_dependencies_type"]]
Expand All @@ -224,7 +224,7 @@ get_keep_dependencies_type <- function(project_name) {
#' @export
get_dv8_folder_path <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

project_path <- conf[["tool"]][["dv8"]][["folder_path"]]
Expand All @@ -245,7 +245,7 @@ get_dv8_folder_path <- function(project_name) {
#' @export
get_dv8_flaws_params <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

flaws_params <- conf[["tool"]][["dv8"]][["architectural_flaws"]]
Expand All @@ -266,7 +266,7 @@ get_dv8_flaws_params <- function(project_name) {
#' @export
get_issue_id_regex <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

issue_id_regex <- conf[["commit_message_id_regex"]][["issue_id"]]
Expand All @@ -287,7 +287,7 @@ get_issue_id_regex <- function(project_name) {
#' @export
get_srcml_filepath <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

srcml_filepath <- conf[["tool"]][["srcml"]][["srcml_path"]]
Expand All @@ -308,7 +308,7 @@ get_srcml_filepath <- function(project_name) {
#' @export
get_pattern4_folder_path <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

class_folder_path <- conf[["tool"]][["pattern4"]][["class_folder_path"]]
Expand All @@ -329,7 +329,7 @@ get_pattern4_folder_path <- function(project_name) {
#' @export
get_pattern4_filepath <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

pattern4_output_filepath <- conf[["tool"]][["pattern4"]][["output_filepath"]]
Expand All @@ -350,7 +350,7 @@ get_pattern4_filepath <- function(project_name) {
#' @export
get_topics <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

topics <- conf[["analysis"]][["topics"]]
Expand All @@ -371,7 +371,7 @@ get_topics <- function(project_name) {
#' @export
get_mbox_key_indexes <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

mbox_keys <- conf[["mailing_list"]][["mod_mbox"]]
Expand All @@ -393,7 +393,7 @@ get_mbox_key_indexes <- function(project_name) {
#' @export
get_mbox_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

mbox_path <- conf[["mailing_list"]][["mod_mbox"]][[project_key_index]][["mbox"]]
Expand All @@ -415,7 +415,7 @@ get_mbox_path <- function(project_name, project_key_index) {
#' @export
get_mbox_domain <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

mbox_url <- conf[["mailing_list"]][["mod_mbox"]][[project_key_index]][["archive_url"]]
Expand All @@ -437,7 +437,7 @@ get_mbox_domain <- function(project_name, project_key_index) {
#' @export
get_mbox_mailing_list <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

mailing_list <- conf[["mailing_list"]][["mod_mbox"]][[project_key_index]][["mailing_list"]]
Expand All @@ -459,7 +459,7 @@ get_mbox_mailing_list <- function(project_name, project_key_index) {
#' @export
get_mbox_mailing_list <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

archive_type <- conf[["mailing_list"]][["mod_mbox"]][[project_key_index]][["archive_type"]]
Expand All @@ -480,7 +480,7 @@ get_mbox_mailing_list <- function(project_name, project_key_index) {
#' @export
get_github_key_indexes <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

keys <- conf[["issue_tracker"]][["github"]]
Expand All @@ -502,7 +502,7 @@ get_github_key_indexes <- function(project_name) {
#' @export
get_github_owner <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

owner <- conf[["issue_tracker"]][["github"]][[project_key_index]][["owner"]]
Expand All @@ -524,7 +524,7 @@ get_github_owner <- function(project_name, project_key_index) {
#' @export
get_github_repo <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

repo <- conf[["issue_tracker"]][["github"]][[project_key_index]][["repo"]]
Expand All @@ -546,7 +546,7 @@ get_github_repo <- function(project_name, project_key_index) {
#' @export
get_github_issue_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

issue_path <- conf[["issue_tracker"]][["github"]][[project_key_index]][["issue"]]
Expand All @@ -568,7 +568,7 @@ get_github_issue_path <- function(project_name, project_key_index) {
#' @export
get_github_issue_or_pr_comment_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

issue_or_pr_comment_path <- conf[["issue_tracker"]][["github"]][[project_key_index]][["issue_or_pr_comment"]]
Expand All @@ -590,7 +590,7 @@ get_github_issue_or_pr_comment_path <- function(project_name, project_key_index)
#' @export
get_github_issue_search_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

issue_search_path <- conf[["issue_tracker"]][["github"]][[project_key_index]][["issue_search"]]
Expand All @@ -612,7 +612,7 @@ get_github_issue_search_path <- function(project_name, project_key_index) {
#' @export
get_github_pull_request_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

pull_request_path <- conf[["issue_tracker"]][["github"]][[project_key_index]][["pull_request"]]
Expand All @@ -634,7 +634,7 @@ get_github_pull_request_path <- function(project_name, project_key_index) {
#' @export
get_github_commit_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

commit_path <- conf[["issue_tracker"]][["github"]][[project_key_index]][["commit"]]
Expand All @@ -655,7 +655,7 @@ get_github_commit_path <- function(project_name, project_key_index) {
#' @export
get_jira_key_indexes <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

keys <- conf[["issue_tracker"]][["jira"]]
Expand All @@ -677,7 +677,7 @@ get_jira_key_indexes <- function(project_name) {
#' @export
get_jira_domain <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

domain <- conf[["issue_tracker"]][["jira"]][[project_key_index]][["domain"]]
Expand All @@ -699,7 +699,7 @@ get_jira_domain <- function(project_name, project_key_index) {
#' @export
get_jira_project_key_name <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

name <- conf[["issue_tracker"]][["jira"]][[project_key_index]][["project_key"]]
Expand All @@ -721,7 +721,7 @@ get_jira_project_key_name <- function(project_name, project_key_index) {
#' @export
get_jira_issues_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

jira_issues_path <- conf[["issue_tracker"]][["jira"]][[project_key_index]][["issues"]]
Expand All @@ -743,7 +743,7 @@ get_jira_issues_path <- function(project_name, project_key_index) {
#' @export
get_jira_issues_comments_path <- function(project_name, project_key_index) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

jira_issue_comments_path <- conf[["issue_tracker"]][["jira"]][[project_key_index]][["issue_comments"]]
Expand All @@ -764,7 +764,7 @@ get_jira_issues_comments_path <- function(project_name, project_key_index) {
#' @export
get_bugzilla_project_key <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

key <- conf[["issue_tracker"]][["bugzilla"]][["project_key_index"]][["project_key"]]
Expand All @@ -785,7 +785,7 @@ get_bugzilla_project_key <- function(project_name) {
#' @export
get_nvdfeed_folder_path <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

nvdfeed_folder_path <- conf[["vulnerabilities"]][["nvd_feed"]]
Expand All @@ -806,7 +806,7 @@ get_nvdfeed_folder_path <- function(project_name) {
#' @export
get_cveid_regex <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

cveid_regex <- conf[["commit_message_id_regex"]][["cve_id"]]
Expand All @@ -827,7 +827,7 @@ get_cveid_regex <- function(project_name) {
#' @export
get_enumeration_commits <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

commit <- conf[["analysis"]][["enumeration"]][["commit"]]
Expand All @@ -848,7 +848,7 @@ get_enumeration_commits <- function(project_name) {
#' @export
get_window_start_commit <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

start_commit <- conf[["analysis"]][["window"]][["start_commit"]]
Expand All @@ -869,7 +869,7 @@ get_window_start_commit <- function(project_name) {
#' @export
get_window_end_commit <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

end_commit <- conf[["analysis"]][["window"]][["end_commit"]]
Expand All @@ -890,7 +890,7 @@ get_window_end_commit <- function(project_name) {
#' @export
get_window_size <- function(project_name) {

conf_path <- paste0("../conf/", project_name, ".yml")
conf_path <- paste0("conf/", project_name, ".yml")
conf <- yaml::read_yaml(conf_path)

window_size <- conf[["analysis"]][["window"]][["size_days"]]
Expand Down
Loading