#73 Fix: Catch only requested messages
Merged 4 years ago by mkovarik. Opened 4 years ago by mkovarik.
mkovarik/c3i-library regex-fedmsg  into  master

@@ -38,11 +38,11 @@ 

            overrides: [topic: "{{ topic }}"],

            checks: [

              {% if "premerge" == job_vars.workflow %}

-             [field: '$.pullrequest.project.url_path', expectedValue: params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')],

-             [field: '$.pullrequest.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.pullrequest.project.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

+             [field: '$.pullrequest.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

              {% elif "job-updater" == job_vars.workflow %}

              [field: '$.repo.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

-             [field: '$.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

              {% endif %}

            ]

          ),

@@ -27,32 +27,32 @@ 

            name: params.MESSAGING_FEDMSG_PROVIDER,

            overrides: [topic: "io.pagure.prod.pagure.pull-request.new"],

            checks: [

-             [field: '$.pullrequest.project.url_path', expectedValue: params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')],

-             [field: '$.pullrequest.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.pullrequest.project.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

+             [field: '$.pullrequest.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

            ]

          ),

          fedmsgSubscriber(

            name: params.MESSAGING_FEDMSG_PROVIDER,

            overrides: [topic: "io.pagure.prod.pagure.pull-request.update"],

            checks: [

-             [field: '$.pullrequest.project.url_path', expectedValue: params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')],

-             [field: '$.pullrequest.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.pullrequest.project.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

+             [field: '$.pullrequest.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

            ]

          ),

          fedmsgSubscriber(

            name: params.MESSAGING_FEDMSG_PROVIDER,

            overrides: [topic: "io.pagure.prod.pagure.pull-request.reopened"],

            checks: [

-             [field: '$.pullrequest.project.url_path', expectedValue: params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')],

-             [field: '$.pullrequest.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.pullrequest.project.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

+             [field: '$.pullrequest.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

            ]

          ),

          fedmsgSubscriber(

            name: params.MESSAGING_FEDMSG_PROVIDER,

            overrides: [topic: "io.pagure.prod.pagure.pull-request.rebased"],

            checks: [

-             [field: '$.pullrequest.project.url_path', expectedValue: params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')],

-             [field: '$.pullrequest.branch', expectedValue: params.GIT_MAIN_BRANCH],

+             [field: '$.pullrequest.project.url_path', expectedValue: "^${params.GIT_REPO.split('/')[3..-1].join('/').replace('forks/', 'fork/').replaceAll(/.git$/, '')}\$"],

+             [field: '$.pullrequest.branch', expectedValue: "^${params.GIT_MAIN_BRANCH}\$"],

            ]

          ),

        ]

Messaging plugin is using regexp for catching messages, which caused
that also forked project triggered these jobs.

rebased onto bb66e9d

4 years ago

Build bb66e9d FAILED!
Rebase or make new commits to rebuild.

rebased onto 109f09a

4 years ago

Build 109f09a FAILED!
Rebase or make new commits to rebuild.

rebased onto 4c11bb3

4 years ago

rebased onto 98ce169

4 years ago

Build 98ce169 FAILED!
Rebase or make new commits to rebuild.

rebased onto ecef33d

4 years ago

Pull-Request has been merged by mkovarik

4 years ago