-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use HasSuffix to check for suffix #1505
Conversation
The existing regular expression match is not required and is prone to failure. Given that the workspace name is essentially a suffix, the idiomatic way would be to use `HasSuffix`.
The function `nameMatchesWorkspace` is no longer required.
This function is no longer required.
Hi @amangale, I believe this change might not be backward compatible since it alters the existing behavior. Could you elaborate on why this change is necessary and clarify what you mean by "prone to failure"? |
Hi @james03160927 - |
If we can modify the code to support the same functionality while also accommodating new use cases with the upgrade, it will ensure that existing users do not encounter sudden errors, especially in scenarios where their automatic setups update to the latest Terratest version. |
Hi @james03160927 - |
@james03160927 - If it helps, here is the change in |
Hi @james03160927 ,@amangale, As a temporary solution for latest terragrunt version, where it spits out extra values at stdout during workspace selection . |
Thanks for the clarification. Will trigger the test pipeline and see if it passes all the other tests. |
It's failing the precommit test
|
@james03160927 - |
Triggering test again. |
Failing tests doesn't seem to be related to your change. LGTM. |
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.
LGTM
For checking the existence of a workspace, the existing regular expression match is not required and is prone to failure. Given that the workspace name is essentially a suffix, the idiomatic way would be to use
HasSuffix
.