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

github display link broken - slashes in branch name

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • Jenkins: 2.73.2 github-branch-source-plugin: 2.2.3

      The details link that is automatically created on github for continuous-integration/jenkins/branch is broken on branches that contain a slash "/" - and nearly all of the branches in our project do, because the branchname convention is username/topic.

      (I hope I selected the correct component for this bug report)

          [JENKINS-47535] github display link broken - slashes in branch name

          Could you provide a sample malformed URL? I suspect that this is actually an issue in blueocean-display-url-plugin, specifically this line as it is not encoding the job name like 3 lines lower down, but to confirm this we need confirmation that it is a pipeline job and that the URL matches the format that line would produce

          Stephen Connolly added a comment - Could you provide a sample malformed URL? I suspect that this is actually an issue in blueocean-display-url-plugin, specifically this line as it is not encoding the job name like 3 lines lower down, but to confirm this we need confirmation that it is a pipeline job and that the URL matches the format that line would produce

          Lars Immisch added a comment -

          Cool.

          Yes, it's a multibranch pipeline job.

          The URL on the github page after continuous-integration/jenkins/branch is:

          https://my.ci.corp.com:12001/job/wf-wrapper/job/jrechtie%252Flrm-latest/10/display/redirect

          and that leads to:

          https://my.ci.corp.com:12001/blue/organizations/jenkins/wf-wrapper/detail/jrechtie%2Flrm-latest/10/

          Hope this confirms it.

          Lars Immisch added a comment - Cool. Yes, it's a multibranch pipeline job. The URL on the github page after continuous-integration/jenkins/branch  is: https://my.ci.corp.com:12001/job/wf-wrapper/job/jrechtie%252Flrm-latest/10/display/redirect and that leads to: https://my.ci.corp.com:12001/blue/organizations/jenkins/wf-wrapper/detail/jrechtie%2Flrm-latest/10/ Hope this confirms it.

          Stephen Connolly added a comment - - edited

          Note that URLs where the branch name contains a / are supposed to have that % encoded... so for example I have on my master URLs like:

          https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/detail/feature%2F1/1/pipeline

          and

          https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/

          Both of which are correct for a branch called feature/1

          So the question now becomes, are the URLs broken (i.e. giving a 404) or are you just objecting to the fact that we have to encode the slash in order to be able to correctly decode the URL

          Stephen Connolly added a comment - - edited Note that URLs where the branch name contains a / are supposed to have that % encoded... so for example I have on my master URLs like: https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/detail/feature%2F1/1/pipeline and https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/ Both of which are correct for a branch called feature/1 So the question now becomes, are the URLs broken (i.e. giving a 404) or are you just objecting to the fact that we have to encode the slash in order to be able to correctly decode the URL

          Hmmm though I notice that hopping between BlueOcean is causing the URL to drop back to fall-back parsing...

          When I start on https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/ and clck "Open Blue Ocean" that brings me to https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/branches/ I can then click on feature/1 which brings me to https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/detail/feature%2F1/1/pipeline and if I then click on "Go to classic" that brings me to https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%2F1/1/ and not https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/ so certainly BlueOcean is not respecting the encoding that branch-api requires and the branch name is only being resolved because we have fall-back matching

          Stephen Connolly added a comment - Hmmm though I notice that hopping between BlueOcean is causing the URL to drop back to fall-back parsing... When I start on https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/ and clck "Open Blue Ocean" that brings me to https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/branches/ I can then click on feature/1 which brings me to https://jenkins.one-dash.com/blue/organizations/jenkins/cloudbeers%2Fdemo-2017-03/detail/feature%2F1/1/pipeline and if I then click on "Go to classic" that brings me to https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%2F1/1/ and not https://jenkins.one-dash.com/job/cloudbeers/job/demo-2017-03/job/feature%252F1/1/ so certainly BlueOcean is not respecting the encoding that branch-api requires and the branch name is only being resolved because we have fall-back matching

          Lars Immisch added a comment -

          Neither. The link https://my.ci.corp.com:12001/blue/organizations/jenkins/wf-wrapper/detail/jrechtie%2Flrm-latest/10/ does not give a 404 or any error, but it yields an empty page.

          Lars Immisch added a comment - Neither. The link  https://my.ci.corp.com:12001/blue/organizations/jenkins/wf-wrapper/detail/jrechtie%2Flrm-latest/10/  does not give a 404 or any error, but it yields an empty page.

          Stephen Connolly added a comment - What does https://my.ci.corp.com:12001/blue/organizations/jenkins/wf-wrapper/detail/jrechtie%252Flrm-latest/10/ yield?

          Lars Immisch added a comment - - edited

          Difficult to describe. It is not what I would expect (i.e. a view of my parallel pipeline steps)

          Here is a screenshot in the hope it helps:

          Lars Immisch added a comment - - edited Difficult to describe. It is not what I would expect (i.e. a view of my parallel pipeline steps) Here is a screenshot in the hope it helps:

          Assigning to jamesdumay for scrub

          Stephen Connolly added a comment - Assigning to jamesdumay for scrub

          James Dumay added a comment -

          I believe this has been fixed and released as part of JENKINS-47073. Please reopen if that is not the case.

          James Dumay added a comment - I believe this has been fixed and released as part of JENKINS-47073 . Please reopen if that is not the case.

            jamesdumay James Dumay
            larsimmisch Lars Immisch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: