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

Cannot mark Multibranch Pipeline as Favorite in Blue Ocean when no master branch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Duplicate
    • Component/s: blueocean-plugin
    • Labels:
    • Environment:
      jenkins-2.7.4
      blueocean - Built at 27th September 2016 03:05 AM (no branch) 57f7758
      Safari Version 9.1.3 (& FireFox 49.0.1)
    • Epic Link:
    • Similar Issues:

      Description

      Summary: if there is no master branch, if you try to favourite a MB pipeline (vs a specific branch) it does incorrect things. It should work out what the default branch is (or ask user) or at least tell them to pick a branch... (latter is easiest).

      If a user has favourited a MB pipeline folder in classic, blue ocean should ignore that.


      Steps:

      1. Click "New Item" and Create "Multibranch Pipeline" without branch "master".
      2. Open Dashboard Jenkins. Check "Favorite" button for Multibranch Pipeline.
      3. Open Jenkins Blue Ocean.
        Actual Result: New line for this job has been created in "Favorites" (grey colour). "Run" button hasn't worked.
      4. Open Dashboard Jenkins -> this Multibranch Pipeline. Check "Favorite" button for any branch.
        E.R. = A.R.: No error. Favorites Job have displayed correctly in Jenkins Blue Ocean.
      5. Disable "Favorite" for this job.
      6. Open Jenkins Blue Ocean.
      7. Click "Favorite" button for Multibranch Pipeline.
        Expected Result: Favorite label has been added. New line for this job has been created in "Favorites".
        Actual Result: Failed to load resource: the server responded with a status of 400 (Bad Request)
        {
            "message" : "no master branch to favorite",
            "code" : 400,
            "errors" : [ ]
        }
        
      8. Disable "Favorite" for this job.
        Expected Result: Favorite label has been deleted.
        Actual Result: TypeError: undefined is not an object (evaluating 'favoriteToRemove._links')

        Attachments

          Issue Links

            Activity

            Hide
            orrc Christopher Orr added a comment -

            I'm having the same problem with multibranch pipelines, for example in a folder where the default branch is develop (and that's the only branch I have listed in "Include branches").

            In some other multibranch pipelines, I'm not building any branches at all — only pull requests. I can't favourite those folders either.

            Show
            orrc Christopher Orr added a comment - I'm having the same problem with multibranch pipelines, for example in a folder where the default branch is develop (and that's the only branch I have listed in "Include branches"). In some other multibranch pipelines, I'm not building any branches at all — only pull requests. I can't favourite those folders either.
            Hide
            michaelneale Michael Neale added a comment -

            Christopher Orr oh interesting. That is a case I didn't think of - when you filter. Would it bug you if you went to fav a pipeline and it told you to pick a branch? As in your case, it won't know that "develop" if the default branch even if all the stars aligned and there was a default branch (as that isn't the default branch necessarily, its just how filtered).

            I think simplest thing we can do is for MB that don't have master branch - we ask user to pick which branch if they try (or remove the star icon). Blue ocean has no concept of fav'ing a folder (the fact that a MB pipeline is actually a folder is a leaky implementation detail), as fav's apply to branches that do work only.

            There may be other strategies...
            Cliff Meyers we should talk about this some time.

            Show
            michaelneale Michael Neale added a comment - Christopher Orr oh interesting. That is a case I didn't think of - when you filter. Would it bug you if you went to fav a pipeline and it told you to pick a branch? As in your case, it won't know that "develop" if the default branch even if all the stars aligned and there was a default branch (as that isn't the default branch necessarily, its just how filtered). I think simplest thing we can do is for MB that don't have master branch - we ask user to pick which branch if they try (or remove the star icon). Blue ocean has no concept of fav'ing a folder (the fact that a MB pipeline is actually a folder is a leaky implementation detail), as fav's apply to branches that do work only. There may be other strategies... Cliff Meyers we should talk about this some time.
            Hide
            michaelneale Michael Neale added a comment -

            Perhaps a better solution is JENKINS-39087. If there is no master branch, you fav the MB folder and show no branch details (essentially just a shortcut, as requested)....

            Show
            michaelneale Michael Neale added a comment - Perhaps a better solution is JENKINS-39087 . If there is no master branch, you fav the MB folder and show no branch details (essentially just a shortcut, as requested)....
            Hide
            cliffmeyers Cliff Meyers added a comment -

            Michael Neale Vivek Pandey as there was some discussion about the current Favorite plugin having some bugs or other issues, I just thought I'd call one out:

            1. Favorite a branch in a multi-branch pipeline
            2. Favorite displays in dashboard as expected
            3. Go to classic UI. Move the MBP inside of a folder
            4. Reload BOUI: note that favorite is missing

            Not sure if this is applicable to all job types or just multi-branch.

            Show
            cliffmeyers Cliff Meyers added a comment - Michael Neale Vivek Pandey as there was some discussion about the current Favorite plugin having some bugs or other issues, I just thought I'd call one out: Favorite a branch in a multi-branch pipeline Favorite displays in dashboard as expected Go to classic UI. Move the MBP inside of a folder Reload BOUI: note that favorite is missing Not sure if this is applicable to all job types or just multi-branch.
            Hide
            jamesdumay James Dumay added a comment -

            This fix is in review as part of JENKINS-38718.

            Show
            jamesdumay James Dumay added a comment - This fix is in review as part of JENKINS-38718 .

              People

              • Assignee:
                Unassigned
                Reporter:
                ks_nenasheva Kseniia Nenasheva
              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: