Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

two jobs are trigger if one fedmsg comment is entered #215

Open
phracek opened this issue Mar 8, 2021 · 6 comments
Open

two jobs are trigger if one fedmsg comment is entered #215

phracek opened this issue Mar 8, 2021 · 6 comments
Labels

Comments

@phracek
Copy link

phracek commented Mar 8, 2021

Version report

Jenkins and plugins versions report:
Jenkins version 2-190-3 and jms-messaging plugin in version 1.1.19

  • What Operating System are you using (both controller, and any agents involved in the problem)?
    I am using Jenkins as CSB. All is configured via casc.yaml file.

JMS definition in casc.yaml is:

  jmsProviders:
    configs:
    - fedMsg:
        hubAddr: "tcp://hub.fedoraproject.org:9940"
        pubAddr: "tcp://hub.fedoraproject.org:9940"
        name: "FedMsg"
        topic: "org.fedoraproject.prod.github.issue.comment"

Alone job definition is:
https://github.com/sclorg/rhscl-container-ci/blob/master/yaml/triggers/github-pr.yaml

Reproduction steps

Results

Expected result:

Only one job is scheduled.

Actual result:

Two jobs are scheduled.

@phracek phracek added the bug label Mar 8, 2021
@phracek
Copy link
Author

phracek commented Mar 9, 2021

@olivergondza What do you think? Where could be a problem?

@phracek
Copy link
Author

phracek commented May 24, 2021

The issue is still valid for Jenkins 2-277-2.

@ukulekek
Copy link

ukulekek commented Oct 5, 2022

Hello, we are getting the same issue. @olivergondza could you look at that, please?
Here is jms plugin config:

jmsProviders:
  - fedMsg:
        hubAddr: "tcp://hub.fedoraproject.org:9940"
        name: "fedmsg"
        pubAddr: "tcp://172.19.4.24:9941"
        topic: "org.fedoraproject"

And here is the job configuration:

      triggers:
          - ci-trigger:
                no-squash: true
                provider-name: fedmsg
                provider-type: FedMsg
                override-topic: org.fedoraproject.prod.github.issue.comment
                message-checks:
                    - field: '$.issue.pull_request.url'
                      value: '.*'
                    - field: '$.action'
                      value: '^created$|^edited$'
                    - field: '$.issue.state'
                      value: '^open$'

Every message schedules two jobs with the same CI_MESSAGE, but json is in different order:
1:

{"comment":{"body":"> lgtm, but it seems that the `tox -e black` failed.\r\n\r\nyes - I don't want to merge this yet - I'm anticipating other reviewers may have suggested changes, or an entirely different approach - this is here just as a PoC - I'm using this PR to test in baseos CI","reactions":{"heart":0,"eyes":0,"rocket":0,"url":"https://api.github.com/repos/linux-system-roles/network/issues/comments/1267776916/reactions","total_count":0,"confused":0,"hooray":0,"+1":0,"-1":0,"laugh":0},"url":"https://api.github.com/repos/linux-system-roles/network/issues/comments/1267776916","created_at":"2022-10-05T00:51:41Z","author_association":"CONTRIBUTOR","html_url":"https://github.com/linux-system-roles/network/pull/528#issuecomment-1267776916","updated_at":"2022-10-05T00:51:41Z","performed_via_github_app":null,"node_id":"IC_kwDOBVifSs5LkL2U","user":{"url":"https://api.github.com/users/richm","site_admin":false,"html_url":"https://github.com/richm","node_id":"MDQ6VXNlcjIzMDY2","gravatar_id":"","login":"richm","type":"User","id":23066},"id":1267776916},"sender":{"url":"https://api.github.com/users/richm","site_admin":false,"html_url":"https://github.com/richm","node_id":"MDQ6VXNlcjIzMDY2","gravatar_id":"","login":"richm","type":"User","id":23066},"repository":{"has_wiki":true,"topics":["ansible","fedora","hacktoberfest","linux","networking","networkmanager","rhel"],"has_pages":false,"updated_at":"2022-09-04T21:06:50Z","private":false,"disabled":false,"full_name":"linux-system-roles/network","owner":{"url":"https://api.github.com/users/linux-system-roles","site_admin":false,"html_url":"https://github.com/linux-system-roles","node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MDE0Njcw","gravatar_id":"","login":"linux-system-roles","type":"Organization","id":28014670},"id":89694026,"size":1169,"archived":false,"allow_forking":true,"has_projects":true,"watchers_count":173,"forks":96,"homepage":"https://linux-system-roles.github.io/","fork":false,"description":"An ansible role to configure networking","has_downloads":true,"forks_count":96,"default_branch":"main","html_url":"https://github.com/linux-system-roles/network","visibility":"public","node_id":"MDEwOlJlcG9zaXRvcnk4OTY5NDAyNg==","has_issues":true,"stargazers_count":173,"name":"network","open_issues_count":47,"watchers":173,"language":"Python","license":{"spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU=","name":"BSD 3-Clause \"New\" or \"Revised\" License","key":"bsd-3-clause"},"url":"https://api.github.com/repos/linux-system-roles/network","created_at":"2017-04-28T10:05:05Z","pushed_at":"2022-10-04T20:35:53Z","web_commit_signoff_required":false,"is_template":false,"open_issues":47},"fas_usernames":{"linux-system-roles":"github_org_linux-system-roles"},"action":"created","organization":{"url":"https://api.github.com/orgs/linux-system-roles","login":"linux-system-roles","node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MDE0Njcw","description":"","id":28014670},"issue":{"active_lock_reason":null,"reactions":{"heart":0,"eyes":0,"rocket":0,"url":"https://api.github.com/repos/linux-system-roles/network/issues/528/reactions","total_count":0,"confused":0,"hooray":0,"+1":0,"-1":0,"laugh":0},"labels":[],"number":528,"assignee":null,"closed_at":null,"id":1396813386,"state_reason":null,"title":"Add support for __network_test_flags to workaround CI problems","pull_request":{"url":"https://api.github.com/repos/linux-system-roles/network/pulls/528","merged_at":null,"html_url":"https://github.com/linux-system-roles/network/pull/528"},"comments":3,"performed_via_github_app":null,"state":"open","draft":false,"body":"On some CI systems the tests that create routes can create them in such\na way that they override the \"default\" default routes, interrupting\nnetwork connectivity and causing Ansible to hang.  The parameter\n`__network_test_flags` gives network role developers a way to ensure\nthat the newly created route is given a lower priority and does not\noverride the \"default\" default route.  A `dict` was chosen as the type\nof this variable so that it could be easily extended in the future for\nfuture use cases.\n","author_association":"CONTRIBUTOR","html_url":"https://github.com/linux-system-roles/network/pull/528","updated_at":"2022-10-05T00:51:41Z","node_id":"PR_kwDOBVifSs5AKdfS","user":{"url":"https://api.github.com/users/richm","site_admin":false,"html_url":"https://github.com/richm","node_id":"MDQ6VXNlcjIzMDY2","gravatar_id":"","login":"richm","type":"User","id":23066},"milestone":null,"locked":false,"url":"https://api.github.com/repos/linux-system-roles/network/issues/528","created_at":"2022-10-04T20:35:52Z","assignees":[]}}

2:

{"action":"created","comment":{"author_association":"CONTRIBUTOR","body":"> lgtm, but it seems that the `tox -e black` failed.\r\n\r\nyes - I don't want to merge this yet - I'm anticipating other reviewers may have suggested changes, or an entirely different approach - this is here just as a PoC - I'm using this PR to test in baseos CI","created_at":"2022-10-05T00:51:41Z","html_url":"https://github.com/linux-system-roles/network/pull/528#issuecomment-1267776916","id":1267776916,"node_id":"IC_kwDOBVifSs5LkL2U","performed_via_github_app":null,"reactions":{"+1":0,"-1":0,"confused":0,"eyes":0,"heart":0,"hooray":0,"laugh":0,"rocket":0,"total_count":0,"url":"https://api.github.com/repos/linux-system-roles/network/issues/comments/1267776916/reactions"},"updated_at":"2022-10-05T00:51:41Z","url":"https://api.github.com/repos/linux-system-roles/network/issues/comments/1267776916","user":{"gravatar_id":"","html_url":"https://github.com/richm","id":23066,"login":"richm","node_id":"MDQ6VXNlcjIzMDY2","site_admin":false,"type":"User","url":"https://api.github.com/users/richm"}},"fas_usernames":{"linux-system-roles":"github_org_linux-system-roles"},"issue":{"active_lock_reason":null,"assignee":null,"assignees":[],"author_association":"CONTRIBUTOR","body":"On some CI systems the tests that create routes can create them in such\na way that they override the \"default\" default routes, interrupting\nnetwork connectivity and causing Ansible to hang.  The parameter\n`__network_test_flags` gives network role developers a way to ensure\nthat the newly created route is given a lower priority and does not\noverride the \"default\" default route.  A `dict` was chosen as the type\nof this variable so that it could be easily extended in the future for\nfuture use cases.\n","closed_at":null,"comments":3,"created_at":"2022-10-04T20:35:52Z","draft":false,"html_url":"https://github.com/linux-system-roles/network/pull/528","id":1396813386,"labels":[],"locked":false,"milestone":null,"node_id":"PR_kwDOBVifSs5AKdfS","number":528,"performed_via_github_app":null,"pull_request":{"html_url":"https://github.com/linux-system-roles/network/pull/528","merged_at":null,"url":"https://api.github.com/repos/linux-system-roles/network/pulls/528"},"reactions":{"+1":0,"-1":0,"confused":0,"eyes":0,"heart":0,"hooray":0,"laugh":0,"rocket":0,"total_count":0,"url":"https://api.github.com/repos/linux-system-roles/network/issues/528/reactions"},"state":"open","state_reason":null,"title":"Add support for __network_test_flags to workaround CI problems","updated_at":"2022-10-05T00:51:41Z","url":"https://api.github.com/repos/linux-system-roles/network/issues/528","user":{"gravatar_id":"","html_url":"https://github.com/richm","id":23066,"login":"richm","node_id":"MDQ6VXNlcjIzMDY2","site_admin":false,"type":"User","url":"https://api.github.com/users/richm"}},"organization":{"description":"","id":28014670,"login":"linux-system-roles","node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MDE0Njcw","url":"https://api.github.com/orgs/linux-system-roles"},"repository":{"allow_forking":true,"archived":false,"created_at":"2017-04-28T10:05:05Z","default_branch":"main","description":"An ansible role to configure networking","disabled":false,"fork":false,"forks":96,"forks_count":96,"full_name":"linux-system-roles/network","has_downloads":true,"has_issues":true,"has_pages":false,"has_projects":true,"has_wiki":true,"homepage":"https://linux-system-roles.github.io/","html_url":"https://github.com/linux-system-roles/network","id":89694026,"is_template":false,"language":"Python","license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","node_id":"MDc6TGljZW5zZTU=","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"name":"network","node_id":"MDEwOlJlcG9zaXRvcnk4OTY5NDAyNg==","open_issues":47,"open_issues_count":47,"owner":{"gravatar_id":"","html_url":"https://github.com/linux-system-roles","id":28014670,"login":"linux-system-roles","node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MDE0Njcw","site_admin":false,"type":"Organization","url":"https://api.github.com/users/linux-system-roles"},"private":false,"pushed_at":"2022-10-04T20:35:53Z","size":1169,"stargazers_count":173,"topics":["ansible","fedora","hacktoberfest","linux","networking","networkmanager","rhel"],"updated_at":"2022-09-04T21:06:50Z","url":"https://api.github.com/repos/linux-system-roles/network","visibility":"public","watchers":173,"watchers_count":173,"web_commit_signoff_required":false},"sender":{"gravatar_id":"","html_url":"https://github.com/richm","id":23066,"login":"richm","node_id":"MDQ6VXNlcjIzMDY2","site_admin":false,"type":"User","url":"https://api.github.com/users/richm"}}

The original message: https://apps.fedoraproject.org/datagrepper/v2/id?id=2022-a667e1c6-f61f-4937-b35b-3751fedbef2d&is_raw=true&size=extra-large

The topic doesn't matter, it also happens with org.fedoraproject.prod.github.pull_request.opened and org.fedoraproject.prod.github.pull_request.synchronize

@ggallen
Copy link
Collaborator

ggallen commented Oct 5, 2022

@ukulekek, what version of the jms-messaging-plugin are you using? And can you provide a link to your Jenkins instance?

@ukulekek
Copy link

ukulekek commented Oct 5, 2022

@ggallen we use 1.1.27. The Jenkins is in the redhat intranet: https://url.corp.redhat.com/ce4766e

@thrix
Copy link

thrix commented Nov 15, 2022

@ggallen @olivergondza would you have time to look at this sometime pls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants