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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • blueocean-plugin
    • None
    • 1.0-m12

      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/

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

              Created:
              Updated:
              Resolved: