pull-request-notifier-for-bitbucket icon indicating copy to clipboard operation
pull-request-notifier-for-bitbucket copied to clipboard

Variable substitutions doesn't occur on URL field

Open NetAppRepoAdmin opened this issue 8 years ago • 1 comments

From the description it sounds like variables can be used in the URL field "You can use variables when invoking the URL, when forming the filter string, custom header values or in POST content."

But, it seems to be passing and using that field without interpreting the variable. I get this error when I save.

Sent POST /rest/prnfb-admin/1.0/settings/notifications: {"uuid":"","name":"Workaround BB lazy PR silliness","projectKey":"DEVTS-BB","repositorySlug":"atlassian-elastic-stack","filterString":"","filterRegexp":"","triggerIfCanMerge":"ALWAYS","triggers":["OPENED","REOPENED","UPDATED"],"injectionUrl":"","injectionUrlRegexp":"","user":"KEEP_THIS_TO_LEAVE_UNCHANGED","password":"KEEP_THIS_TO_LEAVE_UNCHANGED","proxyUser":"KEEP_THIS_TO_LEAVE_UNCHANGED","proxyPassword":"KEEP_THIS_TO_LEAVE_UNCHANGED","proxyServer":"","proxyPort":"","url":"${PULL_REQUEST_URL}/overview","method":"GET","postContent":"","headers":[{"name":"","value":""}]}

Got: {"message":"se.bjurr.prnfb.settings.ValidationException: url=URL not valid!","status-code":500,"stack-trace":"java.lang.RuntimeException: se.bjurr.prnfb.settings.ValidationException: url=URL not valid!\n\tat com.google.common.base.Throwables.propagate(Throwables.java:160)\n\tat se.bjurr.prnfb.presentation.NotificationServlet.create(NotificationServlet.java:59)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat

NetAppRepoAdmin avatar Nov 07 '17 21:11 NetAppRepoAdmin

It is probably just the validation of the URL that has to happen after it is rendered.

A workaround would be to construct that URL using the PULL_REQUEST_FROM_REPO_PROJECT_KEY and PULL_REQUEST_FROM_REPO_SLUG variables.

tomasbjerre avatar Nov 08 '17 05:11 tomasbjerre