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

Rerun button shows on UI even when the run cannot be rerun - enhance to have a replayable property

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: blueocean-plugin
    • Labels:
    • Environment:
    • Sprint:
      Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2
    • Similar Issues:

      Description

      In Scope

      • Add a replayable property that checks if the run can be replayed
        • This propagates the ReplayAction's has a isEnabled state to the UI
        • It turns out the behavior we saw in JENKINS-37880 is legitimate and isEnabled takes that case into account - we can kill two birds with one stone here!
      • Update the replay component so that instead of checking for a Pipeline capability to hide/show the button, we use replayable on the run model

      Problem
      If a build does not have the "replay" functionality available in the old UI, the "re-run" button in blue ocean still shows up, but does nothing and gives no obvious error to the user when clicked. This often happens when the initial checkout fails, or if the build is cancelled before the checkout finishes.

      UI errors are as follows:

      POST https://<redacted>/blue/rest/organizations/jenkins/pipelines/ops/pipelines/puppet-modules/branches/master/runs/728/replay/ 500 (Server Error)
       (anonymous) @ VM1470:1
       request @ blueocean.js:2436
       dedupe @ blueocean.js:7715
       dedupe @ blueocean.js:7738
       rawFetchJSON @ blueocean.js:2448
       fetchJSON @ blueocean.js:2516
       replayRun @ blueocean.js:4903
       _onReplayClick @ blueocean.js:1568
       onClick @ blueocean.js:1612
       invokeGuardedCallback @ blueocean.js:87861
       executeDispatch @ blueocean.js:79985
       executeDispatchesInOrder @ blueocean.js:80005
       executeDispatchesAndRelease @ blueocean.js:79462
       executeDispatchesAndReleaseTopLevel @ blueocean.js:79473
       forEachAccumulated @ blueocean.js:94130
       processEventQueue @ blueocean.js:79649
       runEventQueueInBatch @ blueocean.js:87919
       handleTopLevel @ blueocean.js:87930
       handleTopLevelImpl @ blueocean.js:87997
       perform @ blueocean.js:93514
       batchedUpdates @ blueocean.js:87197
       batchedUpdates @ blueocean.js:91413
       dispatchEvent @ blueocean.js:88074
      
      blueocean.js:2313 Uncaught (in promise) Error: Server Error
       at checkStatus (blueocean.js:2313)
       checkStatus @ blueocean.js:2313
      

      Response: 

      {
       "message" : "Run was not added to queue.",
       "code" : 500,
       "errors" : [ ]
       }
      

       

      How to reproduce: Check out a large enough repository that it can't finish checking out the build before you can cancel (a few hundred MBs seems to be enough for me). Trigger a build, then cancel it as fast as you can. It should be marked as a failure, not as aborted. If you've done this properly, when you go to the build in the old UI, it won't display the "Replay" button on the left. Next, go to Blue Ocean and hit "re-run". It also fails if you try to re-run from a favorite card, but the "build" button will work from a favorite card.

       

      Easy Solutions?: Maybe the fallback behaviour should be it switches to the "build" button if replay is unavailable, since that does still work from the favorite cards if this happens? At the very least some sort of notification of failure should be presented to the user.

        Attachments

          Issue Links

            Activity

            Hide
            spencermalone Spencer Malone added a comment - - edited

            Ah, thanks for the cleanup on that description, James Dumay

            Show
            spencermalone Spencer Malone added a comment - - edited Ah, thanks for the cleanup on that description, James Dumay
            Hide
            jamesdumay James Dumay added a comment -

            Spencer Malone no worries - JIRA markup takes a bit to get used to

            Show
            jamesdumay James Dumay added a comment - Spencer Malone no worries - JIRA markup takes a bit to get used to
            Hide
            myoung34 marc young added a comment -

            I just ran into this and it's not intuitive as to why it's not rerunnable.

            I'd like to know why i can/cannot re-run it, instead "nothing happens" with a 500 happening in the background

            Show
            myoung34 marc young added a comment - I just ran into this and it's not intuitive as to why it's not rerunnable. I'd like to know why i can/cannot re-run it, instead "nothing happens" with a 500 happening in the background
            Hide
            jamesdumay James Dumay added a comment -

            marc young sometimes we can get into a state where there is a failure at the start of the pipeline during or before checkout that means we don't get any state for the pipeline run persisted to storage. The rerun only works when we've stored a record of it in storage. I agree that this isn't 100% intuitive and its on our list of issues to fix soon.

            Show
            jamesdumay James Dumay added a comment - marc young sometimes we can get into a state where there is a failure at the start of the pipeline during or before checkout that means we don't get any state for the pipeline run persisted to storage. The rerun only works when we've stored a record of it in storage. I agree that this isn't 100% intuitive and its on our list of issues to fix soon.
            Hide
            jamesdumay James Dumay added a comment -

            Will be included in Blue Ocean 1.1

            Show
            jamesdumay James Dumay added a comment - Will be included in Blue Ocean 1.1
            Hide
            buzzard44 Caleb Mayeux added a comment -

            For what it's worth, I hit this issue in Blue Ocean 1.9 and Jenkins 1.138.4 after git checkouts at the start of a pipeline build failed (the remote was having issues at the time of the checkout). The checkout timed out and failed, and subsequent attempts to retry hit the same issue as this bug, albeit on much newer versions of the plugin/Jenkins.

            Show
            buzzard44 Caleb Mayeux added a comment - For what it's worth, I hit this issue in Blue Ocean 1.9 and Jenkins 1.138.4 after git checkouts at the start of a pipeline build failed (the remote was having issues at the time of the checkout). The checkout timed out and failed, and subsequent attempts to retry hit the same issue as this bug, albeit on much newer versions of the plugin/Jenkins.

              People

              • Assignee:
                jamesdumay James Dumay
                Reporter:
                spencermalone Spencer Malone
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: