Protect what matters β even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
cfpjdds
5 months agoNew Contributor
Feature Request - Allow inject to run with missing references
Let's assume there is a config template like `.env.template` which I want to share with my team. This could be in a git repo that is committed as part of a code base. To run all of the tests you woul...
cfpjdds
5 months agoNew Contributor
I gave this a bit more thought and better solution would be something like `--handle-missing` with options like `raise`, `warn`, `ignore`.
The absolution premium solution would be to have some syntax in the `.env.template` to fill with a default if the value is missing. Here `|` is used similar to how it can be used in python.
# AWS S3 - Only some people have/need to run these integration tests
# aws/password doesn't exist in this user's 1password
AWS_PASSWORD={{ op://User/aws/password | mocked_pw }}
AWS_USER={{ op://User/aws/user | }}this would render as:
# AWS S3 - Only some people have/need to run these integration tests
# aws/password doesn't exist in this user's 1password
AWS_PASSWORD=mocked_pw
AWS_USER=This has the nice advantage of allowing .template creators to define which missing references are allowed and which ones are not, and can input defaults that may pass their unit tests. That said, any of these solution would be a good start.