Age | Commit message (Collapse) | Author |
|
Now that we do our best to track incomplete series, don't crash when we
come across one.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Record patch counters when we start tracking series so we properly
indicate in the thank-you note which ones got applied. Additionally,
indicate in the subject when we're reporting on a subset of a larger
series.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we're processing a full https URL to the message, then unquote the
message ID before we use it.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't use self.expected, but actual array length when preparing
attestation report.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't display failures if there are no attestations available.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
This adds a symlinkable hook that can perform inline attstation straight
from the b4 checkout dir, plus documentation that explains some of the
core concepts behind in-header attestation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We shouldn't be using the From: field, as it will not necessarily match
the identity of the person submitting attestation.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Multiple fixes for error messages displayed in softfail and hardfail
modes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't attempt to parse the email if we don't find the x-patch-sig
header.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we don't find a resolve() method in dnspython, just let dkimpy do its
own lookups.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Only works for x-patch-sig style attestation, as doing DKIM attestation
requires that we unignore all headers, which just junks up the view.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
If we find an older dnspython < 2.0, don't crash but let dkim figure out
how it wants to look up TXT records on its own.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Some DKIM keys may not list v=DKIM1.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Make it possible to turn off dkim verification entirely, but leave other
attestation modes enabled.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We've moved some constant declarations around, so fix the code to look
for them in the right places.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We moved pgp sig verification code around, so fix it for the invocation
in b4 pr.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We're still spending too much time in dns lookups, even though they are
supposed to be cached.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Now that vger is doing a much better job preserving DKIM signatures, it
makes sense to teach b4 to check those. It's still failing for most
mailman lists, but those are fewer than vger sources.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Incorporate patches from Philippe Blain.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The 'data_files' option to setuptools.setup can be used to install
additional files "outside" of the package [1].
Use it so that the manpage is installed with the package.
Install the manpage to '$PREFIX/share/man/man5', mimicking what the
Filesystem Hiararchy Standard mandates for the '/usr/local/' prefix [2].
Prefer '$PREFIX/share/man/man5' to '$PREFIX/man/man5' since the later is
deprecated [3].
[1] https://docs.python.org/3/distutils/setupscript.html#installing-additional-files
[2] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html#idm236091648080
[3] https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch04s11.html#ftn.idm236091648080
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
|
|
Add links to the Groups.io instance at https://linux.kernel.org/g/tools
in the man page, the README and on PyPI.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
|
|
Instead of linking to the default gitweb view ('summary'),
link to the README in the 'tree' view, so that users coming from
pypi.org can directly read it.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
|
|
When using the built-in Python3 module 'venv' to create a virtual
environment, it is common to name the folder containing the virtual
environment '.venv' [1].
To help developers wishing to use a virtual environment to develop the
project, add '.venv' to the .gitignore file.
[1] https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
|
|
We're only doing this as part of b4 am now, so remove the obsolete
attverify command.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't attempt a len() on an object that may be None. This happens when
there are patches prepared with a tool like quilt that don't include
indexes.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Use r'' strings uniformly to avoid needing to escape backslashes.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
b4 tries to handle subject lines such as "[PATCHvX]" by replacing
the subject line in situ, but seems to do a rather bad job of it,
resulting in only the first patch of the series being picked up.
Fetching <20201026134931.28246-1-mark.rutland@arm.com> does exhibit
the problem.
Fixing the re.sub() expression allows normal funtionalities to be
restored, and the above series to be fetched.
Fixes: 6bf644f14b3f ("Deal with [PATCHvX] subject")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't crash on incomplete threads when trying to carry over previous
trailers.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We need to fix all legacy encodings before we pass an email to
git-mailinfo. Additionally, even if that fails, don't crash on a missing
attestation.
Reported-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The new attestation code did away with attid, but we still use it for
tracking unchanged patches between series.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Link is a non-person trailer, so should be recognized as such. Cc is a
person-trailer but we always expected that to include <> surrounding the
address, which is not correct in all cases.
Reported-by: Greg Kroah-Hartman <greg@kroah.com>
Reported-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It seems we don't have much control over what as_bytes() does, so switch
to using as_string(), setting our policy, and making sure that
content-transfer-encoding is set to 8bit.
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Rewrite attestation to implement in-header hashing and signing. For now,
just implementing mode=pgp, but other modes are coming next.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Handle several corner cases when trying to cherrypick from incomplete
series.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Error out when we don't find any patches in an mbox when trying to diff
series.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
We don't need to needlessly convert to unicode when dumping to stdout,
especially when it can lead to crashers when we encounter other
charsets.
Reported-by: Rob Herring <robh@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Apparently, merely passing policy= doesn't generate the full set of
required headers, so make sure we do set_charset('utf-8').
Reported-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Still seeing false-positives for personal follow-up trailers, so tighten
a regex a bit further to make sure we don't match bogus content.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The combined routine was too broad for parsing follow-up messages, so
this tightens it to avoid too many false positive matches.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
A common request is to support trailers that contain extra data in the
following format:
Reviewed-by: D. Eveloper <d.eveloper@example.com>
[for the code in foo.h]
This should do the right thing now, and moves trailer searching into one
place instead of being reimplemented twice.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Fixes sloppy-trailers.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Per discussion on the users list, preserve the trailer order by default.
There is no agreement on whether this is a hard requirement for patches
or not, but there is general consensus that the default should be to
make as few changes to incoming patches as possible.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Use shorter cache filenames to avoid running into OSError.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
PyCharm thinks they are redundant, and they indeed appear to be.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
I can't think of any trailers that are shorter than 2 characters, so
tweak the regex to avoid one of the possible false positives.
Reported-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
Don't check if a potential cover letter has a diffstat when processing
follow-up trailers.
Reported-by: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
When copypasting patches into mail clients, trailers sometimes get
mangled due to MUAs helpfully breaking long lines. Not sure if this
causes more harm than good, but let's try to run some tests with this.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The get_body_parts() method added in ba6c790 (Parse body parts into
usual chunks, 2020-04-27) strips lines that look like trailers from
the last paragraph, storing the other lines to add back to the
message. However, if the commit message has only a single paragraph,
get_body_parts() returns early, unconditionally returning an empty
string for the message even if non-trailer lines were encountered.
Return the collected non-trailer lines, if any, as the message.
Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
The get_body_parts() method added in ba6c790 (Parse body parts into
usual chunks, 2020-04-27) splits the commit message body on "\n---\n"
and takes the second half as the "basement" of the patch. The body is
stripped of flanking new lines, though, so a delimiter beginning with
a new line isn't appropriate for commit messages without a message
body. Make the starting new line optional.
Note that this doesn't matter in the end in terms of the final applied
patch. Before 31f33fd (Fix body part parsing when '---' is not used,
2020-06-08), the expected patch output was produced despite the diff
lines being processed as the message body. After that commit, the
information following the triple dash is a bit off, but it doesn't
matter because git discards it anyway.
Signed-off-by: Kyle Meyer <kyle@kyleam.com>
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|
|
It's a simple if/else to support maildirs for local operations, so let's
handle mbox -m to be a maildir.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
|