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 32 commits into
base: master
Choose a base branch
from

Conversation

anthonyjlau
Copy link
Collaborator

If a change is made in a configuration file, then every notebook that uses that configuration file has to be changed. In order to centralize the process and make it easier to change configuration files, the R/config.R file will store "get" functions that get the fields from the config files. These get functions can be used in place of the hard coded variable assignments. It will also make it easier to update changes to config files as only the functions in R/config.R need to be updated.

Added get  functions for mbox, jira,        and github.
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 244 lines in your changes are missing coverage. Please review.

Project coverage is 35.90%. Comparing base (2bc8d14) to head (ba27309).
Report is 3 commits behind head on master.

Files Patch % Lines
R/config.R 0.00% 244 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
- Coverage   39.79%   35.90%   -3.89%     
==========================================
  Files          20       21       +1     
  Lines        3091     3545     +454     
==========================================
+ Hits         1230     1273      +43     
- Misses       1861     2272     +411     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Functions that require something from a list (ie. conf[["version_control"]][["branch"]][4]) now have an index parameter. (ie. conf[["version_control"]][["branch"]][branch_index]) Also finished the rest of the get methods for all notebooks.
I normalized the comments by having it follow a format. I added if wrappers to catch null values.
Copy link
Collaborator

@ian-lastname ian-lastname left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, documentation seems good enough for what it does.

@Ssunoo2
Copy link
Collaborator

Ssunoo2 commented Mar 28, 2024

Nice work!

anthonyjlau and others added 5 commits April 2, 2024 18:32
I changed the documentation of the JIRA functions to return a list of project keys and storage paths (HADOOP case).

I also changed the documentation of the mbox function to return a list of storage paths.
@carlosparadis
Copy link
Member

@anthonyjlau Error occurs on my local machine too when I try to build it fails with the following error:

Error in parse(outFile) : 
  /Users/cvp/Desktop/kaiaulu/kaiaulu/R/config.R:770:68: unexpected symbol
769: 
770:   key <- conf[["issue_tracker"]][["bugzilla"]][["project_key_index"project_key

carlosparadis and others added 6 commits April 28, 2024 03:38
Confirming setup for committing and PR reflection.
Confirming setup for committing and PR reflection.
In each notebook, the working directory is the vignettes/ directory, however, the getwd() command states that the working directory is the kaiaulu/ folder itself. This is because each R code chunk considers its directory to be the working directory. To test the functionality of the get functions, I edited the config file to reflect the relative directory of vignettes/, thus parent directory ../ file path changes were added to each function.
@beydlern beydlern force-pushed the 230-abstract-config-file-parsing branch from 7adaf4f to ef42bd3 Compare September 20, 2024 00:55
The source("../R/config.R") reference was previously used to import the get() functions from config.R, however I wasn't building the project correctly. Now, this incorrect reference can be removed.
Due to a minor misunderstanding on my part, I added in relative paths in the config.R file from the notebook's directory, this was due to the IDE RStudio changing the working directory to the current running notebook directory rather than staying at the project directory.
Copy link
Member

@carlosparadis carlosparadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline comments.

R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
- Function titles, descriptions, and parameter documentation were reviewed and redefined.
- Removed inefficient hardcoding of tools.yml and duplicated "config" path code.
- Appropriate warning messages were added to each function in the case of the return value possessing the NULL value.
- Notebook blamed_line_types_showcase.Rmd was updated to reflect follow the redefined R/config.R get functions.
@beydlern beydlern removed the request for review from crepesAlot September 27, 2024 01:48
Copy link
Collaborator

@daomcgill daomcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some in-line comments for some ideas on how you can make the function signatures and comments clearer. I did not do all of them, but you should retain a consistent level of detail throughout the file. Even though some code already seems simple, it is still easier to read in words.

R/config.R Show resolved Hide resolved
R/config.R Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
- config.R was modified to possess descriptive get function titles and descriptions as well as a separation of getter functions into groups for clarity.
- Some appropriate notebooks (every notebook in vignettes/ that doesn't have an "_" prefix) were decoupled to use the get() functions from config.R in lieu of hard-coded paths to the configuration files.
- Updated mailing_list for conf/ files
- Updated issue_tracker for conf/ files
Copy link
Member

@carlosparadis carlosparadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did not do an extensive review but there are a few things that needs to be changed, some minor, some will take a reasonable amount of time.

DESCRIPTION Outdated Show resolved Hide resolved
R/config.R Show resolved Hide resolved
R/config.R Outdated Show resolved Hide resolved
NAMESPACE Outdated Show resolved Hide resolved
vignettes/download_mod_mbox.Rmd Outdated Show resolved Hide resolved
beydlern and others added 10 commits October 3, 2024 13:19
- Refactored most of the notebooks to replace the hard coded paths with the getter functions in R/config.R
- Updated a few of the configuration files (.yml extension) in conf/ fixing some syntax and indentation errors
- Added another getter function in R/config.r called get_github_issue_event_path
- Edited DESCRIPTION to incorporate myself as a contributor
- Edited NEWS.md to describe refactoring getter function feature.
- config_file parameter description was incorrect, a reference to how it is obtained was added to its description.
- renamed get_parsed() to parse_config() and changed the appropriate getter calls in all of the notebooks.
- reverted RoxygenNote version in DESCRIPTION
- config.R functions are organized to follow the same formatting as the conf files
- All conf files issue_trackers have been updated.
- get_mbox_mailing_list() and get_mbox_archive_type() were removed as the keys that they are grabbing are scheduled for removal.
- added two new bugzilla getter functions get_bugzilla_issue_comment_path and get_bugzilla_issue_path
- Implemented two pipermail mailing list getters get_pipermail_domain and get_pipermail_path
- Implemented two more getter functions: get_mbox_input_file() and get_pipermail_input_file()
- Added Scitools understand section to tools
- Updated mailing_list
- Implemented 4 Getter functions: get_understand_code_language(), get_understand_keep_dependencies_type(), get_understand_project_path(), and get_understand_output_path().
- Changed get_code_language() and get_keep_dependencies_type() to get_depends_code_language() and get_depends_keep_dependencies_type(), respectively as well as updated the appropriate notebooks that used these getters.
@carlosparadis
Copy link
Member

Nice to see these checks passing at last, thank you for merging the master to fix on this end!

- Updated NEWS.md
- Minor change to mailing_list
@crepesAlot
Copy link
Collaborator

Made 1 new commit after group meeting, updated NEWS.md and a very minor change to the mailing_list.

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.

7 participants