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

REGRESSION: Unable to save branch with editor

    XMLWordPrintable

    Details

    • Sprint:
      Blue Ocean 1.3
    • Similar Issues:

      Description

      Hey Keith - I noticed the ATH started failing in the same place in a lot of branches all at once, when it was failing. I looked at the screen shot and saw it was failing to save to a new branch in github in a live test. 

      I reproduced this locally with the ATH, but then also with mvn hpi:run.

      Can only save back to the master branch it seems, but not a new branch. I don't think there have been any code changes related to this. 

       

      I can even reproduce this with mvn hpi:run: I just add a pipeline and open it in editor, try to save to a new branch and: 

       

      {
      "message" : "Failed to save file: Failed to deserialize {\"name\":\"master\",\"commit\":{\"sha\":\"40ab0f429777987218b42139d93904e27100a365\",\"commit\":{\"author\":{\"name\":\"Michael Neale\",\"email\":\"michael.neale@gmail.com\",\"date\":\"2017-09-07T07:12:39Z\"},\"committer\":{\"name\":\"Michael Neale\",\"email\":\"michael.neale@gmail.com\",\"date\":\"2017-09-07T07:12:39Z\"},\"message\":\"Added Jenkinsfile\",\"tree\":{\"sha\":\"4dbe9dddfc0a2f7713e47f85a68bdc5506d3eb0b\",\"url\":\"https://api.github.com/repos/multibranchorg/justreadme/git/trees/4dbe9dddfc0a2f7713e47f85a68bdc5506d3eb0b\"},\"url\":\"https://api.github.com/repos/multibranchorg/justreadme/git/commits/40ab0f429777987218b42139d93904e27100a365\",\"comment_count\":0},\"url\":\"https://api.github.com/repos/multibranchorg/justreadme/commits/40ab0f429777987218b42139d93904e27100a365\",\"html_url\":\"https://github.com/multibranchorg/justreadme/commit/40ab0f429777987218b42139d93904e27100a365\",\"comments_url\":\"https://api.github.com/repos/multibranchorg/justreadme/commits/40ab0f429777987218b42139d93904e27100a365/comments\",\"author\":{\"login\":\"michaelneale\",\"id\":14976,\"avatar_url\":\"https://avatars0.githubusercontent.com/u/14976?v=4\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/michaelneale\",\"html_url\":\"https://github.com/michaelneale\",\"followers_url\":\"https://api.github.com/users/michaelneale/followers\",\"following_url\":\"https://api.github.com/users/michaelneale/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/michaelneale/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/michaelneale/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/michaelneale/subscriptions\",\"organizations_url\":\"https://api.github.com/users/michaelneale/orgs\",\"repos_url\":\"https://api.github.com/users/michaelneale/repos\",\"events_url\":\"https://api.github.com/users/michaelneale/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/michaelneale/received_events\",\"type\":\"User\",\"site_admin\":false},\"committer\":{\"login\":\"michaelneale\",\"id\":14976,\"avatar_url\":\"https://avatars0.githubusercontent.com/u/14976?v=4\",\"gravatar_id\":\"\",\"url\":\"https://api.github.com/users/michaelneale\",\"html_url\":\"https://github.com/michaelneale\",\"followers_url\":\"https://api.github.com/users/michaelneale/followers\",\"following_url\":\"https://api.github.com/users/michaelneale/following{/other_user}\",\"gists_url\":\"https://api.github.com/users/michaelneale/gists{/gist_id}\",\"starred_url\":\"https://api.github.com/users/michaelneale/starred{/owner}{/repo}\",\"subscriptions_url\":\"https://api.github.com/users/michaelneale/subscriptions\",\"organizations_url\":\"https://api.github.com/users/michaelneale/orgs\",\"repos_url\":\"https://api.github.com/users/michaelneale/repos\",\"events_url\":\"https://api.github.com/users/michaelneale/events{/privacy}\",\"received_events_url\":\"https://api.github.com/users/michaelneale/received_events\",\"type\":\"User\",\"site_admin\":false},\"parents\":[{\"sha\":\"27628c92830ed93055416c86bdaa349a163173ed\",\"url\":\"https://api.github.com/repos/multibranchorg/justreadme/commits/27628c92830ed93055416c86bdaa349a163173ed\",\"html_url\":\"https://github.com/multibranchorg/justreadme/commit/27628c92830ed93055416c86bdaa349a163173ed\"}]},\"_links\":{\"self\":\"https://api.github.com/repos/multibranchorg/justreadme/branches/master\",\"html\":\"https://github.com/multibranchorg/justreadme/tree/master\"},\"protected\":false,\"protection\":{\"enabled\":false,\"required_status_checks\":{\"enforcement_level\":\"off\",\"contexts\":[]}},\"protection_url\":\"https://api.github.com/repos/multibranchorg/justreadme/branches/master/protection\"}",
      "code" : 500,
      "errors" : [ ]
      }

        Attachments

          Issue Links

            Activity

            Show
            michaelneale Michael Neale added a comment - - edited I think it is happening here: https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/GithubScmSaveFileRequest.java#L118  - but not sure why, other than github changed their response, but I don't know how to tell that.    https://github.com/jenkinsci/blueocean-plugin/blob/master/blueocean-github-pipeline/src/main/java/io/jenkins/blueocean/blueocean_github_pipeline/HttpRequest.java#L98
            Hide
            michaelneale Michael Neale added a comment -

            I checked with an older commit - and still bricked. Github broke something, but not sure how to tell what. 

            Show
            michaelneale Michael Neale added a comment - I checked with an older commit - and still bricked. Github broke something, but not sure how to tell what. 
            Hide
            michaelneale Michael Neale added a comment -

            Confirmed: classpath issue means JsonProperty being loaded is incorrect, annotation is ignored. This means that the new field github added (protection) is an object -> boolean - a type mismatch. Vivek is going to update the jackson2 plugin to be the newer version to correct this (I think, or something...)

            Show
            michaelneale Michael Neale added a comment - Confirmed: classpath issue means JsonProperty being loaded is incorrect, annotation is ignored. This means that the new field github added (protection) is an object -> boolean - a type mismatch. Vivek is going to update the jackson2 plugin to be the newer version to correct this (I think, or something...)
            Hide
            vivek Vivek Pandey added a comment -

            Michael Neale Updating jackson2-api fix didn't solve the problem as blueocean-commons loads jackson-annotation (JsonProperty) in different classloader than the one loaded by github-api.jar (GHBranch) - even if we patch github-api to use jackson 2.8.9.

            Basically blueocean using github-api's GHBranch directly to deserialize using it's own object mapper is not going to work. blueocean object mapper knows different version of JsonProperty than the one loaded thru GHBranch(github-api). This would all have worked had we been using object mapper from github-api directly but its package private.

            So the fix I am proposing is to deserialize GitHub branch using Map and do a quick release of 1.2.1 and then also apply this fix to master.

            Show
            vivek Vivek Pandey added a comment - Michael Neale Updating jackson2-api fix didn't solve the problem as blueocean-commons loads jackson-annotation (JsonProperty) in different classloader than the one loaded by github-api.jar (GHBranch) - even if we patch github-api to use jackson 2.8.9. Basically blueocean using github-api's GHBranch directly to deserialize using it's own object mapper is not going to work. blueocean object mapper knows different version of JsonProperty than the one loaded thru GHBranch(github-api). This would all have worked had we been using object mapper from github-api directly but its package private. So the fix I am proposing is to deserialize GitHub branch using Map and do a quick release of 1.2.1 and then also apply this fix to master.
            Hide
            vivek Vivek Pandey added a comment -

            Fixed on master as well as cherry picked in to release/1.2.

            Show
            vivek Vivek Pandey added a comment - Fixed on master as well as cherry picked in to release/1.2.

              People

              • Assignee:
                vivek Vivek Pandey
                Reporter:
                michaelneale Michael Neale
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: