Institution doesn't appear to work in include filenames #674
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#674
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Trying to work around the deep versus shallow merge issue with a include pathname hack
Steps to reproduce (if a bug)
ceate three configuration files. Topmost with fields that are deep merged. Template common with include path with the constant substitution field, and the configuration file with fields that are imported via the calculated pathname in the template common. See below for examples.
Topmost config
master template fragment
home/location.yaml
Actual behavior (if a bug)
Expected behavior (if a bug)
If the constant substitution occurred in the filename then the directory specified in the top level configuration file would be imported into the core template fragment effectively replacing that part of the configuration file and simulating a shallow merge.
While this example is is a hack around the lack of a shallow merge, I believe it would also be useful in general to calculate pathnames for different fig file fragments.
Other notes / implementation ideas
Environment
borgmatic version: [1.7.11]
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method: [pip3 into virtual environment]
Borg version: [1.2.4]
Use
sudo borg --version
Python version: [3.10.6]
Use
python3 --version
Database version (if applicable): [version here]
Use
psql --version
ormysql --version
on client and server.operating system and version: [Ubuntu 22.04]
Thanks for filing this. Constants not working across includes is a known/documented limitation that was put in place for simplicity of implementation and use, although I see why you'd want that limitation lifted for your use case.
If this were to be implemented, I think the way to do it would be to accumulate constants as each successive file is included (potentially replacing constants if they've already been defined at a higher include level), and doing the interpolation on each file as it's included.
I'm not sure though whether this is a "better" idea than just implementing #672, since this ticket (#674) is a work-around for not having that feature.
Implementing #672 is a better idea. ok to close this