Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-34641

Update CCtray (cc.xml) to support Jenkins2 folders

      For situation when jobs have the same names but placed in different folders, cc.xml return the same "name" filed for all job, so this is lead to confusion.

      For example:

      Jobs:

      http://jenkins/job/Folder1/job/Build/
      http://jenkins/job/Folder1/job/Tests/
      http://jenkins/job/Folder2/job/Build/
      http://jenkins/job/Folder3/job/Tests/
      

      CCtray:

      <Project webUrl="http://jenkins/job/Folder1/job/Build/" name="Build" lastBuildLabel="63" lastBuildTime="2016-05-06T09:59:59Z" lastBuildStatus="Success" activity="Sleeping"/>
      <Project webUrl="http://jenkins/job/Folder1/job/Tests/" name="Tests" lastBuildLabel="25" lastBuildTime="2016-05-04T14:58:39Z" lastBuildStatus="Failure" activity="Sleeping"/>
      
      <Project webUrl="http://jenkins/job/Folder2/job/Build/" name="Build" lastBuildLabel="63" lastBuildTime="2016-05-06T09:59:59Z" lastBuildStatus="Success" activity="Sleeping"/>
      <Project webUrl="http://jenkins/job/Folder2/job/Tests/" name="Tests" lastBuildLabel="25" lastBuildTime="2016-05-04T14:58:39Z" lastBuildStatus="Failure" activity="Sleeping"/>
      

      So after import we will receive following jobs:

      Build
      Tests
      Build
      Tests
      

      Expected results:

      CCtray:

      <Project webUrl="http://jenkins/job/Folder1/job/Build/" name="Folder1/Build" lastBuildLabel="63" lastBuildTime="2016-05-06T09:59:59Z" lastBuildStatus="Success" activity="Sleeping"/>
      <Project webUrl="http://jenkins/job/Folder1/job/Tests/" name="Folder1/Tests" lastBuildLabel="25" lastBuildTime="2016-05-04T14:58:39Z" lastBuildStatus="Failure" activity="Sleeping"/>
      
      <Project webUrl="http://jenkins/job/Folder2/job/Build/" name="Folder2/Build" lastBuildLabel="63" lastBuildTime="2016-05-06T09:59:59Z" lastBuildStatus="Success" activity="Sleeping"/>
      <Project webUrl="http://jenkins/job/Folder2/job/Tests/" name="Folder2Tests" lastBuildLabel="25" lastBuildTime="2016-05-04T14:58:39Z" lastBuildStatus="Failure" activity="Sleeping"/>
      

      List of jobs after import:

      Folder1/Build
      Folder1/Tests
      Folder2/Build
      Folder2/Tests
      

          [JENKINS-34641] Update CCtray (cc.xml) to support Jenkins2 folders

          It may be obsolete-ish, but it is really to easy to use and things like the GitHub Authorization plugin expose it without requiring username and password if you want.

          Christian Höltje added a comment - It may be obsolete-ish, but it is really to easy to use and things like the GitHub Authorization plugin expose it without requiring username and password if you want.

          Sorin Sbarnea added a comment -

          danielbeck `cc.xml` is the only portable way to get build status information from a build system. That's the only "API" that works across multiple build-systems. In the real world people do have to get status from multiple build-systems, not only Jenkins. I monitor Jenkins, Travis, Bamboo, ... and many others.

          People wrote build-status client applications for a huge range of platforms: Linux, MacOS, Windows, iOS, Android and even browser plugins. You can't expect all these developers to have to implement a specific API just for Jenkins.

          I hope this explains it why I do think that cc.xml is not really something that's supposed to go away in the foreseeable future.

          Sorin Sbarnea added a comment - danielbeck `cc.xml` is the only portable way to get build status information from a build system. That's the only "API" that works across multiple build-systems. In the real world people do have to get status from multiple build-systems, not only Jenkins. I monitor Jenkins, Travis, Bamboo, ... and many others. People wrote build-status client applications for a huge range of platforms: Linux, MacOS, Windows, iOS, Android and even browser plugins. You can't expect all these developers to have to implement a specific API just for Jenkins. I hope this explains it why I do think that cc.xml is not really something that's supposed to go away in the foreseeable future.

          Daniel Beck added a comment -

          ssbarnea Not sure what your point is. I've not seen a lot of mention of this feature around the Jenkins community, and the format appears to be obsolete based on the format definition being not even around anymore, so my recommendation is based off the expectation that, unless you're willing to do it yourself, there probably won't be a fix coming from the usual suspects any time soon.

          Besides, Jenkins supports plugins, and writing a "cc.xml" plugin would probably be a nice beginner's exercise, or sample code plugin, if it ever got dropped from Jenkins (without being moved into a plugin, as we typically do).

          Daniel Beck added a comment - ssbarnea Not sure what your point is. I've not seen a lot of mention of this feature around the Jenkins community, and the format appears to be obsolete based on the format definition being not even around anymore, so my recommendation is based off the expectation that, unless you're willing to do it yourself, there probably won't be a fix coming from the usual suspects any time soon. Besides, Jenkins supports plugins, and writing a "cc.xml" plugin would probably be a nice beginner's exercise, or sample code plugin, if it ever got dropped from Jenkins (without being moved into a plugin, as we typically do).

          Sorin Sbarnea added a comment -

          In fact I was looking at Jenkins code as I wanted to implemented the fix myself and do my first core contribution

          I was a little bit surprised to find that the only occurrence of cc.xml in the code was here:

          core/src/main/resources/hudson/model/View/builds.jelly
          42:          <a href="cc.xml">${%Export as plain XML}</a>
          

          PS. As Java (or Jelly) is not among by "native" languages, it may take a bit of time to figure out exactly what I have to do to make it work. You are welcomed to assign the bug to me as I don't expect others to work on it.

          Sorin Sbarnea added a comment - In fact I was looking at Jenkins code as I wanted to implemented the fix myself and do my first core contribution I was a little bit surprised to find that the only occurrence of cc.xml in the code was here: core/src/main/resources/hudson/model/View/builds.jelly 42: <a href= "cc.xml" >${%Export as plain XML}</a> PS. As Java (or Jelly) is not among by "native" languages, it may take a bit of time to figure out exactly what I have to do to make it work. You are welcomed to assign the bug to me as I don't expect others to work on it.

          Daniel Beck added a comment - https://github.com/jenkinsci/jenkins/blob/master/core/src/main/resources/hudson/model/View/cc.xml.jelly

          Sorin Sbarnea added a comment -

          Sorry by I don't know Jelly to fix that but I just wanted to remark that cc.xml is not so really obsolete, is quite used as as non vendor specific API to check build status, and its use is documented even on Jenkins wiki at https://wiki.jenkins.io/display/JENKINS/Monitoring+Jenkins

          Sorin Sbarnea added a comment - Sorry by I don't know Jelly to fix that but I just wanted to remark that cc.xml is not so really obsolete, is quite used as as non vendor specific API to check build status, and its use is documented even on Jenkins wiki at  https://wiki.jenkins.io/display/JENKINS/Monitoring+Jenkins

          Devin Nusbaum added a comment -

          Devin Nusbaum added a comment - I think this should be fixed by https://github.com/jenkinsci/cctray-xml-plugin/pull/1 .

          Daniel Beck added a comment -

          Not while https://github.com/jenkinsci/jenkins/pull/2691 is open, but I guess this means I'll have to take care if it within the next few days now?

          Daniel Beck added a comment - Not while https://github.com/jenkinsci/jenkins/pull/2691 is open, but I guess this means I'll have to take care if it within the next few days now?

          Devin Nusbaum added a comment -

          Yeah we'll have to update the plugin url once cc.xml is removed from core. It would be good to get it all taken care of at the same time.

          Devin Nusbaum added a comment - Yeah we'll have to update the plugin url once cc.xml is removed from core. It would be good to get it all taken care of at the same time.

          Daniel Beck added a comment -

          https://github.com/jenkinsci/jenkins/pull/3060 and https://github.com/jenkinsci/jenkins/pull/3081 made it into core, and the first actual release of cctray-xml plugin includes those changes (in a slightly different form)

          Docs: https://github.com/jenkinsci/cctray-xml-plugin#usage

          Daniel Beck added a comment - https://github.com/jenkinsci/jenkins/pull/3060 and https://github.com/jenkinsci/jenkins/pull/3081 made it into core, and the first actual release of cctray-xml plugin includes those changes (in a slightly different form) Docs: https://github.com/jenkinsci/cctray-xml-plugin#usage

            Unassigned Unassigned
            amrichko Andy Mrichko
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: