This Question is Answered

1 "helpful" answer available (2 pts)
15 Replies Last post: Jul 12, 2010 12:37 PM by Simone Busoli  
Simone  Busoli Novice 201 posts since
Jun 20, 2005
Currently Being Moderated

Mar 16, 2010 12:04 AM

Human interaction plugin

Hi,

 

I have no experience with TC plugin development, and the docs don't explicitly talk about such a kind of plugin.

I would like to know whether TeamCity would support a plugin which adds synchronous user interaction during a build run, that is, blocking and prompting for user intervention before going on with a build run.

Pavel Sher JetBrains 2,148 posts since
Mar 6, 2008
Currently Being Moderated
Mar 16, 2010 12:38 AM in response to: Simone Busoli
Re: Human interaction plugin

Do you want to block before build starts on the agent? If so, I think it is possible to write a build precondition which will require a user to go to some page and somehow approve build before it starts. This way build will not block an agent while user decides to go and approve it.

 

If you need to block build on the agent, this can be tricky, because it is not clear how to approve build in this case. If you need to do it from TC web UI, probably some kind of callback should be done from the agent to the server when build starts. Then agent must wait till build is approved, and continue after that. This kind of plugin is more complex, but I think it is still doable.

Pavel Sher JetBrains 2,148 posts since
Mar 6, 2008
Currently Being Moderated
Mar 16, 2010 10:38 AM in response to: Simone Busoli
Re: Human interaction plugin

With TeamCity API you can: register your own controller which will serve custom pages: http://confluence.jetbrains.net/display/TCD5/Web+UI+Extensions. It is also possible to write start build precondition, which will block build till a user performs an action on the page: http://confluence.jetbrains.net/display/TCD5/Extensions

 

So it seems feasible.

Pavel Sher JetBrains 2,148 posts since
Mar 6, 2008
Currently Being Moderated
Mar 17, 2010 2:56 PM in response to: Simone Busoli
Re: Human interaction plugin

No there is not. You can use any IDE. Most of our open sourced plugins are configured to be used in IntelliJ IDEA, so if you plan to use them as reference you will need an IDEA to open project.

Yegor Yarko JetBrains 1,458 posts since
May 5, 2004
Currently Being Moderated
Jun 28, 2010 11:42 PM in response to: Simone Busoli
Re: Human interaction plugin

Simone,

 

There is no "valid" way AFAIK.

 

However you can probably try to change the Run buttons on client from JavaScript that you can add via your controller to all pages. Please note that this is not a good way of doing things and this approach can spoil the page logic in non-obvious way.

Yegor Yarko JetBrains 1,458 posts since
May 5, 2004
Currently Being Moderated
Jun 29, 2010 12:02 AM in response to: Simone Busoli
Re: Human interaction plugin

Simone,

 

Do you want to display a page on the build starting or somehow in the process of the build?

Frankly, I do not quite understand how you would like it to look for the "inside the build" case.

 

If you want to change the way builds are started you can probably try the following: remove the current Run button at all (e.g. by removing permission to run builds from the users, but this can be not the best way) and add your own control (e.g. in JavaScript) to start a build.

Yegor Yarko JetBrains 1,458 posts since
May 5, 2004
Currently Being Moderated
Jun 29, 2010 1:02 AM in response to: Simone Busoli
Re: Human interaction plugin

Simone,

 


Is it possible to collect all the necesary in formation from the user and the backing systems and then start the build supplying it to the build?

If this can be moved from "inside the build" to "start the build supplying additional data", this can be much more easier to implement.

 

Actually, the first step I'd recomed to try is to support supplying the information to the build via build parameters that you can enter in the custom run build dialog. If that is working, you can create a separate UI (within or even outside TeamCity) that will get all the informatino in a custom UI and some internal logic and then just trigger a build in TeamCity supplying all the inforamtion via build properties.

Pavel Sher JetBrains 2,148 posts since
Mar 6, 2008
Currently Being Moderated
Jul 7, 2010 1:22 AM in response to: Simone Busoli
Re: Human interaction plugin

Sorry for delay with replying. Indeed there aren't many ways to change behavior of the run button. Some hacks are possible, for example, using JavaScript code it is possible to modify behavior of the run button, i.e. to re-route requests to some custom controller.

 

Probably we could add some extension points here. I think it is worth to submit a feature request to our tracker.

More Like This

  • Retrieving data ...