FlowId support

Hello!

Given the documentation on FlowId, am I to understand that FlowId is only compatible with the “message” service message?

##teamcity[message text='<message text>' flowId='1']

Right now I'm understanding “messages” to reference “service messages” in:

Any message supports the optional attribute flowId that allows you to group messages into separate categories (flows)

I would have loved to attribute progress messages to a given block by flowId but it feels weird and doesn't work. E.g.:

##teamcity[blockOpened name='block 1' flowId='1']
##teamcity[blockOpened name='block 2' flowId='2']
##teamcity[progressMessage 'Message 1' flowId='1']
##teamcity[progressMessage 'Message 2' flowId='2']

What are my options?

Thanks.

 

0
2 comments

Hi! 

It should be possible to use flowId with other service messages (blocks, tests, progress, etc.), not just message. Have you tried to explicity define the Explicitly define the start and end of your flows?

##teamcity[flowStarted flowId='1']
##teamcity[blockOpened name='block 1' flowId='1']
##teamcity[progressMessage 'Message 1' flowId='1']
...
##teamcity[blockClosed name='block 1' flowId='1']
##teamcity[flowFinished flowId='1']

Please let me know if this helps. If it does not work for you, please share more details, such as an example script to run in a build step and the resulting build log.

Thanks

0

Hi Guilherme, thanks for your reply.

I tried your suggestion directly in a simple build step with the Powershell runner, with some harmless extra messages:

Write-Host "##teamcity[flowStarted flowId='1']"
Write-Host "##teamcity[blockOpened name='block 1' flowId='1']"
Write-Host "##teamcity[progressMessage 'Progress... 1' flowId='1']"
Write-Host "Something"
Write-Host "##teamcity[message text='Message 1' flowId='1']"
Write-Host "##teamcity[message text='Message 2' flowId='1']"
Write-Host "##teamcity[blockClosed name='block 1' flowId='1']"
Write-Host "##teamcity[flowFinished flowId='1']"

And this is what I got:

As you can see, the progress message isn't being written in the “block 1” block. Also, the Progress... 1' flowId='1 evaluation of the single-attribute message is telling me the parser is just evaluating anything in-between the first and last apostrophe disregarding any possible extra attribute.

Now the documentation states that:

Note that the flowStarted and flowFinished messages are in effect only when emitted between the testStarted and testFinished messages.

I'm not doing that in the context of a test but let's try:

Write-Host "##teamcity[testStarted name='Test']"
Write-Host "##teamcity[flowStarted flowId='1']"
Write-Host "##teamcity[blockOpened name='block 1' flowId='1']"
Write-Host "##teamcity[progressMessage 'Progress... 1' flowId='1']"
Write-Host "Something"
Write-Host "##teamcity[message text='Message 1' flowId='1']"
Write-Host "##teamcity[message text='Message 2' flowId='1']"
Write-Host "##teamcity[blockClosed name='block 1' flowId='1']"
Write-Host "##teamcity[flowFinished flowId='1']"
Write-Host "##teamcity[testFinished name='Test']"

And this is what I got:

Same issues suggesting a progress message can't use flowIds and they can't even be used in the context of a flow.

I'm using an older TeamCity version (2023.11.5) but the docs do not reflect any changes on this. Any clues on what to try next?

Thanks for your time!

0

Please sign in to leave a comment.