-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
command/hook_ui: Truncate the ID considering multibyte characters #18823
Conversation
Hi @minamijoyo, This commit touches a section of terraform that is being reworked as part of terraform 0.12, so if it's okay with you I'd prefer to wait and fix this in that release, mainly to avoid accidentally losing the work you've done when we merge in the 0.12 development branch. Thanks again for investigating and proposing a fix for this, especially with tests! |
@mildwonkey No problem. I'm looking forward to v0.12! |
@mildwonkey Now, this bug fix branch seems not to conflict with the latest master. Please review and merge when you can. Thanks! |
Fixes hashicorp#18822 The `tuncatedId` function had been introduced in hashicorp#12261 and increased the `maxIdLen` to 80 in hashicorp#13317. Since the number of bytes itself seems to be unimportant, the ID should be truncated to 80 characters, not 80 bytes.
b0a26da
to
33e1839
Compare
@mildwonkey I rebased this PR on the master branch and confirmed that the test passed, but when I tried to reproduce the original issue reported in #18822 with With the change of v0.12, it seems that the Line 205 in 33e1839
I think there is still meaning to fix this bug at the moment. However, the current code base seems to be a somewhat inconsistent behavior in |
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.
@minamijoyo 👋 It does seem that this code is still touched when stillApplying
runs, and that is the only case where truncateId
is used. I've opened a separate PR #22357 investigating that I'm not seeing the section populated consistently, and am still digging into it, but once I was able to get them displaying (...mostly) I was able to test your fix. Thank you for helping make Terraform more inclusive of other languages!
@pselle Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Fixes #18822
The
tuncatedId
function had been introduced in #12261 and increased themaxIdLen
to 80 in #13317.Since the number of bytes itself seems to be unimportant, the ID should be truncated to 80 characters, not 80 bytes.
Please let me know if we need to truncate it to 80 bytes considering multibyte character boundaries. This will require more complex logic.