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

Abstract Config file parsing in R/config.R (Milestone 2) #230

Open
carlosparadis opened this issue Sep 20, 2023 · 4 comments
Open

Abstract Config file parsing in R/config.R (Milestone 2) #230

carlosparadis opened this issue Sep 20, 2023 · 4 comments
Assignees
Labels
type:refactoring Code changes that improve maintenability, performance, etc

Comments

@carlosparadis
Copy link
Member

Currently, modifying the /conf file schema requires checking every Notebook in Kaiaulu to make sure it still parses the project's yaml file correctly. The logic behind understanding the config file should be abstracted in a set of get methods, to de-couple all the Notebooks from it.

The coupling doesn't occur if it is adding fields, but any substantial re-organization will cause a mass co-change cascade. This should also help document the config file as R functions, and in the future write some utilities to analyze config files (e.g. a paper's project demographics could go here, since it would borrow info from the config to compute the latex table).

@carlosparadis carlosparadis added the type:refactoring Code changes that improve maintenability, performance, etc label Sep 20, 2023
@carlosparadis carlosparadis self-assigned this Sep 20, 2023
@anthonyjlau
Copy link
Collaborator

anthonyjlau commented Mar 15, 2024

1. Purpose

The purpose of this issue is to create get functions for configuration files. The motivation for this is that in each notebook in the vignettes folder, it loads in the config files by using a variable assignment (i.e. mbox_path <- conf[["mailing_list"]][["mbox"]]). If we were to change the structure of the config file (i.e. rename "mailing_list" to something else or move the variable elsewhere), then we would have to go though each notebook that uses it and change it so that it goes to the right value. To solve this, I am creating the file R/config.R to centralize the process of getting values from config files.

2. Process

This will be done by creating get methods for all of the config files that will be used in the notebooks. Then, I replace the direct variable assignment with the get methods in R/config.R.

3. Task List

  • Find out which config files I need to make get methods for.
  • Create R/config.R and make the get methods for each config file.
  • Replace the variable assignments in each notebook with my getter methods.

Updated API Nomenclature

All get functions now take in a parameter called project_name. The variable should be a string that contains the name of the config file WITHOUT the .yml after it.

Ex: get_project_code_language("camel"): This will return the code language field in the camel.yml config file.

@carlosparadis
Copy link
Member Author

@anthonyjlau Looks great!

@carlosparadis carlosparadis changed the title Abstract Config file parsing in R/config.R Abstract Config file parsing in R/config.R (Milestone 2) Mar 18, 2024
@carlosparadis
Copy link
Member Author

@anthonyjlau One more thing: Make sure you post here the function API nomenclature (i.e. update the first issue following the template). It would be a lot of time waste on your end if you went with a function nomenclature I would like to modify, as you would need to modify every notebook to fix that thereafter.

anthonyjlau added a commit that referenced this issue Mar 23, 2024
anthonyjlau added a commit that referenced this issue Mar 26, 2024
Added get  functions for mbox, jira,        and github.
anthonyjlau added a commit that referenced this issue Mar 28, 2024
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.
anthonyjlau added a commit that referenced this issue Mar 28, 2024
I normalized the comments by having it follow a format. I added if wrappers to catch null values.
anthonyjlau added a commit that referenced this issue Apr 3, 2024
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.
@anthonyjlau
Copy link
Collaborator

@Ssunoo2 @ian-lastname Ensure that the configs that are used on this project are in the final version and work with config.R. This includes the projects for the mailing lists (@ian-lastname), the ones used for Jira and Github (@Ssunoo2) and the ones for Bugzilla (@anthonyjlau).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:refactoring Code changes that improve maintenability, performance, etc
Projects
None yet
Development

No branches or pull requests

2 participants