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

Item Categories should not be shipped from /categories

      It is the follow-up to our discussion with recena and jglick.

      The current Item categorization uses JENKINS_URL/categories endpoint to provide the list of categories.

      It causes several concerns:

      • Categories apply to items only, but the "/categories" endpoint does not mention it in paths. Once we want to implement slave categories, it may become a problem
      • The endpoint may conflict with existing closed-source plugins. E.g. I had the Categorization plugin at one of my previous companies, which used the similar endpoint. Update to 2.0 will cause regressions in such plugins
      • The implementation is not pluggable. E.g. Views and Items cannot filter the categories somehow

      Proposed solution:

      • Ship categories via VIEW_URL/itemCategories
      • Allow overriding of the method in views. Just for the future pluggability

          [JENKINS-33972] Item Categories should not be shipped from /categories

          Manuel Recena Soto added a comment - - edited

          I disagree because:

          1. It is not a bug
          2. it is not a regression at all

          Manuel Recena Soto added a comment - - edited I disagree because: It is not a bug it is not a regression at all

          Categories apply to items only, but the "/categories" endpoint does not mention it in paths.

          This endpoint is not valid, the right endpoint is: JENKINS_ROOT/PATH_VIEW/categories where PATH_VIEW can be:

          1. empty: JENKINS_ROOT/categories
          2. or for example: JENKINS_ROOT/view/custom/categories

          The meaning is Please, give me the item categories and its items availables in this view.

          The endpoint may conflict with existing closed-source plugins. E.g. I had the Categorization plugin at one of my previous companies, which used the similar endpoint. Update to 2.0 will cause regressions in such plugins

          Is this really an argument? As contributor of Jenkins core I have to thing about possible proprietary developments. This is crazy! Why something like itemCategories is a valid option?

          The implementation is not pluggable. E.g. Views and Items cannot filter the categories somehow

          This is a new requirement we can implement in the future. By the way, Items are being filtered.

          Manuel Recena Soto added a comment - Categories apply to items only, but the "/categories" endpoint does not mention it in paths. This endpoint is not valid, the right endpoint is: JENKINS_ROOT/PATH_VIEW/categories where PATH_VIEW can be: empty: JENKINS_ROOT/categories or for example: JENKINS_ROOT/view/custom/categories The meaning is Please, give me the item categories and its items availables in this view . The endpoint may conflict with existing closed-source plugins. E.g. I had the Categorization plugin at one of my previous companies, which used the similar endpoint. Update to 2.0 will cause regressions in such plugins Is this really an argument? As contributor of Jenkins core I have to thing about possible proprietary developments. This is crazy! Why something like itemCategories is a valid option? The implementation is not pluggable. E.g. Views and Items cannot filter the categories somehow This is a new requirement we can implement in the future. By the way, Items are being filtered.

          Oleg Nenashev added a comment -

          > empty: JENKINS_ROOT/categories

          So in such case it overlaps with the corner-case I've provided

          > Is this really an argument? As contributor of Jenkins core I have to thing about possible proprietary developments. This is crazy!

          You are not supposed to think about them. That's why we have Jenkins 2.0 beta testing, because it allows users to notify us about such issues. It does not mean that we must fix such issues, but at least it worths some discussion

          Oleg Nenashev added a comment - > empty: JENKINS_ROOT/categories So in such case it overlaps with the corner-case I've provided > Is this really an argument? As contributor of Jenkins core I have to thing about possible proprietary developments. This is crazy! You are not supposed to think about them. That's why we have Jenkins 2.0 beta testing, because it allows users to notify us about such issues. It does not mean that we must fix such issues, but at least it worths some discussion

          danielbeck your PoV here would be great!

          Manuel Recena Soto added a comment - danielbeck your PoV here would be great!

          Daniel Beck added a comment -

          Closed-source plugins are not an argument to me. I'm not even sure open-source plugins would be a major argument to impede core development, depending on exactly what the problem is. They would just be fixed. Otherwise, no detaching JUnit plugin from core in 1.577, or ever.

          However, Oleg does have a point with the confusion regarding what the categories are for. So a rename to itemCategories to support e.g. viewCategories besides it, seems straightforward enough. FWIW I was a big proponent for generic categorization from the beginning, Jenkins users typically have more view types than item types.

          Daniel Beck added a comment - Closed-source plugins are not an argument to me. I'm not even sure open-source plugins would be a major argument to impede core development, depending on exactly what the problem is. They would just be fixed. Otherwise, no detaching JUnit plugin from core in 1.577, or ever. However, Oleg does have a point with the confusion regarding what the categories are for. So a rename to itemCategories to support e.g. viewCategories besides it, seems straightforward enough. FWIW I was a big proponent for generic categorization from the beginning, Jenkins users typically have more view types than item types.

          Oleg Nenashev added a comment -

          > Closed-source plugins are not an argument to me. I'm not even sure open-source plugins would be a major argument to impede core development, depending on exactly what the problem is. They would just be fixed.

          IMHO it does not well comply with the "this guy is fully compatible, no reason not to upgrade" statement we declare for 2.0. I'm OK if we don't fix in this case, but there maybe corner cases. Maybe we should explicitly recommend testing before upgrading.

          Oleg Nenashev added a comment - > Closed-source plugins are not an argument to me. I'm not even sure open-source plugins would be a major argument to impede core development, depending on exactly what the problem is. They would just be fixed. IMHO it does not well comply with the "this guy is fully compatible, no reason not to upgrade" statement we declare for 2.0. I'm OK if we don't fix in this case, but there maybe corner cases. Maybe we should explicitly recommend testing before upgrading.

          oleg_nenashev By the way, the renaming involves to send a new PR to cloudbees-folder-plugin ref.

          Manuel Recena Soto added a comment - oleg_nenashev By the way, the renaming involves to send a new PR to cloudbees-folder-plugin ref .

          jglick Do you agree with the change proposed? Remember that this change involves to change this again.

          Manuel Recena Soto added a comment - jglick Do you agree with the change proposed? Remember that this change involves to change this again.

          Jesse Glick added a comment -

          Yes go ahead and change categories to itemCategories. I was holding off on a cloudbees-folder release until you did so, so that I can make the matching change.

          Jesse Glick added a comment - Yes go ahead and change categories to itemCategories . I was holding off on a cloudbees-folder release until you did so, so that I can make the matching change.

          oleg_nenashev working in progress....

          Manuel Recena Soto added a comment - oleg_nenashev working in progress....

          Oleg Nenashev added a comment -

          recena Thanks a lot!

          Oleg Nenashev added a comment - recena Thanks a lot!

          Manuel Recena Soto added a comment - oleg_nenashev Done.

          Code changed in jenkins
          User: recena
          Path:
          core/src/main/java/hudson/model/View.java
          war/src/main/js/add-item.js
          http://jenkins-ci.org/commit/jenkins/4a5b825b479d56beb0717bfb1cbcb659c51557fb
          Log:
          JENKINS-33972 The REST API URL has been removed to [..]/itemCategories

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: recena Path: core/src/main/java/hudson/model/View.java war/src/main/js/add-item.js http://jenkins-ci.org/commit/jenkins/4a5b825b479d56beb0717bfb1cbcb659c51557fb Log: JENKINS-33972 The REST API URL has been removed to [..] /itemCategories

          Code changed in jenkins
          User: Daniel Beck
          Path:
          core/src/main/java/hudson/model/View.java
          war/src/main/js/add-item.js
          http://jenkins-ci.org/commit/jenkins/4649e04cbe58f5af0e583da04084b2ebc442a320
          Log:
          Merge pull request #2208 from recena/JENKINS-33972

          JENKINS-33972 The REST API URL has been removed to [..]/itemCategories

          Compare: https://github.com/jenkinsci/jenkins/compare/0db4bc2a6327...4649e04cbe58

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: core/src/main/java/hudson/model/View.java war/src/main/js/add-item.js http://jenkins-ci.org/commit/jenkins/4649e04cbe58f5af0e583da04084b2ebc442a320 Log: Merge pull request #2208 from recena/ JENKINS-33972 JENKINS-33972 The REST API URL has been removed to [..] /itemCategories Compare: https://github.com/jenkinsci/jenkins/compare/0db4bc2a6327...4649e04cbe58

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/dab943292bcc6121c62701cb62307edce09c6d31
          Log:
          JENKINS-33972 View.doCategories renamed to doItemCategories.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/dab943292bcc6121c62701cb62307edce09c6d31 Log: JENKINS-33972 View.doCategories renamed to doItemCategories.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/526694d36b9d2e0685ceac9c168204a209969b3d
          Log:
          Merge pull request #54 from jglick/itemCategories-JENKINS-33972

          JENKINS-33972 View.doCategories renamed to doItemCategories

          #55 is identical, just merging the lower-numbered one.

          Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/6f2daf46be91...526694d36b9d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/526694d36b9d2e0685ceac9c168204a209969b3d Log: Merge pull request #54 from jglick/itemCategories- JENKINS-33972 JENKINS-33972 View.doCategories renamed to doItemCategories #55 is identical, just merging the lower-numbered one. Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/6f2daf46be91...526694d36b9d

          Code changed in jenkins
          User: recena
          Path:
          src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/c3ba1ab0efab2552003752af46d659504b69c3e5
          Log:
          JENKINS-33972 View.doCategories was renamed to View.doItemCategories

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: recena Path: src/main/java/com/cloudbees/hudson/plugins/folder/FolderAddFilter.java http://jenkins-ci.org/commit/cloudbees-folder-plugin/c3ba1ab0efab2552003752af46d659504b69c3e5 Log: JENKINS-33972 View.doCategories was renamed to View.doItemCategories

          Code changed in jenkins
          User: Jesse Glick
          Path:
          http://jenkins-ci.org/commit/cloudbees-folder-plugin/ac521be9372a056a799c354e75f5ce33d516b7ff
          Log:
          Merge pull request #55 from recena/JENKINS-33972

          JENKINS-33972 View.doCategories was renamed to View.doItemCategories

          Heck, merge them both, see if GitHub can handle it!

          Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/526694d36b9d...ac521be9372a

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: http://jenkins-ci.org/commit/cloudbees-folder-plugin/ac521be9372a056a799c354e75f5ce33d516b7ff Log: Merge pull request #55 from recena/ JENKINS-33972 JENKINS-33972 View.doCategories was renamed to View.doItemCategories Heck, merge them both, see if GitHub can handle it! Compare: https://github.com/jenkinsci/cloudbees-folder-plugin/compare/526694d36b9d...ac521be9372a

            recena Manuel Recena Soto
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: