jenkinsci / jms-messaging-plugin

https://plugins.jenkins.io/jms-messaging
12 stars 38 forks source link

FedoraMessaging - CI_MESSAGE contains too much information #165

Closed bgoncalv closed 4 years ago

bgoncalv commented 4 years ago

When triggering using FedoraMessage the CI_MESSAGE contains information that I think shouldn't be part of CI_MESSAGE, at least it was not part of CI_MESSAGE when using FedMsg.

Example:

Fedora Message

{"deliveryTag":17,"msg":{"agent":"bodhi","artifact":{"builds":[{"component":"nano","id":1457844,"issuer":"kdudka","nvr":"nano-4.8-1.fc32","scratch":false,"task_id":41422439,"type":"koji-build"}],"id":"FEDORA-2020-b20bb0ca98-42150e1a8c4da1a9f1ddd1e75b05b21ac33da6f7","release":"f32","repository":"https://bodhi.fedoraproject.org/updates/FEDORA-2020-b20bb0ca98","type":"koji-build-group"},"contact":{"docs":"https://docs.fedoraproject.org/en-US/ci/","email":"admin@fp.o","name":"Bodhi","team":"Fedora CI"},"generated_at":"2020-02-07T12:05:36.924879Z","re-trigger":false,"version":"0.2.2"},"msg_id":"19eaa876-e0a8-49f4-9745-a6d662f84d75","timestamp":1581077137585,"topic":"org.fedoraproject.prod.bodhi.update.status.testing.koji-build-group.build.complete"}

FedMsg

{"version":"0.2.2","re-trigger":false,"agent":"bodhi","contact":{"docs":"https://docs.fedoraproject.org/en-US/ci/","team":"Fedora CI","name":"Bodhi","email":"admin@fp.o"},"artifact":{"release":"f32","type":"koji-build-group","id":"FEDORA-2020-b20bb0ca98-42150e1a8c4da1a9f1ddd1e75b05b21ac33da6f7","repository":"https://bodhi.fedoraproject.org/updates/FEDORA-2020-b20bb0ca98","builds":[{"nvr":"nano-4.8-1.fc32","task_id":41422439,"scratch":false,"component":"nano","type":"koji-build","id":1457844,"issuer":"kdudka"}]},"generated_at":"2020-02-07T12:05:36.924879Z"}

Basically what is show in CI_MESSAGE from FedMsg is the content of CI_MESSAGE['msg'] from FedoraMessaging.

scoheb commented 4 years ago

FYI @Zlopez

Zlopez commented 4 years ago

@bgoncalv Yes, the Fedora Messaging msg is the actual content of FedMsg message. So this is correct and intended behavior.

bgoncalv commented 4 years ago

@Zlopez okay, thanks. If this behaviour is expected than this issue can be closed. We are going to need to change our code to parse the CI_MESSAGE differently and triggering on FedoraMessaging won't be a simple change of messaging provider.

Zlopez commented 4 years ago

In the Python implementation of Fedora messaging, there is a library that helps you with the parsing, but for the Java there isn't anything like this. But yes, these two are not compatible with each other.

bgoncalv commented 4 years ago

@johnbieren fyi, note that some of the pipelines use CI_MESSAGE as parameter to some functions like https://github.com/openshift/contra-lib/blob/master/vars/kojiMessage.groovy so any pipeline that uses this will have to be fixed when changing the trigger from FedMSg to FedoraMessaging.

Zlopez commented 4 years ago

I noticed some difference between FedMsg implementation and RabbitMQ implementation. #168 should fix this.