~racb/git-ubuntu:phasing-defaults

Last commit made on 2020-01-16
Get this branch:
git clone -b phasing-defaults 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:
phasing-defaults
Repository:
lp:~racb/git-ubuntu

Recent commits

a301a8f... by Robie Basak

Change main phasing default to 100%

The official importer instance (the only known instance) had been at
100% phasing of main for months, but accidentally reverted to the old
default of 1% as the configuration was lost when it was converted to a
proper service.

Let's move the default to match the production instance to reduce
the likelyhood of mistakes.

ffadc6e... by Rafael David Tinoco

Add pyagentx to whitelist (LP: #1855943).

feed5ea... by Bryce Harrington

Log when emails are sent, not when they're not sent

mailer.notify() queues up package results to send email summary
notifications after some interval has passed. It returns True when that
email actually is sent, False if no email needed sent, and throws
exceptions on actual email service faults.

This warning is thus incorrect; the false return doesn't indicate a
failure, just that it wasn't time to send an email. And in fact it's
probably not interesting to log anyway. Instead, log when emails *are*
sent.

dfbbf9c... by Bryce Harrington

systemd: Drop explicit setting of StandardOutput to journal

With StandardOutput left undefined, the system's setting (from
/etc/systemd/system.conf) is used instead, which defaults to
journal already. There is no particular reason to override the
system settings.

4b98feb... by Bryce Harrington

systemd: Fix service name

This had been just a default value as an example, but should show the
actual script name.

78698b4... by Bryce Harrington

systemd: Use the installed symlink for running importer

On installation, snap symlinks the importer script to /snap/bin,
(re-)named as git-ubuntu.import-source-packages. Use this in preference
to using the python script from the unpacked package.

e223c71... by Bryce Harrington

systemd: Fix invocation of failure-email.sh

Snap installs failure-email.sh in the snap root, not under bin/, and
requires explicitly specifying the shell interpreter to run the command.

b1412cb... by Bryce Harrington

docs: Fix path for script discussed in importer service docs

The failure-email.sh script may not be present in bin/ depending on how
it's installed.

90560ab... by Robie Basak

Rewrite commit_tree_hash into commit_source_tree

To fix LP: #1764814, the updated specification changes the definition of
how commit authorship is derived. This is a rewrite of
GitUbuntuRepository.commit_tree_hash() to meet the new specification.

Since more accurately we're committing a tree that must contain a Debian
package source, the method is renamed to commit_source_tree() in this
rewrite.

fallback_author and fallback_date are no longer necessary and are
removed. Instead we use a commit_date parameter which specifies the
required date of the commit. According to the new specification this
date must come from the underlying Launchpad object. Since this method
operates on a low level git tree instead of at the Launchpad data
structure level, the commit date is the caller's responsiblity to obtain
and provide; this method will simply use the date given.

git repository hashes are now passed and returned as pygit2.Oid objects
as we move to this type as the usual standard.

The committer name and email are defined in the specification via
gitubuntu/spec.py, which is added as a new file. This file forms part of
the specification itself, and its contents are separated in its own file
to avoid inadvertent changes to the specification.

The GitUbuntuRepository methods get_commit_environment() and
get_commit_authorship() were only used by the old commit_tree_hash()
method and are removed. Instead we use Changelog.git_commit_authorship()
as added in the previous commit.

Since we have changed the definition of
commit_tree_hash()/commit_source_tree() in the rewrite, all callers are
updated to the new method name, new parameter names and types, and the
calculation of fallback_ is removed.

In tests, it is further no longer necessary to patch the
get_commit_environment() method, which no longer exists. Instead,
repo_builder.Commit is adjusted to default to using the same metadata as
the specification defines. This results in the same behaviour as before
when the test suite is run, but is cleaner since less patching is
required.

8700623... by Robie Basak

Add Changelog.git_authorship() method

According to the revised specification, we now need to derive the
authorship of a synthesized git commit from the changelog of the
corresponding source package. This method implements that parsing.