ppa-dev-tools:add_to_dict

Last commit made on 2023-06-30
Get this branch:
git clone -b add_to_dict https://git.launchpad.net/ppa-dev-tools
Only Bryce Harrington can upload to this branch. If you are Bryce Harrington please log in for upload directions.

Branch merges

Branch information

Name:
add_to_dict
Repository:
lp:ppa-dev-tools

Recent commits

4fa781a... by Bryce Harrington

Implement JSON output support at object level

Adds .to_dict() members to principle objects involved in representing
test results, and associated test cases.

Previous work has striven to split the data processing from the data
display. This takes the next step of establishing groundwork for
representing the data objects themselves in an easily flattenable
format. That establishes the groundwork needed to create user-specified
options like --json and --yaml (or maybe --format=json, --format=yaml)
to dump results in a machine-parsable form rather than in the
human-readable "bullet-tree" style output.

The test cases don't consider the validity of the data elements
themselves, but just that the expected fields are present and that none
have unexpected data types.

eca439b... by Bryce Harrington

wait: Handle lazr BadRequest during wait operation

Launchpad can return BadRequest errors in some indeterminate situations,
possibly such as if Launchpad is under heavy loads, but also potentially
due to usage/configuration issues.

Include logic to retry the Launchpad operations in case the problem is
server-side, but also limit the number of sequential retries to 3, to
avoid getting stuck in a loop if the problem is something else. The
counter is reset to zero each time we successfully complete a wait
cycle, so that if Launchpad is *slightly* glitchy this will be
forgiving.

Fixes: https://bugs.launchpad.net/ppa-dev-tools/+bug/1997122

5cae9c8... by Bryce Harrington

ppa_address_split: Fix handling of +packages URLs

The PPA web interface includes an overview page (suited to end users)
and a more technically detailed +packages page. This latter page tends
to be what Ubuntu packagers need, so it is not uncommon for people to
share links to PPAs as this +packages link. So, support handling of
this (and any other +whatever pages under the PPA namespace that might
exist).

f823e85... by Bryce Harrington

ppa_address_split: Allow optional trailing / in the PPA URL

4c2b3d1... by Bryce Harrington

Quell traceback for unparsable PPA names

Discovered when running:

    $ ./scripts/ppa tests https://launchpad.net/~athos-ribeiro/+archive/ubuntu/squid-halt-build-on-test-failures/+packages --release kinetic
    Error: Invalid ppa name 'https://launchpad.net/~athos-ribeiro/+archive/ubuntu/squid-halt-build-on-test-failures/+packages'

Issue is the +packages element, however any unrecognized URL will
trigger the traceback from the exception throw.

Instead, print the exception's message and exit with an error code.

aa1531c... by Bryce Harrington

Quell traceback on user interrupt during configuration

The create_config() command may include a call to Launchpad to determine
the current LP username in some circumstances. If there are issues this
can cause some unexpected delay, leading to the user cancelling the
process (via <control>+c) which triggers the usual python traceback for
the KeyboardInterrupt exception.

The various PPA commands already include exception handling for this
case, but the config loading occurs prior to the command execution
itself. So, the fix is to include similar exception handling for the
create_config() command.

33b9284... by Massimiliano Girardi

Add LP_CREDENTIALS login and documentation

9dbaa6f... by Bryce Harrington

Refactor team name to owner name

Hat tip to Andreas for pointing out 'owner' is Launchpad's preferred
jargon for the person or team that a PPA belongs to.

Support the --team-name argument and the 'team_name' configuration
parameter for legacy reasons, even though the former didn't exist and
the latter was bugged.

df6d293... by Bryce Harrington

Add --team-name argument for create command

Modify ppa_address_split() to not use a default team if the team name
was undefined, and instead let it be returned as None. Then handled
undefined team names in create_config() by making use of any team
specified on the command line or config file, before falling back to the
lp username as the final default. And error out if that still doesn't
work.

With this, allow synonym options --owner and --team for convenience.

Fixes: https://bugs.launchpad.net/ppa-dev-tools/+bug/1990244

2a8e2ef... by Massimiliano Girardi

wait: Improve exit behavior on build failures of subset of PPA

By default `ppa wait` monitors all build jobs, but this adds a couple
parameters to narrow this to just jobs for a specific source package via
the 'name' parameter, and/or jobs created within a timeframe specified
by the 'wait_max_age_hours' configuration parameter.

This also adds another configuration parameter
'exit_on_only_build_failure' which when true will make the ppa wait
command terminate if the only jobs that it is monitoring are failed
builds (this is helpful for CI/CD integration).