Webhook parameters do not expand


I am trying out webhooks to integrate with a Jenkins. I have it working so far, a PR creation is triggering a build, but the parameters in the URL are not expanded. I turned on debug mode and this is what I am getting:

2021-03-30 16:49:12.642 [867762] DEBUG [rhodecode.integrations.types.base] register webhook call(<PullRequestUpdateEvent:(pullrequest-update)>) to url${branch}&BRANCH_HEAD=${branch_head} | req_id:28e9b181-cd4b-4fb3-94b8-06e5a7e9d17d
2021-03-30 16:49:12.642 [867762] DEBUG [rhodecode.integrations.types.webhook] Webhook: calling following urls: [u'${branch}&BRANCH_HEAD=${branch_head}'] | req_id:28e9b181-cd4b-4fb3-94b8-06e5a7e9d17d

In the parameter section of the jenkins build I can also clearly see that the literal ${branch_head} was passed to the URL instead of the expanded name.

Is there anything I am doing wrong here?

I am using 4.24.1

I think a pull-request update doesn’t pass those variables. Those are for context of a push operation only.

Hm, but then how would one run a test suite when a pr is updated? The docs say:

On RhodeCode Community side we need to create a new integration that would use only two events:

    pullrequest created
    pullrequest commits updated

Since the URL in the docs contain the exact same parameters, I assumed this to be working.

You should do it based on a PR_ID you can fetch info on that pull-request. Given pull-request actually can be open against a bookmarks for mercurial, or explicit commit hash, we cannot relly on a branch.
We used to do it with Jenkins that we send an event with PR_ID and then use a script to fetch shadow repo with merged commits from PR for testing.