877 Commits

Author SHA1 Message Date
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
ff553758a6 run-autopkgtest: Add persistent messages
This means the server should write them to disk as soon as possible, so
they can be recovered if it crashes.
2018-06-08 09:25:59 +01:00
Iain Lane
c3fe5dc897 run-autopkgtest: Pass SUDO_USER as the requester if it's set
No place to hide
2018-05-02 12:56:34 +01:00
Steve Langasek
100a3f4e90 adjust variable name for ubuntu-sru as well 2018-04-08 23:45:02 -07:00
Steve Langasek
336b115ab5 adjust variable name so that hints files can reflect actual team names 2018-04-08 22:04:35 -07:00
Steve Langasek
82b448e3ad devel series hints are governed by the release team, not the archive team 2018-04-08 12:41:58 -07:00
Mathieu Trudel-Lapierre
88b4d023ad Use the CSafeLoader YAML loader to catch issues with complex objects 2018-03-08 13:30:00 +01:00
Mathieu Trudel-Lapierre
b16530a37d Flatten the defaultdict(set) for unsat_deps into a standard dict for output 2018-03-08 13:27:52 +01:00
Mathieu Trudel-Lapierre
f32907acea Fix review issues. 2018-03-08 11:11:44 +01:00
Mathieu Trudel-Lapierre
80bf9060de Re-add 'unsatisfiable dependencies' information which dropped with the excuses key. 2018-03-06 17:32:13 +01:00
Steve Langasek
94bffad136 As near as I can tell, the 'excuses' element within the yaml data is a
complete duplication of other structured data elsewhere in the yaml, and
does nothing but slow down the yaml parsing.  So, just avoid emitting it.
2018-03-02 17:01:31 -08:00
Steve Langasek
0969097d48 Turn on arm64 for autopkgtest. 2017-11-21 23:52:41 -08:00
Steve Langasek
c4c3c21387 Add support for 'team' hint files, so we don't have to manage them by individual team member names 2017-11-14 08:28:39 -08: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
Brian Murray
c2de27c3b3 Add in some more SRU team members and sort alphabetically. 2017-09-28 10:51:27 -07: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
Andy Whitcroft
593acb2753 run-autopkgtest: note that --bulk is best efforts
We only currently support low-priority jobs via the ubuntu/huge-ubuntu
queue pairs.  For ppa and upstream jobs there is no low priority option
currently.  Clarify this in the description.

Signed-off-by: Andy Whitcroft <apw@canonical.com>
2017-08-02 01:14:18 +01:00
Andy Whitcroft
4af147c787 run-autopkgtest: add --bulk option to direct ubuntu jobs to the huge queue
Signed-off-by: Andy Whitcroft <apw@canonical.com>
2017-08-02 00:56:02 +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
f680bb3df8 add a couple more tests to show how the email frequency varies with valid/invalid candidates 2017-06-29 12:53:05 -07:00
Steve Langasek
6459977822 Make it possible to test the email frequency for a package that is sometimes a valid candidate and sometimes not 2017-06-29 12:53:05 -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
Steve Langasek
64d9bdda91 Adjust the email tests to the intervals we expect 2017-06-29 11:17:04 -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
Iain Lane
322108df73 email: beef up the tests very slightly
- add a day/days case for '1' exactly
  - make some other daysold be non ints
2017-03-14 18:17:03 +00: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
Iain Lane
9a32ef781f email: Enable again 2017-03-09 18:02:59 +00:00
Robert Bruce Park
2405fcf8bc Backport EmailPolicy to Python 3.2 2017-03-09 18:00:22 +00:00
Iain Lane
1fe3e56cc7 Revert "enable the email policy"
We're getting

  Traceback (most recent call last):
    File "/srv/ubuntu-archive/proposed-migration/code/b2/britney2/policies/email.py", line 171, in apply_policy_impl
      with smtplib.SMTP('localhost') as smtp:
  AttributeError: __exit__

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/ubuntu-archive/proposed-migration/code/b2/britney.py", line 2892, in <module>
      Britney().main()
    File "/home/ubuntu-archive/proposed-migration/code/b2/britney.py", line 2860, in main
      self.write_excuses()
    File "/home/ubuntu-archive/proposed-migration/code/b2/britney.py", line 1680, in write_excuses
      if should_upgrade_src(pkg, 'unstable'):
    File "/home/ubuntu-archive/proposed-migration/code/b2/britney.py", line 1585, in should_upgrade_src
      v = policy.apply_policy(policy_info, suite, src, source_t, source_u, excuse)
    File "/srv/ubuntu-archive/proposed-migration/code/b2/britney2/policies/policy.py", line 103, in apply_policy
      return self.apply_policy_impl(pinfo, suite, source_name, source_data_tdist, source_data_srcdist, excuse)
    File "/srv/ubuntu-archive/proposed-migration/code/b2/britney2/policies/email.py", line 176, in apply_policy_impl
      except ConnectionRefusedError as err:
  NameError: global name 'ConnectionRefusedError' is not defined

on the production machine, which is currently running Python 3.2. It seems like smtplib.SMTP isn't a context manager in 3.2, and also ConnectionRefusedError doesn't exist there (it raises socket.error instead).

Robert's going to fix this, but for now let's go back to dry-run.

This reverts commit c05b6871851143efe5e2f2388b52544ecf3f7a32.
2017-03-09 17:35:55 +00:00
Iain Lane
7cc72bf2d6 email: For direct sponsored uploads, email both the sponsor and sponsoree 2017-03-09 17:16:21 +00:00
Robert Bruce Park
df495582e2 Fix SourcePPA policy by inspecting build_link instead. (LP: #1648000) 2017-03-09 09:06:25 -08:00
Iain Lane
5f4c2e735d email: Log a message when we send emails 2017-03-09 16:46:47 +00:00
Iain Lane
c05b687185 enable the email policy
weee
2017-03-09 16:43:40 +00:00
Iain Lane
d9887d320e email: be From the 'Ubuntu Release Team' 2017-03-09 16:41:34 +00:00
Robert Bruce Park
d66116d809 Update email MESSAGE_BODY to reflect dynamic max_age. 2017-03-09 08:33:09 -08:00