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

BFA Results Unavailable During Run

    XMLWordPrintable

Details

    Description

      Im attempting to retrieve BFA scan results during the post step of a pipeline build using the following (using the HTTP Request plugin):

      String test = BUILD_URL + 'api/xml?tree=actions[foundFailureCauses[*]]'
      def response = httpRequest test
      println('Response: '+ response.content)

      When I go to the URL after the build completes, I see this:

      {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[{"_class":"hudson.model.ParametersAction"},{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{"_class":"com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction","foundFailureCauses":[{"categories":["Testing"],"description":"FOR TESTING","id":"da7cf326-1eb8-4d8c-939b-f46654bdc73b","name":"Testing BFA Failure"}]},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{},{}]}

      The above contains an entry for the BFA failure causes. However, if I use the groovy code to access that same URL during the run, I get:

      {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[\{"_class":"hudson.model.ParametersAction"}
      ,{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{}]}
      

      This result has no mention of any BFA results. 

      Is it not possible to query BFA results during a run? Or did I miss something?

      Attachments

        Activity

          gfredley Garrett Fredley created issue -
          gfredley Garrett Fredley made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Minor [ 4 ]
          gfredley Garrett Fredley made changes -
          Description Im attempting to retrieve BFA scan results during the post step of a pipeline build using the following (using the HTTP Request plugin):

          String test = BUILD_URL + 'api/xml?tree=actions[foundFailureCauses[*]]'
           def response = httpRequest test
           println('Response: '+ response.content)

          When I go to the URL after the build completes, I see this:
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[{"_class":"hudson.model.ParametersAction"},{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{"_class":"com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction","foundFailureCauses":[{"categories":["Testing"],"description":"FOR TESTING","id":"da7cf326-1eb8-4d8c-939b-f46654bdc73b","name":"Testing BFA Failure"}]},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{},{}]}{code}
           

          The above contains an entry for the BFA failure causes. However, if I use the groovy code to access that same URL during the run, I get:
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[\{"_class":"hudson.model.ParametersAction"},\{"_class":"hudson.model.CauseAction"},{},\{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},\{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{},{},\{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{},\{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{}]}
          This result has no mention of any BFA results. 

           

          Is it intended that BFA has no ability to be queried during a run?
          Im attempting to retrieve BFA scan results during the post step of a pipeline build using the following (using the HTTP Request plugin):

          String test = BUILD_URL + 'api/xml?tree=actions[foundFailureCauses[*]]'
           def response = httpRequest test
           println('Response: '+ response.content)

          When I go to the URL after the build completes, I see this:
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[{"_class":"hudson.model.ParametersAction"},{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{"_class":"com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction","foundFailureCauses":[{"categories":["Testing"],"description":"FOR TESTING","id":"da7cf326-1eb8-4d8c-939b-f46654bdc73b","name":"Testing BFA Failure"}]},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{},{}]}{code}
           

          The above contains an entry for the BFA failure causes. However, if I use the groovy code to access that same URL during the run, I get:

           
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[\{"_class":"hudson.model.ParametersAction"}
          ,{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{}]}
          {code}

           This result has no mention of any BFA results. 

           

          Is it intended that BFA has no ability to be queried during a run?
          gfredley Garrett Fredley made changes -
          Environment Jenkins 2.204.1, BFA 1.25.0
          gfredley Garrett Fredley made changes -
          Description Im attempting to retrieve BFA scan results during the post step of a pipeline build using the following (using the HTTP Request plugin):

          String test = BUILD_URL + 'api/xml?tree=actions[foundFailureCauses[*]]'
           def response = httpRequest test
           println('Response: '+ response.content)

          When I go to the URL after the build completes, I see this:
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[{"_class":"hudson.model.ParametersAction"},{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{"_class":"com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction","foundFailureCauses":[{"categories":["Testing"],"description":"FOR TESTING","id":"da7cf326-1eb8-4d8c-939b-f46654bdc73b","name":"Testing BFA Failure"}]},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{},{}]}{code}
           

          The above contains an entry for the BFA failure causes. However, if I use the groovy code to access that same URL during the run, I get:

           
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[\{"_class":"hudson.model.ParametersAction"}
          ,{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{}]}
          {code}

           This result has no mention of any BFA results. 

           

          Is it intended that BFA has no ability to be queried during a run?
          Im attempting to retrieve BFA scan results during the post step of a pipeline build using the following (using the HTTP Request plugin):

          String test = BUILD_URL + 'api/xml?tree=actions[foundFailureCauses[*]]'
           def response = httpRequest test
           println('Response: '+ response.content)

          When I go to the URL after the build completes, I see this:
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[{"_class":"hudson.model.ParametersAction"},{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{"_class":"com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction","foundFailureCauses":[{"categories":["Testing"],"description":"FOR TESTING","id":"da7cf326-1eb8-4d8c-939b-f46654bdc73b","name":"Testing BFA Failure"}]},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{},{}]}{code}
          The above contains an entry for the BFA failure causes. However, if I use the groovy code to access that same URL during the run, I get:
          {code:java}
          {"_class":"org.jenkinsci.plugins.workflow.job.WorkflowRun","actions":[\{"_class":"hudson.model.ParametersAction"}
          ,{"_class":"hudson.model.CauseAction"},{},{"_class":"jenkins.metrics.impl.TimeInQueueAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.cps.EnvActionImpl"},{},{},{},{},{"_class":"org.jenkinsci.plugins.pipeline.modeldefinition.actions.RestartDeclarativePipelineAction"},{},{},{"_class":"org.jenkinsci.plugins.workflow.job.views.FlowGraphAction"},{},{},{}]}
          {code}
          This result has no mention of any BFA results. 

          Is it not possible to query BFA results during a run? Or did I miss something?
          mwinter69 Markus Winter added a comment -

          Looking at the source code the analysis is done after the job is finalized (job has completely finished).

          mwinter69 Markus Winter added a comment - Looking at the source code the analysis is done after the job is finalized (job has completely finished).

          You can use the token macro to get the results of the Build Failure analyzer

          daveb David Beleznay added a comment - You can use the token macro to get the results of the Build Failure analyzer

          People

            t_westling Tomas Westling
            gfredley Garrett Fredley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: