Automate keeping up to date with packagecloud release

What

Currently we have keep up to date with packagecloud releases manually. This means:

  • Manually checking when our packagecloud instance (at https://packages.gitlab.com) has been updated, which brings support for new OS distribution versions.
  • Manually update the distro versions to which we publish packages. i.e. update RPM_PLATFORMS and DEB_PLATFORMS here and here

It would be nice if we could automate at least the first step, and ideally both steps, in a similar manner to e.g. renovate

Even better would be if we can just package the latest N versions of each distro supported by our instance of packagecloud.

How

The packagecloud service has an api with an endpoint that lists the OS distros and versions supported by the service; https://packages.gitlab.com/api/v1/distributions.json. We can query that api periodically as part of a CI pipeline, and compare it against DEB_PLATFORMS and RPM_PLATFORMS, and when packagecloud supports a distro version for which we don't publish a package, we could either fail the CI job, or better yet create an MR with the missing distro versions. The latter might require moving where DEB_PLATFORMS and RPM_PLATFORMS are declared. We could also trigger the check in the same job that publishes the packages to packagecloud https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/ci/push_packagecloud

Edited by Axel von Bertoldi