Lando should store patches as text instead of binary
Categories
(Conduit :: Lando, enhancement)
Tracking
(Not tracked)
People
(Reporter: sheehan, Unassigned)
Details
At the moment Lando stores patches in the database as LargeBinary. We retrieve the patch as a Python bytes, which we then decode as a utf-8 str and use to apply to the repo for landings, parse headers etc. When we want to store the patch we encode from str to bytes again.
We should change the DB schema to store patches as text, avoiding the need to convert to bytes in various places and keeping the mental model of patch formats consistent across Lando.
Comment 1•2 years ago
|
||
Note that some patches may contain non-UTF-8 text.
| Reporter | ||
Comment 2•2 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #1)
Note that some patches may contain non-UTF-8 text.
Which kind of changes are you referring to? IIRC Phabricator stores patches in UTF-8, so if there's some potential incompatibility there we haven't come across it in a while.
Comment 3•2 years ago
|
||
For example patches touching under dom/encoding/test/ or intl/uconv/tests/. IIRC we had to make the patch binary to avoid UTF-8 restriction imposed by Phabricator.
I assume we'd treat non-utf8 files the same as we currently treat actually binary files (eg. images).
For context here's what moz-phab does https://github.com/mozilla-conduit/review/blob/4f2fcbfc5a988384f721cefe8b5b998d2652edf1/mozphab/mercurial.py#L997-L1005
Description
•