tcplugins / tcWebHooks

WebHooks plugin for Teamcity. Supports many build states and payload formats.
https://netwolfuk.wordpress.com/category/teamcity/tcplugins/tcwebhooks/
155 stars 30 forks source link

Managing Webhooks from Top to Bottom #209

Closed Super8film87 closed 1 year ago

Super8film87 commented 1 year ago

Expected Behavior

If I add a Webhook on the top level of a Project should enable to use the same Webhook on the bottom level.

Current Behavior

It works only in the defined Project not above (as expected) not below. So establishing a new webhook have to be done manually for all projects which are available in the environment. Any possibility by managing this via RestApi?

Your Environment

netwolfuk commented 1 year ago

Hi @dirk-frerichs

The intended behaviour is that all sub-projects inherit a webhook. This is what the "All Sub-Project Builds" checkbox configures in the second tab of the edit webhook dialog does. Is that option ticked for you?

image

netwolfuk commented 1 year ago

I have just spotted a UI bug where the list of builds to select (shown in the above screenshot as non-bolded) can sometimes contain all the builds from all sub-projects.

It should only contain builds in the current project. I don't think this is affecting your expected behaviour, but I'll do some testing to confirm.

Also, yes it is possible (since 1.2.0- alpha.10) to add/edit/delete webhooks via the REST API. I can create an example for you. However, I believe we shouldn't need to for your use case since the "All Sub-Project Builds" checkbox should be doing what you want.

netwolfuk commented 1 year ago

Release 1.2.0-rc.3 fixes the issue I found with regards to showing all the builds from all sub-projects.

Super8film87 commented 1 year ago

Tanks for your fast response. I just tested it like that: image

quiete a bunge of layers. So starting from the ThirdLayer it is as expected image

if I go to the top: image

But I cannot configured on the Top Layer in this approach.

Is it possible that you provide to me an example? This would be vey helpful.

netwolfuk commented 1 year ago

Hi. Thanks for the detailed explanation. Based on this I have found a possible bug that only exhibits in a peculiar fashion.

The new webhook is created using a different means than if it was loaded from config in TeamCity restart. When initially created a value is left as null and then webhooks in this state fail to execute.

However this doesn't happen after a TeamCity restart. This explains why I have not seen this issue before.

I'll do some more testing and try to get a release out tomorrow. In the mean time, if you restart TeamCity, your webhook will probably work as intended. It only appears to affect new webhooks.

netwolfuk commented 1 year ago

RC4 released which should fix the issue you're seeing @dirk-frerichs

https://github.com/tcplugins/tcWebHooks/releases/tag/v1.2.0-rc4