TeamCity sync `triggeredBy` information
cburgmer opened this issue · comments
There are two fields we can extract that information from:
"snapshot-dependencies": {
"build": [
{
"buildTypeId": "SimpleSetup_Test",
"href": "/httpAuth/app/rest/builds/id:46",
"id": 46,
"number": "14",
"state": "finished",
"status": "SUCCESS",
"webUrl": "http://localhost:8111/viewLog.html?buildId=46&buildTypeId=SimpleSetup_Test"
}
],
"count": 1
}
and
"triggered": {
"date": "20160508T071736+0000",
"details": "##triggeredByBuildType='bt3' triggeredByBuild='14'",
"type": "unknown"
}
snapshot-dependencies
seems to have the data in the format we need, but seems to have a bunch of problems:
- This points to the previous build, even if there is a temporal disconnect due to separate user actions (running the latter job when there's a successful build of the job in the chain before seems to omit a complete chain invocation). As such not well suited for temporal analysis of the pipeline.
- Requires the pipeline to use the snapshot dependencies configuration for TeamCity, which might make setup difficult as buildviz will not sync out-of-the-box for a setup without. (Unsure how widely this config is used across teams.)
triggered
seems to have its own set of issues:
- The necessary data is encoded in an internal representation, and might change in the future. Resolving though is possible as the alternate id resolves against
/app/rest/buildTypes/bt3
for example. - In some cases if the latter job of a pipeline chain is triggered, this could lead to the previous chain to be invoked. However the
triggered
value will only call out the user action (type: user).