-
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
Variables not populated in the Started event #102
Comments
I just checked the slack messages. The loaded changes event does have the commit and branch name correctly populated (eg, |
I've created a loaded changes hook that says "Started" as a workaround which will work and I'm ok with upstreaming (if you're ok with merging). I'm coming to Spark from Slack and the tcSlackBuildNotifier plugin which fired a Started message as soon as the build started (it seems) and was able to correctly figure out the branch and commit ID. I don't really know the TeamCity API at all but it looks like it just listens to buildStarted and not changesLoaded. |
I'll have a look at Pete's code and see what he's doing. It's actually a fork of mine from about 5 years ago. |
BTW. Have a look at the tcWebHooksTemplates project on GitHub which I've be working on this week for a way to share templates. |
Yes. He's manually loading the changes and mapping them to a slack username. |
I installed the tcSlackNotifier plugin and have noticed the following behaviour: If there are no changes, the start event does not list anything. If there are changes, then it builds a nice commit message This behaviour is consistent with the tcWebHooks Legacy JSON payload format. To test this, I just created a legacy json webhook and pointed it at However, when I built the Slack template, I used the TeamCity defined parameter because:
I will add some more payload variables to the standard set to give us a bit more info at start. However, in the case where there is a build run without any changes, this will still be blank. Off the top of my head the following would be useful.
These would give the most recent change, although from screenshots, it looks like the tcSlackNotifier lists all contributing changes, not the latest. However, without conditionals in the template it wouldn't solve our problem yet. So to get around that, we could have a macro (like the substring one), at which point it starts to get messy, and I should really just finish the work to support the Velocity template language. |
I need to revisit this in 1.2, as most of these issues should be mitigated with conditionals in velocity templates. |
1.2.0-alpha8 finally released. |
I am working on TeamCity templates for tcWebHooks and I have a branch build template defined like so:
The variable
${substr(build.vcs.number,0,7,32)}
gets defined in the Started hook as ??? but is correctly defined in later hooks:I'm pretty much just copying the Slack templates so I am surprised to see this. Is this expected behavior and is the Slack template doing the same thing?
The text was updated successfully, but these errors were encountered: