Global tab?

I'd like to add a custom tab as part of my plugin that's a global tab -- i.e. appears with the other tabs like Project, My Changes, Agents, etc.  Do any of the existing PlaceIds allow me to place a new tab there, or is there some other way I can add one?

8 comments

Donald,

There is no open API to add a tab there. A workaround can be to add a JavaScript code that will add the tab via JavaScript call.
However, this approach is not a stable one and can break with further TeamCity updates.

0

Are there any plans to add an open API to allow tabs there? It'd make integrating our deployment system with TeamCity much easier.

In the meantime, how would I add an extra tab via JavaScript?

0
Donald,

So far no specific plans for making JavaScript part of open API since this will add more constraints to our client side development. However, feel free to add a feature request so that others can vote and add own use cases.

For current approach you can see the JS code in the current pages.
e.g. you can use something like:

      var topNavPane = new TabbedPane('tabs');
      topNavPane.addTab("queue", {
        caption: "Custom Tab",
        url: "/myCustomTab.html"
      });


And the JavaScript can be added inside <script> HTML element via

ALL_PAGES_FOOTE

See more on plugin part at the doc.

BTW, can you share what kind of extension do you write? Any plance for making it available to other TeamCity users?
0

Ah, I've had a play and got this working.

Where do I add feature requests?  I don't need a JavaScript API, just some mechanism to say "I'd like a top-level tab" and some simple way to wrap my pages so they have the same header and footer as other TeamCity pages.  Something like the custom tabs you already support, just one that isn't hidden away in the settings pages or associated with a particular project or build.

What I'm doing with TeamCity plugins: we have an in-house system to deploy our app to our staging and production servers, and a TeamCity plugin that adds some tabs to builds to allow deployment (to stage) directly from TeamCity.  I'm currently adding some way of tracking which set of build artifacts (multiple artifacts from different projects) will be released to production on a "release event" to make our housekeeping a little easier.  But this is all internal code, it's tied to our deployment system so it's not going to be much use to other TeamCity users.

0

> Where do I add feature requests?

In our issue tracker: http://youtrack.jetbrains.net/issues/TW

> I don't need a JavaScript API, just some mechanism to say "I'd like a top-level tab"
There can be many other related requests and it would be strange to allow adding a tab in one place and not in another. And API can be however small, the case is that we cannot freely change it afterwards as there can be plugin usages.
So far it does not seem probable that we will freeze some JavaScript part to guarantee we will not change it without notification.

> and some simple way to wrap my pages so they have the same header and footer as other TeamCity pages.

This can be done using apporopriate jsp code in your page on the server-side. Example can be found e.g. in
http://svn.jetbrains.org/teamcity/plugins/swabra/trunk/server/resource/buildServerResources/handle.jsp


Thank you for the description of your plugin. It's always interesting to know what CI/deployment needs different companies have and how they address them. Feel free to suggest features for TeamCity that would cover your needs and can be useful to other users as well.

If I understand your need right, at some point it can be probbaly addressed in TeamCity like:
A build in TeamCIty that is doing some release preparation step e.g. collecting all to-be-released binaries from other builds and uploading them to some storage. The binaries are retrieved from other builds via TeamCity artifact dependencies.

Your target page description then looks like a page associated with that release preparation build to list all the builds/binaries it will use if triggered right now.

0

I agree it'd be odd to allow adding tabs in one place but not another ... but the TeamCity API already allows tabs to be added in many places (e.g. to a build with PlaceId.BUILD_RESULTS_TAB), just not to the tab bar at the top of every page.

Our release preparation process wouldn't fit into a "release is a build", it's more of a "release is a set of tested artifacts from a number of builds of different apps".  The set of apps which are part of a release changes between releases too.  And we don't allow deployment from TeamCity to production.

0

Just to make it interlinked for anyone willing to vote:
The issue is filed as TW-14948.


> it's more of a "release is a set of tested artifacts from a number of builds of different apps"

My suggestion was just on keeping the logic on collecting the artifacts in a special separate build (just like you do it on a separate page). This way  it can have a history, etc.

However, I do understand that not all release approaches can fit into that.

0

If I understand your need right, at some point it can be probbaly addressed in TeamCity like:

A  build in TeamCIty that is doing some release preparation step e.g.  collecting all to-be-released binaries from other builds and uploading  them to some storage. The binaries are retrieved from other builds via  TeamCity artifact dependencies.

I would definitely be interested in something like this. Currently we use teamcity for deployment and have ant-projects which scp files to staging and production servers, but a more integrated approch would be welcome.

0

Please sign in to leave a comment.