[PATCH 3/7] tags: be a bit more permissive in what we render to a message

Stephen Finucane stephen at that.guru
Sat Jan 27 08:42:11 AEDT 2018


On Fri, 2018-01-26 at 21:24 +0000, Stephen Finucane wrote:
> On Thu, 2018-01-25 at 13:43 +1100, Daniel Axtens wrote:
> > Currently we render a tag from a comment into a message if it is
> > 
> >  '^(whatever)-by: .*'
> > 
> > We found a patch that had a UTF-8 non-breaking space after the
> > colon,
> > and this was breaking the regex. So just remove the requirement for
> > a space entirely. Add the test from the original bug.
> > 
> > Closes: #124
> > Signed-off-by: Daniel Axtens <dja at axtens.net>
> > 
> > ---
> > 
> > Stephen - if you get to merging this before I do, please check the
> > mbox file contains a unicode nbsp and hasn't been munged by git -
> > it should be 'Acked-by:<utf-8 nbsp><space>Christophe L...'
> 
> Sure, I'll try to extend this to check for the unicode character in
> the
> file.
> 
> Reviewed-by: Stephen Finucane <stephen at that.guru>

Actually, I take that back. This would be easier to test if we actually
generated the mail from scratch, like we do for the rest of the tests
in this file, rather than using a stored file. You can validate using
something like the below:

  -        self.assertContains(response, "Christophe Lombard")
  +        self.assertContains(response, u'\u00A0 Christophe Lombard')

While we're at it, it might be a good idea to add some more tag-in-mbox 
checks because there doesn't seem to be any. That's orthogonal though
and can wait.

Stephen


More information about the Patchwork mailing list