Various people have been submitting MPs against git-ubuntu branches,
even though we haven't specifically been calling for these yet.
This adds support to make these MPs appear on the sponsoring page so
they don't get lost.
This is done by implementing get_git_branches() on the same lines as the
existing (bzr-specific) get_branches().
Since the Launchpad API getRequestedReviews() method doesn't yet support
git branches (LP 1979817), this is implemented by scraping the web UI
instead. This is done in lp_scrape_mps.py, added as a separate module.
I've been using this scraping elsewhere, so it's copied in from the
ubuntu-helpers repository where I've been keeping a master copy. It'd be
better to provide it as a library somewhere, but we don't currently have
a mechanism to do that since the machine that runs the sponsoring report
is quite far behind. So, for now, I'm making do with a copy which we
will need to maintain manually.
SPONSOR_TEAMS is a dictionary keyed by "general" and "security". The
values contain the actual Launchpad team names.
When we iterate over SPONSOR_TEAMS, we should pass the actual Launchpad
team names to get_bugs() and get_branches(), not the "general" or
"security" str key.
Otherwise, when we call get_branches(), it will look for Launchpad teams
called "general" and "security". These usernames happen to exist but the
behaviour will not work as intended.
get_branches() previously was not working correctly because it was being
passed a key into SPONSOR_TEAMS as its "team" parameter but assumed it
was directly a Launchpad team name.
get_bugs() previously worked around this by assuming that its "team"
parameter is a key into SPONSOR_TEAMS, but this is a leaky abstraction
and is confusing.
This change unifies these functions by always passing "team" as a
Launchpad team name. get_bugs() is changed to handle the Launchpad team
directly instead of looking it up against SPONSOR_TEAMS.