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

links generate/force lowercase names (remove camelCase syntax)

    XMLWordPrintable

    Details

    • Similar Issues:
    • Sprint:
      Blue Ocean - 1.6 - beta 4

      Description

      Use case a new method without @Exported annotation to avoid heavy calculation per default.

          @Navigable
          public abstract Container<BlueTestSummary> getTestSummaryContainer();
      

      The generated link is

          "testsummarycontainer" : {
            "_class" : "io.jenkins.blueocean.rest.hal.Link",
            "href" : "/blue/rest/organizations/jenkins/pipelines/jetty.project/branches/PR-2512/runs/4/testsummarycontainer/"
          }
      

      But in order to work the rest call need to be:

      /blue/rest/organizations/jenkins/pipelines/jetty.project/branches/PR-2512/runs/4/testSummaryContainer
      

      Otherwise method not found.
      Solutions:

      1. change Links#getPathFromMethodName to remove the toLowercase for the whole name and force lower case only first character for camel case purpose
      2. add attribute name in @Navigable so we use something similar to @Exported

      I'm voting 2 to keep backward compat as 1 may change few method names

        Attachments

          Issue Links

            Activity

            Hide
            olamy Olivier Lamy added a comment -

            Vivek Pandey sounds good for you?

            Show
            olamy Olivier Lamy added a comment - Vivek Pandey sounds good for you?
            Hide
            vivek Vivek Pandey added a comment - - edited

            Olivier Lamy @Navigable is not known to stapler so method dispatching won't happen correctly. For example following code will break:

            @Navigable (name="myTestSummmar")
            public abstract Container<BlueTestSummary> getTestSummaryContainer();
            

            Given that, option 1 is safer.

            Show
            vivek Vivek Pandey added a comment - - edited Olivier Lamy @Navigable is not known to stapler so method dispatching won't happen correctly. For example following code will break: @Navigable (name= "myTestSummmar" ) public abstract Container<BlueTestSummary> getTestSummaryContainer(); Given that, option 1 is safer.
            Hide
            olamy Olivier Lamy added a comment -

            ok I'm fine with that.
            It would have work in my case with the change with

            @Navigable (name="testSummaryContainer")
            public abstract Container<BlueTestSummary> getTestSummaryContainer();
            
            Show
            olamy Olivier Lamy added a comment - ok I'm fine with that. It would have work in my case with the change with @Navigable (name= "testSummaryContainer" ) public abstract Container<BlueTestSummary> getTestSummaryContainer();
            Show
            olamy Olivier Lamy added a comment - https://github.com/jenkinsci/blueocean-plugin/pull/1744
            Show
            olamy Olivier Lamy added a comment - pr merged https://github.com/jenkinsci/blueocean-plugin/commit/6b8ed888e37b86eebce7e843eea9987259703783

              People

              Assignee:
              olamy Olivier Lamy
              Reporter:
              olamy Olivier Lamy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: