Migrating label application from legacy PR processor to the current app-based instance

Background: a long time ago I started to migrate the classic PR processor to a modern application:

That dates back to 2019. Now @evgeni is working on migrating Redmine to a new machine. That same machine runs the legacy PR processor, so we either need to make sure that’s ported to Ruby 3, or migrate it to the current app. I’ve chosen the latter.

This is the first start, which isn’t complete but it at least moves over all the label assignment:

That would the be removed from the legacy app:

As you can see, the logic of how labels were applied wasn’t easy to read. There’s a chance there is some difference in logic.

Another big difference is that as an app installation is way easier: we have it applied to all repositories. Compared to the legacy application (which was based on webhooks) we no longer need to go repository-by-repository to set things up and then grant permissions to theforeman-bot. One big implication of that is the workflow would be applied to all repositories. Labels are created if they don’t exist. Is that desirable, or do we want to make it opt-in via repository configuration?

I have merged & deployed the changes. For Katello an admin needs to approve the new permissions, and I can’t do that.

Now the last remaining item is posting comments. Then the legacy instance can be turned off.