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

env-loader: bug fixes #295

Merged
merged 5 commits into from
Nov 26, 2024
Merged

env-loader: bug fixes #295

merged 5 commits into from
Nov 26, 2024

Conversation

fheinecke
Copy link
Contributor

Fixed the following bugs with the env loader tool:

  • environments-directory arg shared an environment variable with the environments arg
  • No output would be produced if no values were specifically requested, instead of outputting all loaded values
  • Git repo root not properly detected when the repo is a submodule
  • Environment names with a / character in them would search individual components instead of the full path (i.e. .environments/stage and .environments/build instead of .environments/stage/build)

@fheinecke fheinecke requested a review from a team as a code owner November 19, 2024 20:16
@zmb3
Copy link
Contributor

zmb3 commented Nov 19, 2024

Is it possible to write some tests to lock in this behavior?

Copy link
Contributor

@r0mant r0mant left a comment

Choose a reason for hiding this comment

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

lgtm assuming we add tests

tools/env-loader/cmd/env-loader.go Outdated Show resolved Hide resolved
for _, test := range tests {
actualValues, err := getRequestedEnvValues(test.c)
require.NoError(t, err)
require.EqualValues(t, actualValues, test.expectedValues)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you've got the order backwards here. I'm pretty sure it should be expected values, then actual values.

In Teleport we have a linter enabled that catches a lot of these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In Teleport we have a linter enabled that catches a lot of these.

Do you happen to know what it is/how it's configured? I setup this to standardize how we lint across the projects in this repo. It'd be great to get this enabled for everything.

Copy link
Contributor

Choose a reason for hiding this comment

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

@fheinecke fheinecke requested a review from zmb3 November 26, 2024 16:32
@fheinecke fheinecke merged commit f433aa8 into main Nov 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants