~racb/git-ubuntu:xfail-style

Last commit made on 2020-02-11
Get this branch:
git clone -b xfail-style https://git.launchpad.net/~racb/git-ubuntu
Only Robie Basak can upload to this branch. If you are Robie Basak please log in for upload directions.

Branch merges

Branch information

Name:
xfail-style
Repository:
lp:~racb/git-ubuntu

Recent commits

2894c80... by Robie Basak

Add style notes on the use of xfail

10ac67b... by Andreas Hasenack

Add nsscache, volatildap and vmem to the whitelist

0c6c8b0... by Bryce Harrington

mailer: Avoid bytes->Text->bytes conversion on mail body

Fixes formatting issue for emails where the body showed text as
b"blah blah".

This is caused by str.encode() being called on the body, which is
already of types bytes.

For clarification, also correct the typing specifiers to correctly
document the type on the message as bytes, not Text. (These specifiers
don't actually change the type of the parameters they refer to, but they
might show up as failures in lint checks, and may lead to incorrect code
docs).

412fc35... by Bryce Harrington

mailer: Connect and disconnect from smtp service when sending emails

Since the importer is a long-running service, there can be a delay
between when the Mailer object is constructed and when it's used. This
can result in a "timeout after CONNECT from localhost[127.0.0.1]"
exactly 5 minutes later, shown in postfix's mail.log.

Along with the connect(), a quit() (SMTP's 'QUIT') is required to be
issued at the completion of the email. From testing, it appears that
under a number of different circumstances, smtplib can cope with it not
being explicitly called - for example it automatically calls it when the
smtplib object goes out of scope - however this is not guaranteed and it
is better practice to call it explicitly. Not doing so could
theoretically disrupt the mail submission, although I've not reproduced
this failure mechanism synthetically.

a5f4adb... by Bryce Harrington

systemd: Define dependence on network online

In practice it is unlikely that the importer would do anything
network-dependent before the network is available, but having
this might prevent weird failure scenarios.

50d1197... by Bryce Harrington

systemd: Fix journal output

Service is installed as a user unit, so needs referenced as such

2c45812... by Robie Basak

Merge branch 'applied-enum'

2e0cc18... by Scott Moser

Add support for executing self test in checked out tree.

git-ubuntu is expected to run in the snap environment, and the self test
is also. Building a snap just to run tests is painfully slow.

The solution here is to run the tests in an already-existing snap
environment. This does present a bit of a chicken-egg problem, but one
that is only exposed when we add new python dependencies to git-ubuntu.

git-ubuntu-self-test is modified to accept a TEST_TREE environment
variable and do the right thing in both snap environment and development
tree.

So now both of these work:
  # test the snap installed git-ubuntu libraries.
  $ git-ubuntu.self-test

  # test the tree in "."
  $ ./snap-wrappers/wrappers/git-ubuntu-self-test

Also done here:
  * place 'SNAP_REVISION' and 'SNAP_VERSION' into environment.
    these are just informative. And a useful message is printed
    in the test output about the snap environment being used.

README.testing is updated with some documentation on how to run
git-ubuntu.self-test without building a snap and installing it first.

369f645... by Robie Basak

Collapse dual (un)applied code using an enum

In various places we have two implementations of near-identical code
where the only difference is whether they act on unapplied or applied
branches, tags or structure. Ultimately they do need to be handled
differently at some point, but most of the code in the middle of the
call graph does not need to care.

To avoid code duplication we define a PatchState enum and can then drop
half of the middling code by simply passing through the "unapplied-ness"
or "applied-ness" as a parameter.

The following functions are removed from gitubuntu.git_repository.
Instead, the unapplied previous equivalent should be used with
patch_state=PatchState.APPLIED:

applied_reimport_tag_prefix
applied_reimport_tag
applied_tag

The following methods are removed from
gitubuntu.git_repository.GitUbuntuRepository. Instead, the unapplied
previous equivalent should be used with patch_state=PatchState.APPLIED:

get_applied_reimport_tag
get_all_applied_reimport_tags

A grep suggests that the only callers are importer.py and
importer_test.py; these are refactored as part of this change, dropping
duplication where there was any.

"git ubuntu tag" is the obvious CLI command that might have been
affected, but it doesn't appear to need any of these functions or
methods. Perhaps it should, but that's a job for a future refactoring.

This change does not cover every instance of code duplication or where
refactoring to use the new enum might be appropriate; we merely fix the
code that needed touching anyway, leaving other refactoring for the
future.

This change should not result in any functional changes.

bc3250c... by Andreas Hasenack

add ipmctl to the persistent memory stack