graph-algorithms / edge-addition-planarity-suite

Other
26 stars 10 forks source link

EPIC: Appropriately handling the inclusion of default configuration files in source control #89

Open wbkboyer opened 1 month ago

wbkboyer commented 1 month ago

While writing the Running Memory Checks wiki page, the issue of how to handle the inclusion of default files in source control arose: in #59 , I added the TestSupport/planaritytesting/leaksorchestrator/planarity_leaks_config.ini file (generated by the planarity_leaks_config_manager.py) to source control, and then added a corresponding line to .gitignore, erroneously) assuming that even if a file was tracked in source control, the .gitignore would ensure that no changes could be made to the file without first changing the .gitignore.

After observing that the behaviour didn't match my expectation, I did some more investigation and arrived at an intermediate solution: instructing users to locally run git update-index --assume-unchanged on the defaults tracked in the repository so that local changes wouldn't appear as candidates to stage unless they actually intended to update the default in the repository (see also git update-index - Using "Assume Unchanged" Bit for justification vs. using --skip-worktree)

However, this is not scalable when dealing with multiple default configuration files, and an entirely process-driven approach is prone to user error. This StackOverflow response helps to inform a solution:

  1. Create a directory containing default configuration files to be tracked in source control,
  2. Implement an environment setup script to copy the default configuration files to the correct locations in the user environment:
    • .vscode/ - tasks.json, launch.json, and settings.json
    • TestSupport/planaritytesting/ - .pylintrc and leaksorchestrator/planarity_leaks_config.ini
    • c/ - .cproject and .project files created by Eclipse (see this Eclipse forum post and the Eclipse documentation on Building and the Project Description File)
      • N.B. This solution will resolve #14
  3. Run git -rm --cached for the configuration files currently tracked in version control
  4. Add those paths in the user development environment to the .gitignore
  5. Include instructions in README.md to run the environment setup script
john-boyer-phd commented 1 month ago

One thing we will have to resolve here for the dev env files (the .json files for VSCode and the .cproject file for Eclipse) is that the dev env may be used to clone the project (rather than git command line), so we need to make sure we know and explain (in the wiki) the process step(s) between dev env. clone and successful dev env build of the code.

It may be better to revise Issue #14 to say it will use this method, but solve it as a separate story for Eclipse because of the different wiki page instructions for that dev platform. The planarity leaks ini can be a story (issue in this epic), and the VSCode files can be a third story (issue).