Chartpress shouldn't modify version-controlled files
manics opened this issue · comments
Bug description
Many build tools avoid modifying version controlled source files, and instead write to a different output file. Chartpress modifies values.yaml in place, which means:
- It's necessary to have extra checks to prevent the modified file being committed: https://github.com/jupyterhub/chartpress/blob/main/.pre-commit-hooks.yaml
- Source control shows changes: jupyterhub/binderhub#1621
Expected behaviour
It should be possible to run chartpress without git diff
showing changes
Possible options
a. Rename values.yaml
to something like values.yaml.in
(or values.template.yaml
, or similar), following the pattern of autotools which generates Makefile
from Makefile.in
, remove values.yaml
from source control
b. Recursively copy the source directory to a temporary directory and do all work in that directory.
(a) can be made backwards compatible if we want by modifying values.yaml
in-place if the input file isn't found, whereas (b) requires no change to repositories.