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
enhance: support recognizing env names from var file suffixes #2840
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aliscott
force-pushed
the
auto-detect-support-env-name-suffix
branch
from
January 24, 2024 11:52
702094c
to
df8382d
Compare
aliscott
force-pushed
the
auto-detect-support-env-name-suffix
branch
from
January 24, 2024 14:09
df8382d
to
50c3737
Compare
aliscott
commented
Jan 24, 2024
internal/hcl/project_locator.go
Outdated
@@ -16,19 +16,20 @@ import ( | |||
) | |||
|
|||
var ( | |||
defaultEnvVarNames = regexp.MustCompile(`^(prd|prod|production|preprod|staging|stage|stg|development|dev|release|testing|test|tst|qa|uat|live|sandbox|demo|integration|int|experimental|experiments|trial|validation|perf|sec|dr)`) | |||
defaultEnvVarNames = regexp.MustCompile(`^(.*-)?(prd|prod|production|preprod|staging|stage|stg|development|dev|release|testing|test|tst|qa|uat|live|sandbox|demo|integration|int|experimental|experiments|trial|validation|perf|sec|dr)`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also add (.*-)$
at the end of this to make sure that the env is a separate token.
As well as -
we might also want to support _
as a separator.
hugorut
approved these changes
Jan 24, 2024
Currently we support grouping var files like `prd.tfvars` with `prd-defaults.tfvars`. This adds similar support to also group `prd.tfvars` with `defaults-prd.tfvars`.
It looks like the TFC registry has changed to point to the commit ref instead of the tag
… of a file name by a separator (- or _)
aliscott
force-pushed
the
auto-detect-support-env-name-suffix
branch
from
January 25, 2024 09:59
20cc1be
to
25d7b54
Compare
This is causing issues with the build
aliscott
force-pushed
the
auto-detect-support-env-name-suffix
branch
2 times, most recently
from
January 25, 2024 13:29
9e6ceb0
to
be68a13
Compare
Test failures look unrelated. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently we support grouping var files like
prd.tfvars
withprd-defaults.tfvars
. This adds similar support to also groupprd.tfvars
withdefaults-prd.tfvars
.Also for the case where we have vars called
redis-prd.tfvars
andredis-dev.tfvars
, we still want to add them to the project if there's no other matchingprd.tfvars
ordev.tfvars
file.This also includes a fix to update the module loader tests since it looks like TFC registry has switched to using the commit ref instead of tag.