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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • blueocean-plugin
    • Blue Ocean - 1.1-beta-1, Blue Ocean - 1.1-beta2

      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.

            jamesdumay James Dumay
            spencermalone Spencer Malone
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: