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

Cannot unfavorite a multi-branch pipeline / master branch from the Personalization Dashboard

    XMLWordPrintable

Details

    • 1.0-m12

    Description

      When a multi-branch pipeline has been favorited in the UI, its master branch is displayed in the Personalization Dashboard card stack. When the user attempts to unfavorite that item and then refreshes the page, the MBP is not actually removed from the stack.

      This is because the HTTP request made to unfavorite it is as follows:

      curl -v -u cmeyers:test123 -XPUT -H "Content-Type:application/json" -d '{"favorite":false}' http://localhost:8080/jenkins//blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing/branches/master/favorite
      

      The UI attempts to unfavorite the master branch, but it's actually the MBP itself that was favorited. The server doesn't return an error, so the UI assumes the request succeeded.

      Unfavoriting works from the list of pipelines because the self href being used in that case is
      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing/
      which will succeed when "/favorite" is appended and invoked via the correct PUT request.

      See JENKINS-36967 for the bug that will unblock this. The API will return a different self.href for the favorite itself, which will resolve to the correct URL:
      http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing/favorite/

      Attachments

        Issue Links

          Activity

            cliffmeyers Cliff Meyers added a comment - Fixed in this PR: https://github.com/jenkinsci/blueocean-plugin/pull/367 in this commit: https://github.com/jenkinsci/blueocean-plugin/pull/367/commits/0624b7d4161cb557d7d90e6d30622f4c4305a7a2

            People

              cliffmeyers Cliff Meyers
              cliffmeyers Cliff Meyers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: