Help with Build information radiator/monitor

Hi All,

I'm currently writing my own Build information radiator/monitor and I was wondering if someone could give me a hand. Currently the monitor is showing builds that have failed and been successful, however i also wish for builds that are currently building to appear on the monitor. I've been looking through the javascript and so far unsuccessfully got this to work, so I wanted to know is there anything like below which will identify builds that are currently running.

<jsp:useBean id="buildType" type="jetbrains.buildServer.serverSide.SBuildType"/>

<c:if test="${buildType.status.successful}">

Thanks in advance.

8 comments

Hi,

  <jsp:useBean id="buildType" type="jetbrains.buildServer.serverSide.SBuildType"/>
  <c:forEach var="runningBuild" items="buildType.runningBuilds">
    Status line: ${runningBuild.statusDescriptor.text}<br />
  </c:forEach>

  Is it what you are looking for?

  Regards,
   KIR

0

Hi Kir,

Thanks for the reply. Unfortunately that is not exactly what i'm after. So the way that you suggested will cause all builds to appear even when they are not running, however i'm after only the builds that are currently running to be shown..

Thanks

0

Hi,

  items="$(buildType.runningBuilds}" means that only currently running builds will be shown

  Regards,
  KIR

0

I have it working now thanks, just needed to edit some of my code but the method you gave is now working perfectly .

Thanks again,

Geno

0

So currently i've got a monitor showing builds which are successful/failing and builds that are building. Each build will appear on the monitor in its own table whose background colour is set to green/red or blue depending on it's status. However I've been unable to get the builds that are building to turn the table blue to state that a build is in progress (i've managed to add a new table which identifes the builds in progress but this is not the implementation I would like). As this is my first time writing using jsp I am probably making a rookie mistake but if you could spare some time to look at the code I currently have and tell me where i'm going wrong.

Below is my successful builds part of my code. Basically the idea here is that if a build is sucessful it will be shown in its table with a background colour of green, however if the build is currently being built i would like the background colour of the table to be blue.

<c:forEach items="${projectMap}" var="project">
      <c:forEach items="${project.value}" var="buildType">
        <jsp:useBean id="buildType" type="jetbrains.buildServer.serverSide.SBuildType"/>

<c:if test="${buildType.status.successful}">
   <c:choose>
        <c:when test="${buildType.runningBuilds != buildType}">
             <c:set var="buildRunning" value="true"/>
                 <table >
                 <tr>
                    Table stuff....
                  </tr>
                 </table>
       </c:when>
       <c:otherwise>
             <c:set var="buildSuccess" value="true"/>
                  <table >
                   <tr>

                    Table stuff...
                   </tr>
                  </table>
     </c:otherwise>
  </c:choose>
   </c:if>
  </c:forEach>
</c:forEach>

Thanks in advance,

Geno

0

Hello Geno,

  From your code, I believe you didn't get the concepts exactly.

  For each project, there are many build configurations (buildTypes).
  For each buildType, there are zero or many running builds, and zero or many finished builds.

  Each build configuration (or buildType) has a status, which is caclulated from last finished build + from all running builds.
  This status is obtained from buildType.status

  buildType.runningBuild returns a collection of running builds (if there are any). Each build in the collection has type SRunningBuild, which has its own current status.

  The test ${buildType.runningBuilds != buildType} from your code has no meaning, it will always evaluate to true.
   If you want to test if there are running builds for given configuration, you need to test for "${not empty buildType.runningBuilds}".

   Hope this helps,
   KIR

0

If I understood you correctly, if I replace ${buildType.runningBuilds != buildType} with ${not empty buildType.runningBuilds} in my code above, it will look through the array of configurations and look to see if it has successfully built on it's last finished build. If this is true it will then look to see if it is currently building from looking at the runningBuilds collection. Would it pickup the individual configuration or would it pickup all configurations that are currently building?

Cheers,
Geno

0

Just to let you know that replacing ${buildType.runningBuilds != buildType} with ${not empty buildType.runningBuilds} works correctly and only identifies the current build configuration.

Thanks for the help,

Geno

0

Please sign in to leave a comment.