~racb/git-ubuntu:recursive-dot-git-escaping

Last commit made on 2020-02-10
Get this branch:
git clone -b recursive-dot-git-escaping 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:
recursive-dot-git-escaping
Repository:
lp:~racb/git-ubuntu

Recent commits

748689c... by Robie Basak

.git escaping: fix failing case

Traverse the entire directory for recursive escapes;
sorted_subpaths_to_rename is already filtered so is not complete itself.

This fixes the recursive traversal that looks for entries that require
escaping.

This causes the previous failing test to pass, so we must remove the
associated xfail marker.

af7608d... by Robie Basak

.git escaping: add test for failing case

If a file called foo/.git exists, it isn't being escaped. This is a bug,
so add a test case for this and mark it xfail. This will be fixed in the
next commit.

c853461... by Robie Basak

.git escaping: fix test parameter comments

These two comments were mapped to the incorrect parameter set payloads.
Having them this way round correctly describes the parameter sets.

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.