Add support for monorepo-friendly doppler.yaml files (take 2) #394
+433
−104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Take 2 of #374 which we had to revert due to a bug that broke interactive invocations of
doppler setup
. This reintroduces the same change in #374 with the addition of the fix in #386 that we decided to hold off on in favor of rolling back so we could do more testing. It also adds an additional test for interactivedoppler setup
invocations usingexpect
. I've run the test without the fix from #386 to ensure it would have caught it (which it would have).This adds support for a more monorepo-friendly setup file. Historically, a setup file (
doppler.yaml
) had this format:It could only contain values for a single project+config combination. If you had a monorepo that contained many services as subdirectories, you had to essentially add one of these to each of the subdirectories and then have a script go through running
doppler setup
in each directory (or clever usage offind
on linux systems).This change now supports setup files in this format:
It lets you specify multiple project+repo combinations and adds a new
path
field. If nopath
field is specified, then it refers to the root directory. If one is specified, it's relative to the root directory.The change maintains backwards compatibility with old setup files while allowing the new usage. If the new format is detected, it will loop through, prompting you if you want to perform the setup for each directory (and prints the directory it's performing the setup for).
--no-interactive
will work as expected in this case. If the old format is detected, then everything works as it has historically.Fixes ENG-3644.