aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-01-22pwbot: fix pagination logic bug in REST resultsHEADmasterKonstantin Ryabitsev1-1/+7
We weren't doing the right thing when processing paginated data. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-07-19mlmmj-subscriber-sync: also catch OSErrorKonstantin Ryabitsev1-1/+1
Don't crash on OSError when retrieving external subscriber info (e.g. if there is a DNS lookup error). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-07-19pr-tracker-bot: add process-id to loggingKonstantin Ryabitsev1-1/+1
Trying to catch an elusive race condition, so add process-id to logging information. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-07-19git-patchwork-bot: support histogram patchesKonstantin Ryabitsev1-2/+5
When we cannot match a commit to any patches, try to regenerate it again with the histogram algorithm in case the original patch was sent using that option. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-07-18Keep DKIM and X-Developer headersKonstantin Ryabitsev1-0/+2
These headers carry important end-to-end signatures, so do not strip them when processing archives. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-15git-patchwork-bot: retry patch generation with --histogramKonstantin Ryabitsev1-5/+9
When people send patches, their output will be dependent on their local diff.algorithm setting. If they set it to something other than the default ("myers"), we may fail to generate a matching patch from the commit. When we can't find a match, try to regenerate the patch using the histogram algorithm and attempt the match again. Reported-by: Jakub Kicinski <kuba@kernel.org> Link: https://msgid.link/20230615100021.43d2d041@kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-06-02mlmmj-subscriber-sync: add ability to use a git repo for subsKonstantin Ryabitsev1-1/+32
The sync script can now use a git repository for external subscriber data. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-05-31list-archive-collector: improve marc retrievalKonstantin Ryabitsev1-16/+41
Added some features to retrieving messages from marc.info: - earlier messages don't seem to have a message-id, so we fake it now instead of completely ignoring these (they still serve a purpose) - the "backoff" time now considers how much time has elapsed since the last request to marc.info, so if we already spent a couple of seconds checking a message for spam, we don't additionally sleep an extra second - if the target mailbox already has messages in it, we will not re-download those Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-25Update mlmmj-subscriber-sync to support checksumsKonstantin Ryabitsev1-17/+75
We're now grabbing a checksums file. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-04-04Add mlmmj-subscriber-syncKonstantin Ryabitsev1-0/+157
Small helper script to synchronize mlmmj lists with external subscriber information. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2023-01-03groupsio-webhook: don't check for actionKonstantin Ryabitsev1-3/+5
Valid messages may come in with other actions than just "sent_message_accepted" (e.g. "sent_message_moderated" or "sent_message_not_subscriber"), so accept everything that contains the message payload. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-21list-archive-maker: fix msgmap.sqlite3 supportKonstantin Ryabitsev1-5/+5
The message-id's in msgmap.sqlite3 are without <>, which we actually use for mapping. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-20archive-collector: allow clean-subject to take multiple stringsKonstantin Ryabitsev1-9/+10
The things lists do to their messages is annoying. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-20list-collectors: small improvementsKonstantin Ryabitsev2-113/+136
Add a few small improvements to the list-archive-collector and list-archive-maker lists, allowing to more easier deal with partial archives. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-11Optimize emergency saving of messagesKonstantin Ryabitsev1-15/+22
Instead of duplicating code, just use a single instance of _save_emerg. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-11More debugging options for groupsio webhookKonstantin Ryabitsev1-0/+13
Should be largely backwards compatible with what we had before, but allowing us to also troubleshoot occasional 500 errors. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-10-11Rewrite groupsio-hook to add loggingKonstantin Ryabitsev2-20/+111
We're seeing some 500 errors, and to debug them we need proper logging and emergency message dumping. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-08-08mainline-when: treat 19 as the last minverKonstantin Ryabitsev1-8/+19
This may change in the future, but for now treat .19 as the last minor version before majver is incremented. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Allow list-id to be a globbing matchKonstantin Ryabitsev1-1/+1
Add ability to specify list-ids as a globbling match (even if it's just '*' for "everything"). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-27Add support to write out as maildirKonstantin Ryabitsev1-5/+15
It is periodically useful to save the archives as maildir instead of mailbox. Add support for -asmaildir. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-06-02Tweak wording on mainline-whenKonstantin Ryabitsev1-3/+9
Add a note in the vcal output that the final release may actually end up being another -rc instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-04-26Treat failures to uncompress as non-fatalKonstantin Ryabitsev1-2/+6
We shouldn't crash out if we got a corrupted download. This script is looking specifically at bad signatures -- a download that won't even properly uncompress is probably not trying to sneak in badness. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-04-26Adjust default sig-prover node listKonstantin Ryabitsev1-4/+3
We're migrating the nodes to their new homes on Equinix gen3 systems, so adjust the list of edge sites accordingly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-02-01mainline-when: fix var scoping issuesKonstantin Ryabitsev1-3/+3
It worked, but it was a bug waiting to happen. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-01-31mainline-when: rework to remove depedencies and generate .icsKonstantin Ryabitsev1-37/+120
- removes dependency on python-packaging - switches to using logger calls instead of print() - adds ability to generate .ics files Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-01-31mainline-when: add a tiny script to estimate datesKonstantin Ryabitsev1-0/+96
Help people estimate kernel release dates. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-01-25Fix hash generation after switching to "git show"Konstantin Ryabitsev1-17/+23
When I switched to "git show" I didn't fully test whether it would generate the same patchwork hashes as "git diff" proper. The few sample tries I ran happened to do the right thing, but many other commits would generate different hashes. Make sure we ignore anything that comes before we find "diff " on the line. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2022-01-25patchwork-bot: add ability to match by msgidKonstantin Ryabitsev1-87/+70
Patchwork API 1.2 allows us to match by msgid, so update patchwork-bot to use Link: trailers for additional matching when we are unable to match by patchwork hash. Additionally, reworks caching that wasn't actually saving us any time and drops the use of git patch-id that we used in the absence of msgid matching. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-12-16Revert "patchwork-bot: Ignore empty context lines"Konstantin Ryabitsev1-3/+1
This reverts commit 8998144862b16cfa7a2ec07757d43ca269d59373. Unfotunately, this change broke matching for other patches, so roll it back to the way it was. Reported-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-12-14patchwork-bot: add support for --tokens-fileKonstantin Ryabitsev2-4/+19
We want to be able to share our configuration with others, which requires that we keep secrets in a different file than the rest of the logic. Suggested-by: Kees Cook <kees@outflux.net> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-12-14patchwork-bot: add proper typing hintsKonstantin Ryabitsev1-57/+75
It helps to catch easy bugs when writing in PyCharm and other IDEs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-12-14patchwork-bot: remove xmlrpc vestigesKonstantin Ryabitsev1-124/+104
We used to need xmlrpc because API < 1.2 didn't expose ability to search patches by hash. Now that it's available in API 1.2, we can get rid of all xmlrpc calls and just leave the REST api support. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-12-13patchwork-bot: Add --pwhash for debuggingKees Cook1-0/+20
Finding a 2-character whitespace difference between patches with different patchwork hashes strained my sanity, so I want to keep the tooling I built to track it down. Using "--pwhash PATCH-ID", patchwork-bot will compare the given patch in patchwork (and its hash) against the diff from stdin (and its hash). Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211202233836.2024510-3-keescook@chromium.org
2021-12-13patchwork-bot: Ignore empty context linesKees Cook1-1/+3
It seems that there is some mismatch in diff output (or storage?) between git and patchwork under conditions I haven't figured out (MUA or MTA whitespace stripping?): patchwork appears to ignore empty context lines (i.e. a line that is only a single space). As a result, the patchwork hash will not match, and commits will not be identified in patchwork. As an example of a commit in upstream that patchwork-bot cannot locate in patchwork due to a different hash, due to the differing empty context lines: $ MSGID=20210911102818.3804-1-len.baker@gmx.com $ wget -qO- https://patchwork.kernel.org/project/linux-hardening/patch/$MSGID/raw/ | \ grep '^ $' | wc -l 0 $ SHA=f11ee2ad25b22c2ee587045dd6999434375532f7 $ git diff ${SHA}~..${SHA} | \ grep '^ $' | wc -l 2 Teaching patchwork-bot to ignore empty context lines allows pwhashes to match in these cases, which lets those patches get located again. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211202233836.2024510-2-keescook@chromium.org
2021-12-13patchwork-bot: Allow initial database to skip recent commitsKees Cook1-3/+11
To test patchwork-bot, it is helpful to create the initial database without a certain number of the latest commits, so that on the next execution, the "missing" commits will appear new, and will be used for processing state changes. Add the --ancestors argument (defaulting to 0, the existing behavior), to provide this ability. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-6-keescook@chromium.org
2021-12-13patchwork-bot: Handle repo being a worktreeKees Cook2-2/+26
Locate the real git location when operating on a worktree, allowing multiple pw.db files to be stored in a single top-level git repo. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-5-keescook@chromium.org
2021-12-13patchwork-bot: Allow limiting heads to single branchKees Cook2-3/+5
To sanely use a single git repository with multiple worktrees, it must be possible to limit the commits by branch (otherwise all commits are visible for all worktrees). Add an optional "branch" argument for this limit. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-4-keescook@chromium.org
2021-12-13patchwork-bot: Create CACHEDIR if it is missingKees Cook1-0/+3
Create the CACHEDIR if it is missing (e.g. the first time git-patchwork-bot is executed). Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-3-keescook@chromium.org
2021-12-13patchwork-bot: Note which actions are part of "housekeeping"Kees Cook1-1/+1
Expand the --help text slightly to remind users what things the "housekeeping" option does. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20211201001126.4106635-2-keescook@chromium.org
2021-10-07git-patchwork-bot: use shortened refname in noticesKonstantin Ryabitsev1-2/+2
The refname is always going to be a branch, so remove "refs/heads/" in all notices being sent. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-06git-patchwork-bot: bugfixes and template changeKonstantin Ryabitsev2-7/+12
A few fixes in the patchwork-bot after intial trial runs. Change the default template to mention who the committer is when sending submitter notifications. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-06git-patchwork-bot: use a global lockKonstantin Ryabitsev1-8/+8
When running operations that require the shared cache database, make sure that only a single instance of the bot is running. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-06git-patchwork-bot: First go at committer informationKonstantin Ryabitsev1-14/+27
An oft-requested feature is showing who it was that committed the patch to the repository. Add committer info to the summaries and submitter notifications. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-06bugzilla-junker: set as executableKonstantin Ryabitsev1-0/+0
Set mode to 0755 for the bugzilla-junker script. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-10-06git-patchwork-bot: Handle more merge commit formatsKonstantin Ryabitsev1-8/+16
When recognizing merge commits, handle merge messages that do not mention the refname of the remote. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-27Update git-patchwork-bot to use API 1.2Konstantin Ryabitsev1-7/+12
The latest API offers some improvements we can use in the near future. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-27Add bugzilla-junkerKonstantin Ryabitsev2-0/+386
This is a helper script I use to keep tabs on spam posted to bugzilla.kernel.org. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-27Add the groupsio webhookKonstantin Ryabitsev1-0/+119
This is the backend that receives webhook events from groups.io and feeds them into the local postfix queue for indexing with public-inbox. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-09-15Add initial support for mailman3 archivesKonstantin Ryabitsev1-26/+105
Hyperkitty mangles things in similar, but slightly different ways from pipermail. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-05stable-builder.py: add help text for what the valid commands areGreg KH1-0/+16
I always need to look up how to use the script, so have the script provide a help command to show the valid commands. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-08-05Use list_all_devices to avoid paginationKonstantin Ryabitsev1-1/+1
We always want all devices, regardless of how many pages we get back. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-07-20Tweak output for pipermail processingKonstantin Ryabitsev1-0/+1
Show how many messages in each processed archive. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-07-15Add pi-origin-maker toolKonstantin Ryabitsev1-0/+224
This creates refs/meta/origins entries for public-inbox archives. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-05-21Use construct more tolerant to unicode failuresKonstantin Ryabitsev1-2/+7
When we iterate directly through messages, unicode or other parsing errors cause us to BT on the entire mailbox. Iterating by key allows us to only skip individual unparseable messages. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-15list-archive-maker: better handle mails with misencoded real namesUwe Kleine-König1-2/+9
Without this change list-archive-maker just dies with an Exception Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210414141235.26630-2-u.kleine-koenig@pengutronix.de
2021-04-15list-archive-maker: collect recipents in lists instead of stringsUwe Kleine-König1-14/+8
This is more pythonic and should also be quicker to execute. Note there is an (intended) side effect of this change. If cc already contains "twentyone@example.com" and pair[1] is "one@example.com", the latter was detected as already contained in cc. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org> Link: https://lore.kernel.org/r/20210414141235.26630-1-u.kleine-koenig@pengutronix.de
2021-04-15Add DCOKonstantin Ryabitsev2-1/+47
Add DCO from developercertificate.org and indicate that all contributions must carry a Signed-off-by: line. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-15Remove obsolete scriptsKonstantin Ryabitsev2-1731/+0
Both attest-patches and get-lore-mbox are now part of b4. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-14Adjust email address in READMEKonstantin Ryabitsev1-4/+3
Tell people to send patches to tools@linux.kernel.org. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-01Fix for when mailhost is not definedKonstantin Ryabitsev1-1/+1
Minor bug with using an undefined value. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-01Show which keyring we are usingKonstantin Ryabitsev1-3/+3
Indicate which keyring we are using when verifying signatures. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-01Tweak sig-prover header (instructions)Konstantin Ryabitsev1-3/+7
Mention that it can be run as a simple background process. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-01Copy admonition from the commitKonstantin Ryabitsev1-0/+14
Make sure the admonition about not relying too much on sig-prover is plainly visible. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-04-01Add sig-proverKonstantin Ryabitsev6-0/+494
Sig-prover is a tool I use to random-check mirrors for signs of tarball corruption (or worse). It will download random kernel/git/etc tarballs fron the frontends and verify them against the signatures, alerting when there is a verification failure. This script is not a guaranteed mechanism to detect intrusion -- an attacker can defeat it by analyzing access patterns/IPs and serving different content when it suspects that someone is running an automated signature verification check. The script can probably be improved by adding random delays between retrieving the tarball and the detached signature, setting a referrer value, etc. However, even with added measures, it will always act fairly predictably, so there will always remain a way to defeat it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-03-26Fix mailman demanglingKonstantin Ryabitsev1-9/+8
Make it more generic without a pre-check. May not even be slower. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-03-22Include the stable-builder minibotKonstantin Ryabitsev3-0/+353
This is used by Greg KH to bring up a builder in Equinix Metal (and to have it auto-ripped if he forgets to destroy it manually). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-03-07Don't use CDN for checksums fileKonstantin Ryabitsev1-1/+1
Some users are running against stale cache problems with the checksums file, so grab it directly from the origin servers instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-02-18Update CDNBUNDLE defaultsKonstantin Ryabitsev1-3/+3
Bundle files are now too big to be handled by cdn.kernel.org (Fastly), so use canonical URLs that will redirect to mirrors.edge.kernel.org. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2021-02-17Make sure we cast the header to stringKonstantin Ryabitsev1-1/+1
I'm not sure why Python doesn't just return one or the other, but make sure it's always a string before we try to operate on it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Don't die on bugs in python's email moduleKonstantin Ryabitsev1-3/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Handle From lines without @Konstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Be more conservative assuming mbx formatKonstantin Ryabitsev1-5/+4
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27More handling of non-mangled mailman archivesKonstantin Ryabitsev1-13/+15
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Don't demangle From: if it's not mangledKonstantin Ryabitsev1-6/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Fix crasher on missing From: addressKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-27Deal with mailman archives that don't mangleKonstantin Ryabitsev1-5/+9
Those do exist! Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-16Fix mailman archive downloadsKonstantin Ryabitsev1-6/+9
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-13Default to project-level fromstatesKonstantin Ryabitsev1-1/+1
Don't redefine fromstate, just take what is defined at the project level. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-11-02Do not attach identical rev-list files twiceKonstantin Ryabitsev1-15/+21
There can be changes to multiple refs that have identical ranges. Don't attach multiple identical files in that case. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-23Add post-receive-activity-feedKonstantin Ryabitsev1-0/+165
This is the hook that we are rolling out to generate the activity feed suitable for historical (and forensic, should it ever be necessary) analysis. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-20Split list-archive-maker into two scriptsKonstantin Ryabitsev3-210/+661
Move all operations for collecting remote archives into list-archive-collector.py, adding a way to import marc.info archives. We also add several other useful options to list-archive-collector: - With -k, we can check if we already have a copy of that message on lore.kernel.org and backfill many of the important headers that are missing from pipermail and (especially) marc.info sources. - With -s and prsence of /usr/bin/spamc, we'll check the message for spam before accepting it - The generated .mbx file can then be used with list-archive-maker.py to create the final archive sources for importing into public-inbox. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-16Improve autoarchive housekeepingKonstantin Ryabitsev1-7/+14
We stopped auto-archiving as soon as we came across a page containing patches past the cutoff date. However, for projects with a handful of patches this meant that the entire page needed to fill up before we auto-archived any eligible patches. This change goes through all patches on the page before stopping. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-05Only add cc's if we're not doing "onlyto"Konstantin Ryabitsev1-16/+18
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-05Fix typo that should totally have been lintedKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-10-05Fixes and a new 'ccall' featureKonstantin Ryabitsev1-34/+45
Specifying "ccall" on a configuration will cc everyone who got mentioned in the "to" or "cc" fields. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-09-25Don't require -r for housekeepingKonstantin Ryabitsev1-2/+5
We don't need reposdir when we're running housekeeping tasks, so don't require that argument. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-09-25Fixes for git-patchwork-bot and an example.yamlKonstantin Ryabitsev2-17/+181
Finally, provide an example config file that everyone's been wanting. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-09-24Initial version 2.0Konstantin Ryabitsev1-570/+646
Lots of changes in this one: - Drop support for python < 3.6 - Migrate to using a yaml file for configuration - Implement some suggested features Still testing and example config file to come. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-09-02Warn everyone that get-lore-mbox is obsoleteKonstantin Ryabitsev1-0/+5
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-08-05Updates to pr-tracker-botKonstantin Ryabitsev1-88/+61
Migrate to python3 and stop using git repos for config (too messy). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-06-01POSIX compatibility for linux-bundle-cloneCem Keylan1-22/+16
Made some minor changes to make the script POSIX compliant and some nitpicks to simplify the script. Removed the if statements and replaced them with logical operators. Also used default variable assignments to skip some checks to make the script smaller. Changed the temporary name of the bundle as some implementations of mktemp (such as busybox) do not allow any name after the 'XXXXXXX' part. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-19Don't set references on summary emailsKonstantin Ryabitsev1-6/+6
Setting references to multiple thread parents is discouraged by the RFCs and causes unrelated messages to be grouped together by public-inbox. Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-12Preserve original order of identical trailersKonstantin Ryabitsev1-1/+2
Because we go backwards from the --- line, multiple identical trailers like "Signed-off-by" ended up reversed from the initial order. This commit reverses them back. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-10Add more fuzzy trailer matching logicKonstantin Ryabitsev1-2/+32
Will now also accept trailers if: - there's a full match for local part and partial match for domain part of the email in from/trailer - we find a comma in the name and match the trailer after rearranging it Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-09Relax trailer sanity-checking to match by nameKonstantin Ryabitsev1-4/+5
We reject trailers that don't match the email address in the From: field, but this can be too strict for our purposes. Relax the rule to also allow matching by name. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-09Implement strict thread matchingKonstantin Ryabitsev1-2/+49
Public-Inbox will return loosely matched threads, which is almost never what we want for get-lore-mbox. This version implements strict thread matching to make sure that we only pay attention to messages that have clear references to the message-id passed as parameter. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-06Handle subsequent patches without versioningKonstantin Ryabitsev1-4/+23
Single patches are often posted in the same thread without any version info, so auto-number revisions if they are newer and from the same author (plus a slew of other sanity checks). Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-06Use the proper patch when guessing series startKonstantin Ryabitsev1-3/+7
For hairier threads, we were wrongly guessing the series-starting patch if one of the older non-numbered, non-versioned emails happened to contain a diff (side-effect of trying to match more corner cases). We will now properly replace the incorrect guess when coming across a better match. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-03-02Add option to process a local mbox fileKonstantin Ryabitsev1-44/+57
If there are problems with the thread that result in missing patches (e.g. an omitted "v2" in the middle of the series), you can add a few manual fixes to the mbox file before telling get-lore-mbox to make an am-ready version out of it. This also lets you bypass using lore.kernel.org completely if you want to save patches out of your local mail client instead of always grabbing them from lore. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-28Do not BT when we are unable to parse atomKonstantin Ryabitsev1-1/+7
Eventually, we won't be using the atom feed for this, but for now we might as well not backtrace when we cannot parse it. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-28A few updates to attest-patches.pyKonstantin Ryabitsev1-19/+58
- Attempt to deliver via mail.kernel.org:587 - Accept patch from Kees Cook to set custom From: header - If we find a cover letter, set attestation subject to match Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-26Use the UID that matched From in the trailerKonstantin Ryabitsev1-5/+8
Unless we're running with -F that ignores From/UID mismatches, we will now use the matching UID in the Attestation-by trailer. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-26Tweak attestation trailer wording a bitKonstantin Ryabitsev1-3/+4
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-26Print out an attested-by lineKonstantin Ryabitsev1-1/+5
We need to see who is the person attesting the patches. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Fixes to deal with multiple attestationsKonstantin Ryabitsev1-6/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Add -T option that does not touch trailersKonstantin Ryabitsev1-4/+11
This is handy for use with attest-patches, though eventually attestation will be rolled into get-lore-mbox itself. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Add a few more user-friendly optionsKonstantin Ryabitsev1-6/+18
- Skip messages not containing patches (like cover letters) - Add option to not fast-exit (-X), which is handy for testing Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Add a few more features to attest-patchesKonstantin Ryabitsev1-86/+122
- Add an option to ignore From/UID mismatches - Add an option to force TOFU/default-good trust model - Add an option to load attestation data from a local file instead of always querying lore.kernel.org Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Don't use the Date header for attestationKonstantin Ryabitsev1-3/+23
Tools like git-send-email don't preserve the Date: header as in the body generated by git-format-patch, so we cannot rely on it for attestation purposes. See: https://lore.kernel.org/git/20191213015753.GA14249@generichostname/T/#u Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Add attest-patches.py proof of conceptKonstantin Ryabitsev1-0/+429
This is a proof-of-concept script for submitting patch attestation. It should not be used without more work, as it almost certainly doesn't consider a bunch of potentially malicious corner cases that would give wrong attestation results. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Remove quotes from subject-based queriesKonstantin Ryabitsev1-1/+1
When there is a quote in the subject, we need to remove it in order for the xapian "phrase-in-quotes" search to work. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-25Handle a handful of corner casesKonstantin Ryabitsev1-10/+29
- Deal with exchange not setting in-reply-to and only setting References - Don't BT when dealing with follow-ups to missing cover letters - Be more forgiving for patches missing [PATCH] in the subject Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-24Don't BT when the cover letter is missingKonstantin Ryabitsev1-5/+9
Properly handle cases when the cover letter is missing from the thread. Reported-by: Rob Herring <robh@kernel.org> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-20Match binary blob patches sent to linux-firmwareKonstantin Ryabitsev1-4/+7
Handle special case when patches don't contain ---/+++ because they are a "GIT binary patch". Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-20Be better matching whitespace in multiline regexKonstantin Ryabitsev1-3/+3
When we need to do multiline regexes, make sure we don't match linebreaks when we mean for a regex to only match a single line. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-20Deal with missing messages in the threadKonstantin Ryabitsev1-2/+2
When doing trailer collating, don't break if there are missing messages in the thread. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-17Handle patches sent as attachmentsKonstantin Ryabitsev1-11/+18
If we find a text/plain part, but also anything matching text/plain or */x-patch that contains a diff, then we'll use the patch containing a diff instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-17Handle another corner case with prefixesKonstantin Ryabitsev1-1/+3
Now should properly handle commas, e.g.: [PATCH 01/02, FOO]. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-17Fix TB on 8bit headers in older pythonKonstantin Ryabitsev1-18/+7
Getting a message as_bytes() before adding it to the am-ready mailbox allows us to pass the policy that avoids triggering some of the odder bugs in older versions of python. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-13Make sure follow-up trailers match email in FromKonstantin Ryabitsev1-5/+22
This is mostly to avoid bogus matches, but adds a small layer of sanity checking. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-13Handle [PATCH 6/5] and URLs instead of msgidsKonstantin Ryabitsev1-32/+41
Also, makes trailer-order configurable via ~/.gitconfig, e.g.: [get-lore-mbox] # remember to end with ,* trailer-order=link*,fixes*,cc*,reported*,suggested*,original*,co-*,tested*,reviewed*,acked*,signed-off*,* Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-13Use requests sessionKonstantin Ryabitsev1-10/+15
Instead of using requests directly, open a session instead. This makes it both faster and allows us to set global user-agent header. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-13Fix -t suggestion formattingKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-13Add -Q to save the mbox as quilt patchesKonstantin Ryabitsev1-11/+65
By popular demand, add -Q, which will write out a directory full of patches and the "series" file that can be manipulated using quilt. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-12Bugfixes and better handling for trailersKonstantin Ryabitsev1-40/+133
Switched away from using git-interpret-trailers in order to offer a way to reorder trailers and to stick additional trailers within the same block of others already present (if any). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-12Deal with a few more prefix corner-casesKonstantin Ryabitsev1-3/+4
Specifically, be forgiving of someone finger-fumbling [PATCH v2 xx/nn] as [PATCHv2 xx/nn]. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-12Refactor get-lore-mboxKonstantin Ryabitsev1-305/+496
As the feature set grew, it became obvious that the structure needed to be less hacky (initial code was just barely beyond a proof of concept). This moves most of the am-mangling code into classes where it makes much more sense, plus makes debugging easier. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-11Gracefully bail if all patches are missingKonstantin Ryabitsev1-0/+4
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-11Properly decode non-utf8 message contentKonstantin Ryabitsev1-1/+8
Actually pay attention to what the charset says in the message headers for the few holdouts who are still sending things as iso-8859-1. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-11Show friendlier errors for some failuresKonstantin Ryabitsev1-1/+7
We're already returning Nones when something isn't doing the right thing, but we aren't properly checking for them. This fixes two of the reported cases. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-10Fix for when in-reply-to is not in the threadKonstantin Ryabitsev1-1/+1
Work around for a logic bug when trying to find non-standard cover letters. Reported-by: Greg Kroah-Hartman <greg@kroah.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-05Fix a cover letter bugKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-05Better support for odder msgid headersKonstantin Ryabitsev1-3/+6
Found an In-Reply-To that was not just a <foo>, so handle those cases better with a regex. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-04Messages with diffs can't be cover lettersKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-04Add a feature to fetch newer series revisionsKonstantin Ryabitsev1-57/+224
You can now pass "-c/--check-newer-revisions" to query lore.kernel.org for never revisions to a series. I'm not overly fond of how this is done -- it will need rewriting once lore/public-inbox supports proper search-based API. However, it does its job and is what maintainers are asking for. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-03Make sure trailers are uniqueKonstantin Ryabitsev1-1/+1
Make sure that all trailers are unique by making a set out of them. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-03Add -t/--apply-cover-trailers optionKonstantin Ryabitsev1-11/+34
When a trailer is sent in reply to the cover letter, give an option to apply it to all patches. We don't do it by default because sometimes developers include verbal caveats like: For patches 1-5, you can add: Reviewed-by: Foo Foofski <foo@example.com> In this case blindly applying this trailer to all patches would convey wrong information. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-03Better de-miming supportKonstantin Ryabitsev1-15/+18
Some of the more complex mime messages were returning wrong parts instead of patch content, so make sure that when we're looking for a patch, we get the patch. Also, call git interpret-trailer once for multiple trailers added. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-03Don't encode any of the messagesKonstantin Ryabitsev1-5/+13
We aren't sending these via smtp, so remove all legacy encoding schemes from the headers (base64, quoted-printable, etc). We always write 8bit utf-8. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-02Fixes and revamps after more testingKonstantin Ryabitsev1-57/+80
Notable changes: - Saves the cover letter as a separate file, to make it "git am" operation more streamlined (no need to --skip right away when a cover letter is included) - More reliable handling for base-commit information - Fixes single-patch submissions Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-01Make -q output more usefulKonstantin Ryabitsev1-7/+8
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-02-01Improvements based on feedback from LinusKonstantin Ryabitsev1-38/+129
- Give thread summary after saving (without -a) - Be less verbose by default when saving with -a - Remove raw inbox after making an am-version - Remove most of the header bloat in the am-ready mbox - Remove any mime data from the am-ready mbox and save as 8bit (this makes manual editing much simpler) - Try to figure out what the cover letter is, even if it's not using the 00/NN notation - Try a few more ways of figuring out base-commit information Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-31Don't go back on seriesKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-31Return a useful error for unknown msgidsKonstantin Ryabitsev1-1/+4
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-31Add a few more tweaks to get-lore-mboxKonstantin Ryabitsev1-7/+9
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-31Fixes for a Unicode errorKonstantin Ryabitsev1-12/+18
Decode payloads from base64 before collating trailers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-31Initial version of get-lore-mboxKonstantin Ryabitsev1-0/+312
This gets you full threads from lore.kernel.org using just a single message-id of a message anywhere in that thread. It can also create mbox files ready for use with "git am", with all trailers tallied up. Needs more testing, but generally works fairly well. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-21Tweak wording in sendmail-pi-feed instructionsKonstantin Ryabitsev1-3/+11
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-21Add sendmail-pi-feedKonstantin Ryabitsev1-0/+95
This is an extremely simple implementation of a sendmail wrapper to create public-inbox developer feeds. It only needs bash and git and is written to be used with git-send-email. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2020-01-11Always commit after prepping new epochKonstantin Ryabitsev1-0/+2
If we prepped new shard, always commit the db transaction in case there are no new changes to the previous epoch between the runs. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-10-18Not all pull requests have the word "git"Konstantin Ryabitsev1-1/+1
It would be best if we could just search by series that contain a pull_url field, but we can't. So, relax this search and iterate through a larger set, but catch more flies. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-10-11A couple of hotfixesKonstantin Ryabitsev1-2/+2
- don't crash when pagedata is None (no more results) - fix regex used to recognize pull request merges Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-10-07Small cleanup tweaks to logging, mostlyKonstantin Ryabitsev1-14/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-10-07Support "cclist" as config optionKonstantin Ryabitsev1-3/+11
This allows us to send notification cc's to the list without needing to specify the list email in the config file. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-10-07Initial support for pull requestsKonstantin Ryabitsev1-5/+102
This is not as good as pr-trackert-bot, but should cover most common cases. Patchwork needs to recognize some of the less common formats for pull requests (the way we do with pr-tracker-bot), and when it does this should automatically improve as well. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-09-26Fix for multiline Cc: entriesKonstantin Ryabitsev1-11/+12
The following message did not get proper cc's set in the body of the message because Cc: is spread across multiple headers. This should fix the problem. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-08-29Tweak trusted comment contentKonstantin Ryabitsev1-1/+2
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-08-28Add minisign support to git-archive-signerKonstantin Ryabitsev1-1/+69
Minisign is still a bit of a second fiddle to PGP, but at least this puts it on the map. To enable, at least the following bit needs to be set either in ~/.gitconfig or in .git/config of the repository where the signing is done: [archive-signer] use-minisign = yes Other options you can add to that are: minisign-key = path/to/minisign.key minisign-gpg-passphrase = path/to/minisign-passphrase.gpg The latter option is handy if you don't want to remember the minisign passphrase and would instead prefer gpg-agent to decrypt it and provide to minisign when needed. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-08-05Check Re:plies as well as thread startersKonstantin Ryabitsev1-3/+3
Sometimes a new pull request will come in as a response to an existing pull request that got turned down. Check messages matching those subjects as well. See: https://lore.kernel.org/lkml/CAJ-EccOqmmrf2KPb7Z7NU6bF_4W1XUawLLy=pLekCyFKqusjKQ@mail.gmail.com/T Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-08-05Don't put debug data into logs unless -vKonstantin Ryabitsev1-1/+4
This reduces log bloat significantly. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-06-30Fix for multiple stable versions availableKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-05-22Fix typo in regexKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-05-22Be more inclusive when stripping prefixesKonstantin Ryabitsev1-1/+1
If we only have [\w+], then we don't match prefixes like [for-next,v2], and therefore miss series we can auto-supersede. Do a lazy wildcard match instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-03-19Fix off-by-one in get_unprocessed_prsKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-03-13Properly roll over between public-inbox shardsKonstantin Ryabitsev1-174/+127
This does a much better job of handling shard roll-over. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-02-12Handle cases where refname is tags/fooKonstantin Ryabitsev1-5/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-02-11Look up shortname refs in proper orderKonstantin Ryabitsev1-7/+18
We were not using proper order when looking up remote refs, for details see this thread: https://lore.kernel.org/lkml/CAHk-=wg9yvP3hGVRSnc=8qoj0g7_zt=_2FjmgSAu-0DViyFtaw@mail.gmail.com This fix changes the order to properly match heads and be more correct when handling shortnames in general. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-02-11Support roll-over between shardsKonstantin Ryabitsev1-2/+25
The LKML is about to roll over from shard 6 to shard 7, so add some logic to properly handle situations where we have tracked messages referring to commit-id's from the previous shard. It's a bit hacky, but it should do the job. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-25Simplify To/Cc normalization code a bitKonstantin Ryabitsev1-24/+32
This ensures that we don't duplicated To/Cc addresses when processing potentially multiple header entries. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-25Cosmetic cleanups for the linterKonstantin Ryabitsev1-2/+2
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-25Match list IDs case insensitivelyDaniel Jordan via RT1-7/+11
More mail will be matched this way, so that messages with mixed-case list addresses (e.g. Linux-MM@kvack.org) are included. Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
2019-01-25handle multiple To: and Cc: fields in malformed emailsDaniel Jordan via RT1-1/+34
Emails should have at most one To: and one Cc: header, but sometimes malformed ones have more than that, causing 'notourlist' false positives and leaving legitimate messages out of the archive. Collapse multiple identical headers into one. Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
2019-01-25include Resent-to: header when collecting messagesDaniel Jordan via RT1-1/+3
Sometimes a message is sent to a mailing list using the Resent-to: header. Check for this so these types of messages aren't missed. Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
2019-01-21Rework how we check if a PR has been appliedKonstantin Ryabitsev1-52/+58
A not entirely unexpected event happened when a Pull Request showed up in a public-inbox repo after it's already been merged into the repository. In this case, it was due to mailserver delay, but this will likely happen again in the future simply due to the nature of email and mailing lists. On the "mail thank-yous" run, instead of iterating through the new commits since the last run, go through the outstanding PRs and see if we can find them in the repository by running "git branch --contains $commit_id". If we get a refname, then that PR has been applied and we can thank the person for it. This is a bit heavier than the previous incarnation, since we are now checking this on every run instead of only when we find new revs in any of the heads. However, this is still sufficiently light not to worry about it too much. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-16Small cleanups for consistencyKonstantin Ryabitsev1-20/+20
I'm also testing the push hook using this repo. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-16Handle pre-push hook behaviour more properlyKonstantin Ryabitsev1-28/+68
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-16Initial go at the git-verify-to-tip scriptKonstantin Ryabitsev1-0/+90
This allows verifying that all commits are signed either from the last annotated tag, or all the way to an arbitrary commit object in the past. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-15First go at adding nttp import supportKonstantin Ryabitsev1-12/+58
Needs initial test runs, but looks promising. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-11Strip leading [prefixes] from series namesKonstantin Ryabitsev1-0/+5
Usually, patchwork will strip those if it recognizes them as prefixes, but it will miss some of them. Be more agressive than patchwork here. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-11Replace spaces with dashes in state namesKonstantin Ryabitsev1-1/+2
Patchwork sneakily replaces spaces with dashes in state names for REST API purposes. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-11Patchwork replaces spaces with dashes in stateKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Lots of small cleanupsKonstantin Ryabitsev4-107/+105
This makes the linter happy and makes the shell scripts more uniform. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Strip message-id of any trailing whitespaceKonstantin Ryabitsev1-0/+4
Reported-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Tweak the URL regex to be more strictKonstantin Ryabitsev1-4/+4
We're now matching too many things, so rework a bit to better eliminate false-positives. Also, fix locking so it's actually doing what it needs to do. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Use custom make_msgid for saner message-IDsKonstantin Ryabitsev1-2/+16
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Support git@github.com style URLsKonstantin Ryabitsev1-2/+2
Fixes: https://lore.kernel.org/lkml/20190109180501.12290.85607.pr-tracker-bot@pdx-korg-gitolite-1.ci.codeaurora.org/ Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-09Don't force a slash in commit linkKonstantin Ryabitsev1-3/+3
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-08Add settable "fromstate" config variableKonstantin Ryabitsev1-3/+10
If a patch is marked as "Mainlined", then we don't want to go back to mark it as "Accepted". Unfortunately, patchwork does not expose the "work required" field of the state, so we can't rely on that. However, for the vast majority of cases, we only want to consider patches that are either "new" or "under review" (and we can tweak this via the config value if we need to add more states to that). Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-03Quickfix for logging tracebackKonstantin Ryabitsev1-1/+1
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2019-01-03Rely solely on dates for series supersedingKonstantin Ryabitsev1-18/+26
There are cases where devs aren't using v1, v2 quite as patchwork expects them to do it, e.g. there will be: [foo] Fix foo with bar followed by: [foo,v1] Fix foo with bar These both would be marked as "v1" by patchwork, so use dates to figure out which series supersedes which regardless of prefix markers. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-18Fix for when there are multiple cc headersKonstantin Ryabitsev1-1/+4
An email should theoretically only have a single cc header, but sometimes that's no the case. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-13Don't send a report when summaryto not setKonstantin Ryabitsev1-0/+8
Fixes traceback for reportless housekeeping. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-13Use X-Patchwork-Bot: notify header logicKonstantin Ryabitsev1-29/+34
Some people don't want to litter their cc's with notify@kernel.org, so let them set a special header instead. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-05Fix logic for onlyifcc and handle lowercase cc'sKonstantin Ryabitsev1-1/+3
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-05Don't try to get emails out of a NoneTypeKonstantin Ryabitsev1-3/+7
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-05Improve email quoting and exclusion rulesKonstantin Ryabitsev1-12/+42
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-04Deal with multipart-signed pull requestsKonstantin Ryabitsev2-10/+21
And, really, multipart-html requests, even though we won't see them on a VGER list. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-03Check before deleting patch from cacheKonstantin Ryabitsev1-1/+3
Not sure how this is triggered -- I'd expect the patch_id to always be in that list. Pretty sure this is just a manifest of another bug. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-12-03Significant rework to improve notify_submitterKonstantin Ryabitsev1-245/+337
We're now only using the xmlrpc API to query for hash matches -- everything else is done via the REST API. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
2018-11-30Sort by submitter/name instead of submitter/idKonstantin Ryabitsev1-1/+1
The patches can arrive out of order, so patch_id may not represent the order in the series. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>