How to show build tab only for projects where build runner is defined

Hi all,

I've successfully created a TeamCity build runner plugin. It works fine, people are able to select it from the "Runner type" drop down list when configuring the Build Steps section of a build.
I've also added two build tabs by extending the abstract ViewLogTab object. They also work fine, they appear as they should when people click on a build result.

However, the tabs also appear for builds that belong to projects where the plugin has NOT been added as a build step. They show up for every single build result, even for projects that have not defined the plugin.

I've attached an image to make it clear what type of tab I mean.

How can this be avoided?

I'm grateful for any help.
Andras



Attachment(s):
Example of build tabs.PNG
3 comments
Comment actions Permalink

Hi Andras,

To show tab only on some specific builds, you should properly override "jetbrains.buildServer.web.openapi.ViewLogTab#isAvailable(HttpServletRequest, SBuild)" method.

PS: Is that https://github.com/ApicaSystem/Apica.LoadtestPortal.TeamCityBuildRunner plugin?

0
Comment actions Permalink

Hi Vladislav,

Thanks for your help, I appreciate it.
Do you know of a good example of how to override the isAvailable function for this specific purpose? If not, then I'll try to figure it out. I guess I'll need to explore the SBuildServer object passed into the ViewLogTab constructor.

Yes, it's the Apica load test plugin I'm referring to.

Best regards,
Andras

0

Please sign in to leave a comment.