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

Update URL scheme to remove URL encoding issues

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • blueocean-plugin
    • None
    • Blue Ocean 1.6 - beta 2, Blue Ocean - 1.6 - beta 4

      Users frequently run into encoding problems that require configuration changes to HTTP reverse proxy's. A good example of this is JENKINS-46339.

      Requirements

      • Existing URLs must continue to work
      • URLs should be human readable
      • Blue Ocean Display URL plugin is updated to issue URLs in the new scheme.

      Notes

      • If at all possible, can we make branch names like "topic/feature" part of the url. e.g. /blue/pipelines/cool-pipeline/branch/topic/feature"

          [JENKINS-46571] Update URL scheme to remove URL encoding issues

          Cliff Meyers added a comment -

          Some thoughts in no particular order:

          1. Is the thought that all the old URL's would be caught server-side and redirected to the new nicer URL's?
          2. I seem to recall React Router not liking path variables with slashes in them. I could be I was defining the routes wrong, as that was very early days. Workarounds for this could include:
            1. Upgrading to latest React Router 4
            2. Scrapping React Router, as a lot of people seem to be happily using React without it
            3. Although, any of these changes might put us in a tough spot for backwards compat for other folks building on top of Blue Ocean
          3. Given the above, perhaps we should be looking at either building our own routing system or at least putting an abstraction layer in front of it

          Seems a discussion around all this is worthwhile.

          Cliff Meyers added a comment - Some thoughts in no particular order: Is the thought that all the old URL's would be caught server-side and redirected to the new nicer URL's? I seem to recall React Router not liking path variables with slashes in them. I could be I was defining the routes wrong, as that was very early days. Workarounds for this could include: Upgrading to latest React Router 4 Scrapping React Router, as a lot of people seem to be happily using React without it Although, any of these changes might put us in a tough spot for backwards compat for other folks building on top of Blue Ocean Given the above, perhaps we should be looking at either building our own routing system or at least putting an abstraction layer in front of it Seems a discussion around all this is worthwhile.

          Michael Neale added a comment -

          cliffmeyers well the / in paths create ambiguity with folders and other things, when they are in the scm branch name (if we only had to support git, could probabl bake in assumptions). 

           

          The main thing is to avoid %2F type of thing in path, as proxies like to auto translate that. If there is some other dumber encoding scheme, it would cause less grief. I think using things like "feature/blah" is not likely to be doable in any reasonable timeframe. 

           

          feature__blah could be though (lots of escaping rules need to be tested). 

          Michael Neale added a comment - cliffmeyers well the / in paths create ambiguity with folders and other things, when they are in the scm branch name (if we only had to support git, could probabl bake in assumptions).    The main thing is to avoid %2F type of thing in path, as proxies like to auto translate that. If there is some other dumber encoding scheme, it would cause less grief. I think using things like "feature/blah" is not likely to be doable in any reasonable timeframe.    feature__blah could be though (lots of escaping rules need to be tested). 

          Cliff Meyers added a comment - - edited

          michaelneale is the issue here that these proxies are frequently misconfigured, or are they typically just very buggy with URL-encoded parameters? Or is specifically that it chokes on the URL-encoded slash (%2F) character? Or is it the double-URL encoded slash parameter for Gitflow-style branch names (%252F) I haven't done enough proxy server config and administration to know for sure. If proxies really choke on params that are URL-encoded, that's a darn shame, since it's part of the spec and isn't really esoteric IMO.

          A simple slash-delimited scheme must be possible - clearly it's used by other sites like GitHub - but we probably need a second spike with React Router 2.x
          to determine whether it can support it in a reasonable way.

          Cliff Meyers added a comment - - edited michaelneale is the issue here that these proxies are frequently misconfigured, or are they typically just very buggy with URL-encoded parameters? Or is specifically that it chokes on the URL-encoded slash (%2F) character? Or is it the double-URL encoded slash parameter for Gitflow-style branch names (%252F) I haven't done enough proxy server config and administration to know for sure. If proxies really choke on params that are URL-encoded, that's a darn shame, since it's part of the spec and isn't really esoteric IMO. A simple slash-delimited scheme must be possible - clearly it's used by other sites like GitHub - but we probably need a second spike with React Router 2.x to determine whether it can support it in a reasonable way.

          Ivan Meredith added a comment -

          In my opinion, we should probably just move to using query params. I know they aren't as sexy but they scale well. We currently have both pipeline paths and branch paths that have to encoded in the same url.

          I propose something that still has the pipeline in the main url, as blueocean is very pipeline centric, but then use query params for the branch, run, whether we want to show tests etc

          /blue/pipeline/path/to/pipeline?tab=branches

          /blue/pipeline/path/to/pipeline?branch=a/b&run=4

          /blue/pipeline/path/to/pipeline?branch=a/b&run=4&tab=tests

          I also propose we drop the organization selector from the url and just use a query param if it is needed.

          Ivan Meredith added a comment - In my opinion, we should probably just move to using query params. I know they aren't as sexy but they scale well. We currently have both pipeline paths and branch paths that have to encoded in the same url. I propose something that still has the pipeline in the main url, as blueocean is very pipeline centric, but then use query params for the branch, run, whether we want to show tests etc /blue/pipeline/path/to/pipeline?tab=branches /blue/pipeline/path/to/pipeline?branch=a/b&run=4 /blue/pipeline/path/to/pipeline?branch=a/b&run=4&tab=tests I also propose we drop the organization selector from the url and just use a query param if it is needed.

          Michael Neale added a comment - - edited

          imeredith keep in mind the pipeline name itself may require some encoding (not sure if that changes things), but otherwise, I like this. 

           

          Michael Neale added a comment - - edited imeredith keep in mind the pipeline name itself may require some encoding (not sure if that changes things), but otherwise, I like this.   

          Ivan Meredith added a comment -

          We could just have that in a query param as well

          Ivan Meredith added a comment - We could just have that in a query param as well

          James Dumay added a comment -

          imeredith how does moving to query params fix the problem we have?

          James Dumay added a comment - imeredith how does moving to query params fix the problem we have?

          Ivan Meredith added a comment -

          jamesdumay Technically you can get away with not encoding slashes. I'm not sure this is a good idea though. I think to be to spec it needs to be encoded =/ But at the very least even if proxies decode the slash, its still gonna work

          Ivan Meredith added a comment - jamesdumay Technically you can get away with not encoding slashes. I'm not sure this is a good idea though. I think to be to spec it needs to be encoded =/ But at the very least even if proxies decode the slash, its still gonna work

          James Dumay added a comment -

          Mind if we spend 20 talking about the solution here tomorrow?

          James Dumay added a comment - Mind if we spend 20 talking about the solution here tomorrow?

          Ivan Meredith added a comment -

          Sure.

          Ivan Meredith added a comment - Sure.

            imeredith Ivan Meredith
            jamesdumay James Dumay
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: