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

API for fetching free style steps and their logs

      In scope

      • Similar to UX-387 so that we can provide the same collapsable log UI for freestyle projects

          [JENKINS-35850] API for fetching free style steps and their logs

          Vivek Pandey added a comment -

          jdumay Whats free style steps? Did you mean Pipeline job type where provide pipeline script during job creation as opposed to Jenkinsfile from git? If this is what you mean then yes it all works thru same backend implementation.

          Vivek Pandey added a comment - jdumay Whats free style steps? Did you mean Pipeline job type where provide pipeline script during job creation as opposed to Jenkinsfile from git? If this is what you mean then yes it all works thru same backend implementation.

          James Dumay added a comment -

          vpandey FreeStyle projects allow you to define "build steps" and I'd like it if we could use the same UI for freestyle logs as we do for pipeline steps

          James Dumay added a comment - vpandey FreeStyle projects allow you to define "build steps" and I'd like it if we could use the same UI for freestyle logs as we do for pipeline steps

          James Dumay added a comment -

          Perhaps I am not explaining so well (help mneale?)

          James Dumay added a comment - Perhaps I am not explaining so well (help mneale ?)

          Vivek Pandey added a comment -

          jdumayI think I get it. mneale mentioned there other day during backend meeting. Basically what you are looking for is that for steps: /nodes/

          {nodeId}

          /steps will give list of build steps defined inside FreeStyleJob.

          Thing with FreeStyle build step is that there are all kind of build steps and there are plugins that add their own custom steps. The steps API will return any such steps that the user has added. I think this should be good enough assumption on this API?

          Vivek Pandey added a comment - jdumay I think I get it. mneale mentioned there other day during backend meeting. Basically what you are looking for is that for steps: /nodes/ {nodeId} /steps will give list of build steps defined inside FreeStyleJob. Thing with FreeStyle build step is that there are all kind of build steps and there are plugins that add their own custom steps. The steps API will return any such steps that the user has added. I think this should be good enough assumption on this API?

          Michael Neale added a comment -

          vpandey what sort of info would be in the /steps for freestyle?

          For example, the docker build and publish step (I think it is a build step) - I understand that you would see the log for that step, but for the non log data, it would just be metadata that may not be of much interest (all the UI would show is the type of step perhaps?)

          Michael Neale added a comment - vpandey what sort of info would be in the /steps for freestyle? For example, the docker build and publish step (I think it is a build step) - I understand that you would see the log for that step, but for the non log data, it would just be metadata that may not be of much interest (all the UI would show is the type of step perhaps?)

          Vivek Pandey added a comment -

          mneale UI can ignore what it doesn't want or care about. API returns BluePipelineStep, so fields like id, displayName, duration, stanrttime etc. will be present.

          Vivek Pandey added a comment - mneale UI can ignore what it doesn't want or care about. API returns BluePipelineStep, so fields like id, displayName, duration, stanrttime etc. will be present.

          Michael Neale added a comment -

          vpandey great

          Michael Neale added a comment - vpandey great

          James Dumay added a comment -

          so theres a path forward for this one?

          James Dumay added a comment - so theres a path forward for this one?

          Michael Neale added a comment -

          jdumay yes!

          Michael Neale added a comment - jdumay yes!

          James Dumay added a comment -

          James Dumay added a comment -

          Vivek Pandey added a comment - - edited

          jdumaymneale Ah, I think I misunderstood the model. I can get definition of each step: FreeStyleProject.getBuilders() -> gives all build steps definitions. However from executed run of a freestyle job , there is only top level run object and no way to get individual executed steps and each step's details (id, result etc). So as it appears we can't expose freestyle executed steps as individual steps.

          I will check with unicorn team to see if there is way to get such info.

          Vivek Pandey added a comment - - edited jdumay mneale Ah, I think I misunderstood the model. I can get definition of each step: FreeStyleProject.getBuilders() -> gives all build steps definitions. However from executed run of a freestyle job , there is only top level run object and no way to get individual executed steps and each step's details (id, result etc). So as it appears we can't expose freestyle executed steps as individual steps. I will check with unicorn team to see if there is way to get such info.

          Michael Neale added a comment -

          As discussed in an email thread - the data does not exist in jenkins to do this. It would require a fairly major change to capture things like logs per step. We should not do this, it's not worth it.

          As I mentioned, a better "value add" in future for freestyle is to take chains of freestyle jobs and show them as one "pipeline result" - where the stages are jobs, but an individual freestyle job - not much we can show (other than what console annotators and other things may yield in the future - there are some console annotators that allow you to collapse the log into areas not unlike steps, perhaps that is the only way that it can be made to look similar for freestyle, but it isn't a generic solution).

          Lets close this and fry other fish.

          Michael Neale added a comment - As discussed in an email thread - the data does not exist in jenkins to do this. It would require a fairly major change to capture things like logs per step. We should not do this, it's not worth it. As I mentioned, a better "value add" in future for freestyle is to take chains of freestyle jobs and show them as one "pipeline result" - where the stages are jobs, but an individual freestyle job - not much we can show (other than what console annotators and other things may yield in the future - there are some console annotators that allow you to collapse the log into areas not unlike steps, perhaps that is the only way that it can be made to look similar for freestyle, but it isn't a generic solution). Lets close this and fry other fish.

          Vivek Pandey added a comment -

          +1

          Vivek Pandey added a comment - +1

          James Dumay added a comment -

          SGTM

          James Dumay added a comment - SGTM

          James Dumay added a comment -

          vpandey jglick WDYT about using console annotators to provide "sections" of the log per builder?

          James Dumay added a comment - vpandey jglick WDYT about using console annotators to provide "sections" of the log per builder?

          Vivek Pandey added a comment -

          jdumay Maybe, have a BuildListener annotate log section per builder, jglick can confirm or tell if there are better ways to do it.

          Vivek Pandey added a comment - jdumay Maybe, have a BuildListener annotate log section per builder, jglick can confirm or tell if there are better ways to do it.

            Unassigned Unassigned
            jamesdumay James Dumay
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: