-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default branch trigger setting in UI #166
Comments
Hi @ailjushkin That page allows editing of the template content, but that requires the rest API. If you don't want to change any of the template content, then you don't need it. To filter for specific criteria, you can use a filter. See #117 for more info. |
@netwolfuk |
Hi @ailjushkin Your case is actually easier. There is already a webhooks parameter called You just need to get the filter added to your webhook checking that that value is I agree it is nicer to have a UI for filters. It's on the road map for 1.2. |
Can i do this on a per project basis or this filter is defined globally in teamcity? |
It's per webhook configuration. So whenever that webhook would have triggered, it also applies the filter as an extra criteria. |
If you wanted to add extra criteria, you can also add another filter. The filters will be ANDed. By that I mean both filters have to evaluate to true for the webhook to trigger. |
@netwolfuk sorry man, now I got it, thank you |
You're welcome. Sorry it's a pain at the moment. I'm going to put out 1.2 alpha 7 this week, and then the UI for filters is the next ticket I'm working on. It'll be in 1.2 alpha 8, but I don't have an ETA for that yet. |
@netwolfuk thanks, so we have tried to write this config /teamcity_data/.BuildServer/config/projects/
We are triggering a non-default branch in a build under the |
That looks like it should be fine. I'll take a look when I get to the computer and test it. Maybe best to edit your comment and remove your URL. |
@netwolfuk I updated the issue with some details and removed url |
HI @ailjushkin I have coped and pasted your config into my build and it worked correctly for me. To be sure can you please check the history page and see what it shows? Also, you can please check what the value is for Trigger a build for your main branch and another branch. After the builds have completed, you can visit You should see a big chunk of JSON, and somewhere in there you'll see some values like below.
Default branch:
|
Unfortunately, I see the same result for both branches. This is our project structure:
Meanwhile the property file is located at: Additionally, I have checked branchIsDefault using legacy webhook and it's What is the states structure? Does it have to have the state option for branchIsDefault? Not it hasn't.
|
Thanks so much for this info. I'll spin up a new TeamCity docker, and install the exact versions you have of everything with the same project layout. |
The states represent the build events that TeamCity allows me to bind to. WebHookListener registers and listens for these events issued by the teamcity server.
These are build lifecycle events
When buildFInished event is triggered, tcWebHooks looks at the result and triggers one of the following pseudo events
It also looks through previous builds in the history, and tries to determine from previous finished statuses
They are the events that can you trigger on. Each build has a bunch of context with it. This is the configuration and result at the time the event occurred. I hope that makes sense. Yes "states" in the config should really be "events". "State" is more like the context of the event. |
I now have the exact same setup as you, and I am getting the correct result. WebHooks are triggering on the default branch, but not on the feature branches.
Can I check how you are configuring your branches? I have my branch specification set as the following: Also, are there any errors in the |
Also just tested on
Everything looks good for me |
oh, just checking. Do you have any parameters defined? |
Hmm. I just tested with |
Hi @ailjushkin I tried with the settings you have shown me. And I pushed to But refuses (correctly) to trigger the webhook for non-default branches. Can you please check if there is anything on your |
Can you also please confirm the tcWebHooks version? |
@netwolfuk we have searched through the log for strange things and my colleague found that those project settings are cached on a server and they are not updating until the server is rebooted. It's difficult operation so have we decided to try to store project settings under version control to check whether it solves the problem or not |
Thanks @ailjushkin If I understand correctly, the edits you made to the |
@netwolfuk yep, exactly) |
ok, that's interesting. This is what I see in the logs when I manually edit that file...
|
@netwolfuk If I correctly understood our admin, this is because of our "huge" teamcity server. When it comes to an enterprise, things become strange |
This can now be done in the UI. Could you take a look and see if this is resolved in 1.2.0 @ailjushkin ? |
Expected Behavior
User set up new project, for instsance, for building base (default) branch and pull-requests automatically.
Pull-request build status is being sent to the BitBucket pull-request and those who had created it, will see if it fails or not.
default branch status is being sent to the devops chat using this plugin webhook, because base branch should be always green.
Devops does not need to watch for feature branches. They set up branch filter for webhook plugin to get alerts only for default branch, not for features.Or turning on the checkbox saying that this webhook is triggered only if it's default branch.
Current Behavior
No branch filter option. No any chance to filter branches. All branch results are triggered.
Your Environment
There is also a badge saying "The WebHooks REST API plugin is not installed. Most settings on this page will non-functional." but i don't know if it is connected to the problem.
The text was updated successfully, but these errors were encountered: