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. |
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.