Build shortcuts - PlaceId.SHOW_FLOW_BLOCK

Completed

Hi

I'm trying to add a custom link to the popup shown in the 'Build shortcuts' popup. I do it by extending SimplePageExtension and using the PlaceId.SHOW_FLOW_BLOCK constant:

public final class MyFlowExtension extends SimplePageExtension {
super(pagePlaces, PlaceId.SHOW_FLOW_BLOCK, "fooBar", pluginDescriptor.getPluginResourcesPath("fooBar.jsp"));
...
}

It sort of works 'magically' since regardless of what 'id' I use in the call above, it always shows a link to the custom build result tab that I've declared/added in the same teamcity plugin (which is of type ViewBuildTab).

But, the isAvailable method and the fillModel method on MyClassFlowExtension, and the configured jsp are never invoked.

Also, if I return false from isAvailable in my custom ViewBuildTab, then the build shortcuts popup shows a blank line.

Can you please provide some guidance on how to properly hook into the build shortcuts menu?

Thanks and kind regards, Etienne

PS I've found this link, but it is two years old:https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206047209-How-to-display-a-live-link-in-Build-shortcuts?input_string=Build%20shortcuts-%20PlaceId.SHOW_FLOW_BLOCK 

0
6 comments

Hi Etienne,

 

This PlaceId is deprecated and actually it was our mistake to leave it, as it does not work anymore.

There is no dedicated extension for build actions menu, but you can provide your own link there. Please have a look at this plugin:

https://github.com/pavelsher/build-chain-export

Specifically at:

https://github.com/pavelsher/build-chain-export/blob/master/buildChainExport-server/src/main/java/org/jetbrains/teamcity/buildChainExport/controllers/BuildResultsExtension.java

and

https://github.com/pavelsher/build-chain-export/blob/master/buildChainExport-server/src/main/resources/buildServerResources/buildResults.jsp

 

 

0

Hi Pavel

Thanks for your reply. I was able to successfully apply the code you pointed out. But, unfortunately, there was a misunderstanding (sorry if I was not not precise enough): I would like to add a link to the 'Build shortcuts' menu (below Build log, Parameters, Tests, Dependencies). See attached screenshot.

Do you have a project that demonstrates how this can be achieved? That would be awesome!

Etienne

 

0

Sorry for delay.

This menu includes all extensions registered for PlaceId.BUILD_RESULTS_TAB. The simplest way to do that is to extend  ViewBuildTab abstract class. 

 

0

Thanks, Pavel, that works well. Two thoughts on this:

1) There is a UI glitch related to the appearance in the menu. I've opened an issue for it: https://youtrack.jetbrains.com/issue/TW-47334

2) Is there any way I can also add a pipe and some custom link in that menu? (just like it is done for 'Build log | .zip')

Etienne 

 

 

 

0

2) Is there any way I can also add a pipe and some custom link in that menu? (just like it is done for 'Build log | .zip')

I can't think of any easy ways. Maybe with help of some JS hack this is possible, but it's trial and error path.

0

#1 got already fixed in the meantime - thanks! https://youtrack.jetbrains.com/issue/TW-47334

#2 I've created a feature request: https://youtrack.jetbrains.com/issue/TW-47358

Etienne

0

Please sign in to leave a comment.