79 Commits

Author SHA1 Message Date
Iain Lane
d592ee61ae
LPExcuseBugsPolicy: handle the ExcuseBugs file not existing
When we're not run via b1 - for example when running the testsuite -
this file will not have been created.

Treat that as if there are no bugs to note.
2020-01-16 10:12:19 +00:00
Iain Lane
4c27eadffa
autopkgtest: store the submission time when making requests
This is so that we can see more easily see if requests are stuck
2019-11-12 23:46:30 +00:00
Tiago Daitx
da5770559c Link to update-excuse bugs on update_excuses
LP: #1683749
2019-09-17 11:53:07 +02:00
Łukasz 'sil2100' Zemczak
aa880c0d38 SRU ADT regression: add newlines to the list of failures. 2019-08-29 14:30:53 +02:00
Łukasz 'sil2100' Zemczak
36047784d9 SRU ADT regression: use the SRU team special bot-account for sending notifications. 2019-08-29 09:34:43 +02:00
Łukasz 'sil2100' Zemczak
32467742bd SRU ADT regression: use the right policy_info to determine if tests have regressed. 2019-08-28 18:29:45 +02:00
Iain Lane
879e7e1088
email: Add more debugging when sending emails
We're currently spamming an uploader, and it's hard to figure out why.
Let's output why we are deciding to do so.
2019-08-12 15:27:58 +01:00
Łukasz 'sil2100' Zemczak
e51cc58a2b Switch logic of detecting failures to looking for failed tests in policy_info. Explicitly list all failing tests in the bug comment. Change wording. 2019-07-19 15:43:54 +02:00
Steve Langasek
66036553ac Trigger linux rebuild test on upload of gcc-defaults
The update of gcc to gcc-9 introduced a regression in buildability of
anything relying on kernel headers.  This could have been caught by the
kernel's standard rebuild autopkgtest, but we currently only trigger the
linux autopkgtest for source packages named gcc-N, which excludes
gcc-defaults.

Include gcc-defaults in the list of packages that trigger a linux rebuild
test.

Bug-Ubuntu: https://bugs.launchpad.net/bugs/1836100
2019-07-10 14:30:28 -07:00
Łukasz 'sil2100' Zemczak
316fad3442 SRU ADT regression: temporarily use my e-mail in the From: header. 2019-06-25 18:49:38 +02:00
Łukasz 'sil2100' Zemczak
d21bd600cc SRU ADT regression: handle errors in sendmail. 2019-06-25 16:16:26 +02:00
Łukasz 'sil2100' Zemczak
1cbc21d258 SRU ADT regression: Fix state checking as now it again needs to include the info for distro and series. Add unit test. 2019-05-24 16:18:34 +02:00
Łukasz 'sil2100' Zemczak
49e3d7e51c SRU ADT regression: Remove the no-longer-needed state-file backup functionality as currently there's basically low risk that we'd crash mid-state-save. Add a test for this. 2019-05-23 19:08:29 +02:00
Iain Lane
c8492d4cc7
SRU ADT regression: Need to decode the returned bytes from urlopen() 2019-05-23 10:47:59 +01:00
Iain Lane
f10caba01d
SRU ADT regression: Handle unset changes_url (e.g. for syncs) 2019-05-23 10:27:24 +01:00
Iain Lane
c49f1ad8d5
SRU ADT regression: src is a dict 2019-05-23 10:26:22 +01:00
Iain Lane
bb032d98d8
SRU ADT: Be clear when printing log messages in dry-run mode 2019-05-22 17:47:29 +01:00
Łukasz 'sil2100' Zemczak
1690624d11
Add a new policy to message bugs on SRU regressions
It works like this. We wait until all tests have finished running. and
then grab their results. If there are any regressions, we mail each bug
with a link to pending-sru.html. There's a state file which records the
mails we've sent out, so that we don't mail the same bug multiple times.
2019-05-22 17:47:17 +01:00
Iain Lane
c12d92efa4
autopkgtest: Handle 'blacklisted' version
The apt version comparison sorts 'blacklisted' greater than most version
numbers, which means that we accidentally apply force hints for version
'blacklisted' to all uploads. Since this is the only case of a hacked
version number, let's special case it so that 'blacklisted' hints only
match packages with 'blacklisted' version.
2019-01-24 13:08:03 +00:00
Iain Lane
bbabac140d
Repair requests without testpkg-version
We're supposed to synthesise an "unknown" version for these, but a bug
in the worker meant we didn't do that in some cases and these leaked
into swift. Let's repair it client-side.
2019-01-21 11:20:27 +00:00
Iain Lane
0ff44d90e7
autopkgtest: Handle status '8' as a pass
This means 'all tests were skipped', or 'no tests in this package'. The
former case is new after our recent autopkgtest rebase.

Upstream britney (624b185ba60709f1686fbaa2a7623a94c5cb23ef) handles this
as "neutral", which doesn't influence the result and is a more explicit
(better) way of expressing this situation. Once we rebase, we should
take that approach.
2018-12-11 09:44:55 +00:00
Iain Lane
73b4c3b065
autopkgtest: put delivery_mode in the right place 2018-12-06 14:18:19 +00:00
Iain Lane
f8bfbfe164
autopkgtest: Make pycodestyle clean (--ignore=E501,W504) 2018-12-06 09:48:30 +00:00
Iain Lane
62ca3b16b9
autopkgtest: Publish AMQP messages persistently
We want to ask the broker to write them out to disk, hoepfully
mitigating against it crashing.
2018-12-06 09:35:39 +00:00
Steve Langasek
9f91c536be gzip doesn't use libgcc so is not a useful smoketest. Use doxygen instead. 2018-12-06 11:05:52 +02:00
Steve Langasek
dd815d14fa Replace libreoffice with gzip as the libgcc smoke test for gcc.
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1793260
2018-12-05 16:09:57 +02:00
Iain Lane
f2456289ac autopkgtest: Run gcc-n's testuite, if it has one 2018-09-06 15:30:12 +01:00
Iain Lane
3e1ee5a2ef sourceppa: Add some more logging so we can hopefully see what is going on 2018-07-31 17:42:27 +01:00
Iain Lane
400a6c57c4 email: When there are multiple SPPHs, use the last one
We were just seeing an interesting crash in britney. It was trying to
look up the gpg_keys of ~python-modules-team, which is a suspended
account - in LP API terms that's a HTTP error 410.

  https://api.launchpad.net/devel/~python-modules-team/gpg_keys

The direct error was fixed in commit 272f41c, but we actually should
*not* have been trying to look up this team's email address in the first
place. This upload was an auto-sync and so should not cause email to be
sent. The problem is that it was synced into universe and then promoted
into main. We were looking at the SPPH for after the promotion, which
has different values in the various signer/creator/sponsor/... fields,
and that made us think that it was a regular upload to email about.

Fix this by always looking at the oldest SPPH which should correspond to
the initial upload and not whatever happened to it afterwards.
2017-11-09 13:04:33 +00:00
Iain Lane
272f41c4a5 email: Ignore suspended LP people
We were looking at ~python-modules-team, which is suspended and raises a
HTTPError that wasn't being caught.
2017-11-09 11:47:47 +00:00
Iain Lane
70c325fbbf autopkgtest: Save pending.json after every test request
We just had the autopkgtest queues DoSed because britney was crashing
after requesting each reverse dependency for a perl upload, but before
it had written pending.json out so it knew what not to request again.
This was 25,000 requests per arch...

Let's write pending.json straight after sending each request, so that
the next run - even after a crash - won't re-request the same things
again.
2017-09-07 12:24:00 +01:00
Steve Langasek
5136a3efb5 Comment the calculation of last_due 2017-07-18 18:36:04 +02:00
Colin Watson
b073a71911 Check whether testsuite triggers have any binaries
We should only run autopkgtests for testsuite triggers if the source
package has any binaries on the relevant architecture, as otherwise it
should be expected to fail.
2017-07-18 12:18:28 +01:00
Steve Langasek
132ffaf465 Refine the logic for recording the nominal sent age of the mail
In the previous iteration, if we were ever down/frozen/disabled long enough
to miss sending two mails in a row, we would see unintended "catch-up"
behavior where each subsequent run of britney would send a mail until the
right total number of mails had been sent.  Don't do this; instead, catch us
up in one go to the most recent mail that should have been sent, avoiding
bunching of notifications.

This changes one of the tests also to match.
2017-07-06 21:14:19 -07:00
Steve Langasek
d5040afb84 Fix up handling of email cache
We were checkpointing after each email was sent to ensure that an aborted
p-m run didn't result in double emails; however, because the new cache only
contains records for packages we've seen so far during this run (to avoid
the cache growing without bounds over time), that means an aborted p-m run
*still* throws away records for all packages still waiting to be processed.

To fix this, we:
 - only checkpoint records of writing emails during this in-progress run to
   a temp file
 - check for this temp file on britney startup, and if present, merge the
   results into the current state
 - move this temp file into the final cache location only at the end of the
   britney run

Along the way, fix up a bug introduced in the previous commit that would have
us only saving state for those packages for which we sent email during the
current run, which would have quite bad effects.
2017-07-06 17:36:57 -07:00
Steve Langasek
27ef44e478 Rework the email frequency calculation to account for gaps in runs
The previous code had some issues with respect to how we decided whether to
send an email.  The age used for calculating when the next mail should be
sent was saved as a float rather than an integer; since p-m runs never
happen exactly an integer number of days after upload, this results in a
cumulative error in the timing of the emails, that is further exacerbated if
a particular run is significantly delayed or if p-m infrastructure is down
for a period of time.

So instead, we now calculate the age at which the most recent email /should
have been sent/, and store that in our cache instead of the precise age.

There is still a bit of surprising behavior here due to the fact that we use
two different 'max_age' values for valid vs. invalid candidate packages: a
single package can, over the course of its stay in -proposed, move from
being an invalid candidate to being a valid candidate /and back again/
without ever migrating.  Such a package will switch back and forth between
two sets of calculations based on different starting offsets, causing the
ages at which the emails are sent to vary in a non-obvious fashion.
However, this will still obey the general principle of "email reminders of
decreasing frequency", so I think this is acceptable given that it is still
an overall improvement in predictability.

LP: #1671468
2017-06-29 12:52:28 -07:00
Robert Bruce Park
9c76c762cc Tweak recurring email frequency. 2017-04-06 22:30:30 -07:00
Steve Langasek
41ac7a81f9 Drop transitional code 2017-04-06 22:30:18 -07:00
Robert Bruce Park
16cca9c55d Change SourcePPAPolicy from a blacklist to a whitelist. 2017-03-24 11:46:52 -07:00
Iain Lane
858775a3c1 email: Make REJECTED_TEMPORARILY packages be not emailed for
These are rejections that we expect to clear out on their own or convert
to REJECTED_PERMANENTLY, at which point we will email.

https://bugs.launchpad.net/britney/+bug/1671468
2017-03-23 11:10:14 +00:00
Iain Lane
e00d86ad26 email: If a package is blocked by an explicit block, don't mail 2017-03-22 17:00:38 +00:00
Iain Lane
8350694348 email: Add tests that send email through a mocked SMTP server
I want to fix two bugs in interactions between other parts of britney
and the email policy. It's not currently easy to do so because we just
run the policy itself manually by creating some fake excuses.

Steal part of the machinery from the autopkgtest tests, and run a few
tests through britney completely. Use a fake SMTP server to record which
emails we sent.

(The port is hardcoded - that might not be so smart.)
2017-03-22 16:59:50 +00:00
Robert Bruce Park
63573fa24a Resend emails periodically. 2017-03-22 09:50:50 -07:00
Robert Bruce Park
0579677457 Stop writing "1 days" in emails. 2017-03-14 11:05:10 -07:00
Robert Bruce Park
1b4828bfb3 Write email cache after every email sent. 2017-03-10 09:48:37 -08:00
Steve Langasek
442993d3f0 Merge remote-tracking branch 'robru/fix-sourceppa' 2017-03-09 14:59:40 -08:00
Robert Bruce Park
389f8624dd Round age. 2017-03-09 11:12:20 -08:00
Robert Bruce Park
e7181465a8 Stop returning None. 2017-03-09 11:04:12 -08:00
Robert Bruce Park
2405fcf8bc Backport EmailPolicy to Python 3.2 2017-03-09 18:00:22 +00:00
Iain Lane
7cc72bf2d6 email: For direct sponsored uploads, email both the sponsor and sponsoree 2017-03-09 17:16:21 +00:00