Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for monorepo-friendly doppler.yaml files (take 2) #394

Merged
merged 2 commits into from
May 11, 2023

Conversation

watsonian
Copy link
Contributor

@watsonian watsonian commented May 10, 2023

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 interactive doppler setup invocations using expect. 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:

setup:
  project: cli
  config: dev

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 of find on linux systems).

This change now supports setup files in this format:

setup:
  - project: cli
    config: dev
    path: .
  - project: example
    config: stg
    path: example/

It lets you specify multiple project+repo combinations and adds a new path field. If no path 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.

@watsonian watsonian requested a review from nmanoogian May 10, 2023 19:06
@watsonian watsonian requested a review from Piccirello as a code owner May 10, 2023 19:06
Copy link
Contributor

@Piccirello Piccirello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers: based on a diff, it appears the relevant change from the previous PR is the addition of the else condition in pkg/controllers/repo_config.go.

.github/workflows/test.yml Show resolved Hide resolved
tests/e2e/setup.sh Show resolved Hide resolved
@watsonian watsonian force-pushed the watsonian/monorepo-setup-file-take-2 branch from eea604b to 6bc8c95 Compare May 10, 2023 21:24
.github/workflows/test.yml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants