Fix encoding changes when truncating PR descriptions#8077
Merged
deivid-rodriguez merged 1 commit intodependabot:mainfrom Nov 28, 2023
mburumaxwell:pr-desc-truncate-fix
Merged
Fix encoding changes when truncating PR descriptions#8077deivid-rodriguez merged 1 commit intodependabot:mainfrom mburumaxwell:pr-desc-truncate-fix
deivid-rodriguez merged 1 commit intodependabot:mainfrom
mburumaxwell:pr-desc-truncate-fix
Conversation
jurre
reviewed
Sep 22, 2023
jurre
approved these changes
Sep 22, 2023
Contributor
Author
|
@jurre when can this be merged? |
|
@jurre Out of curiosity, is there anything blocking this PR? |
Contributor
Author
|
@deivid-rodriguez could you have a look here? |
deivid-rodriguez
approved these changes
Nov 24, 2023
Contributor
Author
|
Thanks @deivid-rodriguez |
Contributor
|
No problem! |
This file contains hidden or 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
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.
This is a recreation of #7140 but with changes from #7487 and simpler tests.
When truncating the PR descriptions for Azure, the string is converted from UTF-8 to UTF-16, operated on then changed back to UTF-8. The last step fails resulting in a string with an invalid string that cannot be converted to JSON for the request body and the PR cannot be created.
This PR changes from
force_encoding(...)toencode(...)which seems to solve the problem.The spec I have added fails when using
force_encoding(..)but works withencode(...)as guided by some Stack Overflow post. The issue shows up when converting to JSON usingto_jsonso the spec is modified to test exactly that.This should fix mburumaxwell/paklo#730