#3960 add fedmsg topic for package block/unblock events in koji
Closed: Fixed 6 years ago Opened 10 years ago by till.

This event is usuful for monitoring koji activities by rel-eng.


For whoever takes this, here is some info you'll need.

We have a plugin for koji that tells koji how to publish message bus events for us:

http://infrastructure.fedoraproject.org/cgit/ansible.git/tree/roles/koji_hub/templates/fedmsg-koji-plugin.py#n131

It works, there, by hooking up to callbacks that koji's internal API provides.

If you look at that somewhat complicated callback block, what it's doing is subscribing to every callback in callbacks.keys() (every callback koji has) except for postImport (which is noisy) and postCommit (which is special).

Now, go look at the koji source for where a package gets unblocked. You'll see that there is already a callback associated with this. It is the postPackageListChange callback. Our plugin actually handles that already and publishes an org.fedoraproject.prod.buildsys.package.list.change message for it.
Here's an example of one of those messages. Notice that the message doesn't include any information about the package being blocked or not.

All we need to do (I think) is modify our fedora-infra fedmsg plugin to pass along the action argument from the callback into the message (and any other useful info in there). Then, our messages will be able to say whether something was blocked, unblocked, added, removed, etc.. to/from the tag.

Bonus points if you submit a second change to the fedmsg_meta repo so that this new data in the JSON body shows up in message strings. Do this only after you've done the above part and have verified that the data is being passed through correctly in prod.

Metadata Update from @ralph:
- Issue tagged with: easyfix

6 years ago

Now, go look at the koji source for where a package gets unblocked. You'll see that there is already a callback associated with this. It is the postPackageListChange callback. Our plugin actually handles that already and publishes an org.fedoraproject.prod.buildsys.package.list.change message for it.

The attached patch should add the missing parameters where available, although I didn't have a chance to verify that.

0001-fedmsg-koji-plugin-add-more-parameters-to-package.li.patch

@ralph Would you guys prefer the patch sent to the mailing list?

FYI, the patch looks safe to try.

We can roll it out to staging after freeze and test there (try to add/remove something to/from a tag, then verify that the message in stg datagrepper is there and looks sane).

Metadata Update from @ralph:
- Issue tagged with: unfreeze

6 years ago

I applied this in staging, and then blocked a package there, but I didn't get any fedmsg. ;(

Is there something else we need to enable? Any ideas for debugging it?

Metadata Update from @kevin:
- Issue untagged with: unfreeze

6 years ago

ok. got it sorted out and it's working. ;)

will apply after freeze.

Metadata Update from @kevin:
- Issue tagged with: unfreeze

6 years ago

This should be now live in production.

Thanks everyone that worked on it!

:fireworks:

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata