Version Upload API: Handle \n for release notes #262
No reviewers
Labels
No Label
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Type
Breaking
Type
Documentation
Type
Enhancement
Type
Feature
Type
Report
Type
Security
Type
Suggestion
Type
Testing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/extensions-website#262
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "version-update-linebreak"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
On my tests, when running the API with CURL via command-line the \n
were being converted to string \n, and there would be no way to write a
multi-line release notes.
For the records, initially the unittest was passing even without my changes. It seems that CURL interprets strings differently than our unittest? It is also possible that I don't know how to test multi-lines with CURL (I tried a few ways, all of them failed, requiring this patch).
And once (if) this is accepted I will update the documentation to mention
\n
: https://developer.blender.org/docs/features/extensions/ci_cd/@ -175,0 +175,4 @@
def validate_release_notes(self, value):
r"""Make sure \n and \r are valid after sanitation."""
if not value:
return value
why not a simple
return
?To make sure if we get None we still return None, if we get "" we still return "".
I will change this so it test for None instead.
@dfelinto do you have an example with the curl command you were using that was treated unexpectedly? I suspect that it may be a problem with shell escaping, i.e. that the request processing itself works correctly, but curl is being passed
\
andn
instead of\n
.I haven't run the code, but do I understand it correctly that now it is impossible to submit release notes that contain a literal
\n
sequence?I can imagine someone publishing a release note about a fixed bug of "\n processing fixed" and not being able to do that because of this added change.
@Oleg-Komarov you are right. I reverted the commit and updated the documentation.
This works well now:
Thanks for keeping an eye on it.
Thank you!