Open alexkaos87 opened 6 years ago
Out of interest, how many levels do you have? We typically have about 3 projects deep as maximum, so I am just trying to determine what the ux might look like.
at the moment, bigger nested case on our sistem includes 5 level of nested projects
With our system it is up to 3. Is there any update on this issue?
We are facing the same problems, we want to add a webhook at the root level. Currently we cannot test this as the subprojects are not found at all. Is there any way to get a workaround for the problem apart from adding the webhook in over 50 Projects?
We are currently using TeamCity 2017.2.2
Hi @huehnerlady It looks like you're trying to setup a webhook in a project that has no builds configured. Or are you adding a webhook at the root level?
For me, the root level finds all recent builds. Can you please open the developer console in your browser, and then open the webhook dialog? It should make a rest request to builds?
and load the list of recent builds in all sub-projects.
Just try clarify. @huehnerlady Do you want to have the webhook configured for all sub projects, or do you want to be able to select specific projects, or even specific builds within projects?
Assuming we can get this list of builds working for you, we should be able to configure a filter to prevent the webhook from triggering on certain scenarios.
I'll do some testing and provide an example configuration.
https://github.com/tcplugins/tcWebHooks/wiki/Applying-Filtering-Criteria-To-WebHook-Execution
Currently they need to be edited in the config file, but editing in the UI is on the road map for the 1.2 release.
I have been able to use filters to conditionally trigger a webhook for a specific build and/or project. This is what I did:
_Root
project.
For me, the URL was /admin/editProject.html?projectId=_Root&tab=projectParams
webhook.my_webhook_enabled
, and set the default value to false
Note: Any parameter prefixed with webhook.
will have the prefix removed when added to the webhook payload. It will therefore be in the payload as simply my_webhook_enabled
plugin-settings.xml
for the project you created the webhook in.
Mine was at config/projects/_Root/pluginData/plugin-settings.xml
because I created it in the _Root
project.filter
configuration to check for the required parameter.
This is what mine looked like:
The code block I added is:
<trigger-filters>
<filter value="${my_webhook_enabled}" regex="^true$" enabled="true" />
</trigger-filters>
If the above matches, the webhook will trigger, otherwise it will be skipped.
/webhooks/history.html?view=skipped
webhook.my_webhook_enabled
, and set the default value to true
./webhooks/history.html?view=ok
You can go into any build or project and define this parameter to override it. If the parameter is not defined, it will inherit the one from the _Root
project.
Note: It appears that using the test button in the webhook UI ignores the filter match, and sends the webhook anyway. This is a bug, although you can't actually see that, due to the builds list not being populated correctly.
@huehnerlady Do you have your teamcity located at a different context in Tomcat? eg, something like http://your_server/teamcity/
Perhaps that is why the build list is not loading correctly. Can you please send a screen shot of the browser console trying to load the builds?locator=...
URL?
Expected Behavior
Using nested subproject definitions, I would like to define a webhook configuration at the top (e.g. _Root) and select only nested project that we require. In this way, we can reduce duplications in different subproject that use same channel/url
Current Behavior
No possibility to select nested subprojects; only one level of nesting is allowed to share same configuration