Comments (16)
Hmm. ~~Looking at the code in that file on line 121, I don't think it ever worked for muted.
It checks for a non-empty list of tests before executing the webhook. School boy error. 🫣~~
Ignore. It's too late. I'm not being sense.
from tcwebhooks.
Another question with this... What is the 13=
and 11=
on these?
I'm using the legacy / deprecated name value pairs format to get these, so it may just be a side affect of that, but not entirely sure how they'll format in json?
Nevermind: figured it out... It's the default .toString()
implementation of MuteInfo
- it just renders the id.
from tcwebhooks.
I am looking at exactly that file right now :)
from tcwebhooks.
I've updated the instructions at https://github.com/tcplugins/tcWebHooksTemplates
from tcwebhooks.
Hi @matt-richardson. Thanks for your detailed report (as per usual).
If I remember correctly, the list of tests was not available for muted.
I'll have a look at your suggestion just in case I missed something obvious.
from tcwebhooks.
Thanks @matt-richardson. It looks like your suggestion works.
I've pushed to a branch here: https://teamcity.jetbrains.com/buildConfiguration/WebHooksAndOtherPlugins_TcWebHooks?branch=issue_219-muted-tests&buildTypeTab=overview&mode=builds
Can you give that a try and I'll look to do so a release later this week if it all goes well.
from tcwebhooks.
Happy to report that it works successfully for both muted and unmuted now :success:.
derivedBuildEventType | TESTS_MUTED
mutedOrUnmutedTests | {13=[suiteName: nestedSuiteName: package_or_namespace.ClassName.TestName]}
derivedBuildEventType | TESTS_UNMUTED
mutedOrUnmutedTests | {11=[suiteName: nestedSuiteName: package_or_namespace.ClassName.TestName]}
from tcwebhooks.
I imagine it the result of calling toString
on that value.
This is what I get.
I am doing the following in velocity
## Define macro called "showTests"
#macro( showTests $myTests)
#if ( $myTests.size() > 0 )
#foreach( $tests in $myTests.keySet() )##
#foreach( $test in $tests.getTests() )##
• #escapejson($test.name)
#end
#end
#else No Changes found #end
#end
It prints the bulleted list in the following screenshot when posted to Slack.
from tcwebhooks.
I've successfully got this all working to my needs - I'm now able to get hooks with:
{
"event": "TESTS_UNMUTED",
"tests": [
{
"name": "suiteName: nestedSuiteName: package_or_namespace.ClassName.TestName",
"id": "-8186798926076262107",
"user": "[email protected]"
}
]
}
and
{
"event": "TESTS_MUTED",
"tests": [
{
"name": "suiteName: nestedSuiteName: package_or_namespace.ClassName.TestName",
"id": "-8186798926076262107",
"user": "[email protected]"
}
]
}
For posterity, this is based on the following template:
{
"event": "$buildEventType",
"tests": [
#foreach( $entry in $mutedOrUnmutedTests.entrySet() )##
#foreach( $test in $entry.value )##
{
"name": "#escapejson($test.name)",
"id": "$test.testNameId",
"user": "$entry.key.mutingUser.username"
}#if( $foreach.hasNext ),#end
#end
#end
]
}
from tcwebhooks.
Nice work. Thanks for the update. I'll get a new release out over the weekend. Thanks for your help on this.
from tcwebhooks.
@matt-richardson If you get a chance, you could pop those into https://github.com/tcplugins/tcWebHooks/wiki/WebHook-Templates-%3A-The-Velocity-Templating-Engine
from tcwebhooks.
Good call - I've updated the wiki 👍
Looks like 1.2.3 is out - I'll give that a go.
from tcwebhooks.
Very nice. I like the foreach.hasNext
to conditionally add the closing comma.
Thanks again. I think we can close this ticket.
from tcwebhooks.
FYI. If you're interested in sharing a working template set, there is a project here: https://github.com/tcplugins/tcWebHooksTemplates
I really really need to update the instructions on that repo for exporting and importing templates, as it's all possible via the GUI now. No more curl and crazy REST malarky.
from tcwebhooks.
I know I shouldn't add onto a closed issue, but.... i'm going to anyway 😂
Im seeing a bunch of errors:
[2023-07-18 02:16:17,787] ERROR [@7438424f'; Normal executor 28] - jetbrains.buildServer.SERVER - AbstractWebHookExecutor :: trackingId: dadfab32-86b1-4bab-8c1a-afd38e6870e4 :: projectId: OctopusDeploy_OctopusServer_CorePlatform :: webhookId: id_905369674 :: templateId: buildmonitormutes, errorCode: 902, errorMessage: Template 'buildmonitormutes' does not support build state 'beforeBuildFinish'
The template is configured like this:
But the webhook is showing all the boxes as ticked, but disabled:
Am I holding it wrong?
from tcwebhooks.
Looks like a UI issue. Can you please raise as a new ticket?
I think it's because the template was re-selected in the UI from one that did support all event types, hence are selected but disabled.
You might be able to work around by opening and saving and opening the webhook again.
from tcwebhooks.
Related Issues (20)
- Impossible to save WebHook configuration for non system admin users HOT 5
- Managing Webhooks from Top to Bottom HOT 6
- Investigate Mute or Fix Test callback HOT 6
- TeamCity server cpu and memory spike after enabling tcwebhooks HOT 9
- Calculate Queue and single Build Step Duration HOT 5
- Calculate Time To Restore HOT 7
- #substringBefore(${buildLog} and alternatives HOT 1
- Webhook that only allows Mute/Unmute events should not allow other events to be selected HOT 4
- build.FinishDate is empty even build is finished HOT 5
- Send all parameters as valid json to elasticsearch HOT 12
- Legacy Webhook Build Failed Template wrong HOT 3
- Cannot format date HOT 10
- Get Information from Performance Monitor (BuildFeature) HOT 4
- Password field is in plan text HOT 3
- REST API returns 500 when editing webhook HOT 7
- Unexpected Error when accessing webhook search results HOT 9
- Cloud Profiles "Events" HOT 4
- Edited Discord template does not send notification. HOT 1
- TeamCity Webhook is removed if you are using versioned settings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tcwebhooks.