How to display a live link in Build shortcuts

Greetings,

I’m hopefully near the end of the TeamCity plugin development process and I have one more hurdle to jump.

Background:

My plugin has a server and an agent part.

The server plugin is an Admin Page extension which adds one more tab, and that is used for a single item of global configuration.

The agent plugin is in two parts: an implementation of a BuildCommandLineProcessor, and an extension of an AgentLifeCycleAdapter.  The former captures the BuildRunner’s command line prior to its execution and then modifies it to suit my requirements and then returns it to be executed (code compilation) by the underlying TeamCity framework.  The latter listens for the beforeBuildFinish event, which occurs after the runners have all been run, but before the build is given a final status, generally Success or Failure.  During this ‘phase’, an external utility is called using Java’s ProcessBuilder.  The output from this utility is logged and is available, still within this ‘phase’.  This output, for the purpose of this issue, is a String, which is a URL that shows analysis results from the custom processing.

My objective is to display this URL as a functional link in the, ‘Build shortcuts’, ‘popup’, which appears when clicking the ‘drop-arrow’ right next to the build status.  More specifically, the, ‘Build shortcuts’, ‘popup’, usually shows something like:

Build Shortcuts
Build log | .zip
Parameters

I’d like it to show something very much like the above, but underneath, ‘Parameters’, I’d like to show the URL.

I’m hoping that something like this has already been done, or if not, you could give me some pointers on the ‘architecture’ & requirements behind getting this up and running.  As a milestone, just getting the URL to display there as plain text would be good.

I hope the requirements are clear and if so, if you feel that there is a better way of accomplishing this task, feel free to suggest it.

Thank you very much,

Nic

ps: some other questions:

  • What is the mechanism by which the build agent that performed the processing, makes the url available to the server to be displayed as described?
  • Where are there examples of the locations that PlaceId s define (the java docs aren't explicit)?


Message was edited by: Nic Pantieras, to add postscript questions

1 comment
Comment actions Permalink

For now the only way to add link to this popup is to provide BuildTab (see jetbrains.buildServer.web.openapi.BuildTab class). Then link will be shown pointing to the build tab page, where you probably can show some additional information.

> What is the mechanism by which the build agent that performed the  processing, makes the url available to the server to be displayed as  described?

The easiest way is to publish some artifact to this build under .teamcity directory. In this case it will be hidden from users, but your extension will be able to use it on the server. See jetbrains.buildServer.agent.artifacts.ArtifactsWatcher service on the agent.

> Where are there examples of the locations that PlaceId s define (the java docs aren't explicit)?

You mean Javadoc is not clear enough about some ids? If there are some of the places that you do not understand where they appear or what they do, please tell them to us and we'll try to clarify it.

0

Please sign in to leave a comment.