Merge pdbq:add-collect-watch into pdbq:main

Proposed by Bryce Harrington
Status: Merged
Merge reported by: Bryce Harrington
Merged at revision: a00dcaebcc2ab4b8a1ac261fb9eea91f3363f90d
Proposed branch: pdbq:add-collect-watch
Merge into: pdbq:main
Diff against target: 252 lines (+126/-42)
1 file modified
workers/collect-watch (+126/-42)
Reviewer Review Type Date Requested Status
Athos Ribeiro (community) Approve
Canonical Server Reporter Pending
Review via email: mp+439139@code.staging.launchpad.net

Description of the change

I've used a bash script, ./scripts/watch-query, to scan for new upstream versions. The info it collects then feeds into the tools used to make the merge board, as well as the merge opportunities email.

This completes a rewrite of that bash script to python, and refactors things to be a bit more pythonic. I will probably do a bit more hacking on it before setting up the cronjob for it, but it's at a good stage for reviewing.

For a bit of extra context, for Pdbq 'workers' are intended to be run as discrete jobs to pull data from remote sites and re-process it into JSON records. This is not the first worker script for Pdbq but my objective is to make this one fully fleshed out so it can serve as an example of a "finished" worker. So, review comments to cleanup the style or fix the syntax or to simplify the code would be much appreciated.

There is a smoketest:

  $ ./workers/collect-watch --test
  Retrieved information for package:
  {'debian-mangled-uversion': '2.10',
   'debian-uversion': '2.10',
   'package': 'hello',
   'status': 'newer package available',
   'upstream-url': 'https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz',
   'upstream-version': '2.12.1'}

  Expected:
  {'debian-mangled-uversion': '2.10',
   'debian-uversion': '2.10',
   'package': 'hello',
   'status': 'newer package available',
   'upstream-url': 'https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz',
   'upstream-version': '2.12.1'}

  output matches example

For a regular run, create a /tmp/input.json file with contents like this:

  {
      "source_package_name": "dovecot",
      "checkouts_dir": "/tmp",
      "watch_override": null,
      "logging": false
  }

Then run:

  $ ./workers/collect-watch /tmp/dovecot.json
  {
      "contents": {
          "component": "\n",
          "debian-mangled-uversion": "2.3.19.1",
          "debian-uversion": "2.3.19.1+dfsg1",
          "package": "dovecot",
          "status": "newer package available",
          "upstream-url": "https://dovecot.org/releases/2.3/dovecot-2.3.20.tar.gz",
          "upstream-version": "2.3.20"
      },
      "date_collect_finished": "Fri Mar 17 00:24:36 2023",
      "date_collect_started": "Fri Mar 17 00:22:22 2023",
      "source_package": "dovecot"
  }

To post a comment you must log in.
Revision history for this message
Athos Ribeiro (athos-ribeiro) wrote :

LGTM :)

review: Approve
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks, pushed:

Total 20 (delta 12), reused 0 (delta 0), pack-reused 0
To git+ssh://git.launchpad.net/pdbq
   3ab165b..16d715d main -> main

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: