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

Sorting of files in a project's workspace should ignore case

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • Jenkins version 1.443

      When browsing the workspace of a project the sort order of files in the directory listing depends on the case of the filenames, which is confusing and wrong.

          [JENKINS-12139] Sorting of files in a project's workspace should ignore case

          Fred G added a comment -

          @kutzi: So users with different locales would see different sort orders? Wouldn't it be better to use the locale of the machine (master/slave) where the directory is located? Then everyone looking at the directory listing sees the same order.

          Fred G added a comment - @kutzi: So users with different locales would see different sort orders? Wouldn't it be better to use the locale of the machine (master/slave) where the directory is located? Then everyone looking at the directory listing sees the same order.

          kutzi added a comment -

          @fred: yes, that's what I thought. Using the server locale is also an option - I think both solutions have their advantages and disadvantages

          kutzi added a comment - @fred: yes, that's what I thought. Using the server locale is also an option - I think both solutions have their advantages and disadvantages

          @kutzi: It probably does make sense to use the user's locale from the HTTP request to sort things. However I haven't really looked into the security/practicality issues involved in doing that. I'm tempted to say that using the base locale of the machine would be wrong, unpredictable and inflexible especially in teams that are spread around the world.

          Richard Mortimer added a comment - @kutzi: It probably does make sense to use the user's locale from the HTTP request to sort things. However I haven't really looked into the security/practicality issues involved in doing that. I'm tempted to say that using the base locale of the machine would be wrong, unpredictable and inflexible especially in teams that are spread around the world.

          Fred G added a comment -

          Seems like I opened a can of worms here. :-/

          Fred G added a comment - Seems like I opened a can of worms here. :-/

          kutzi added a comment -

          @Richard what practicality - should be easy to extract the user locale from the request and use the appropriate Collator - and especially security concerns do you have regarding using the user's locale?

          kutzi added a comment - @Richard what practicality - should be easy to extract the user locale from the request and use the appropriate Collator - and especially security concerns do you have regarding using the user's locale?

          kutzi added a comment -

          There are but 2 things I'm concerned about regarding this issue:

          • backwards compatibility: users may complain, if the sorting order changes compared to the previous Jenkins version
          • performance: AFAIK Collator is much slower than String.compare, but that shouldn't matter as long as you don't have thousands of files

          kutzi added a comment - There are but 2 things I'm concerned about regarding this issue: backwards compatibility: users may complain, if the sorting order changes compared to the previous Jenkins version performance: AFAIK Collator is much slower than String.compare, but that shouldn't matter as long as you don't have thousands of files

          @kutzi I don't really have any specific security issues in mind. It was really just a passing comment.

          Richard Mortimer added a comment - @kutzi I don't really have any specific security issues in mind. It was really just a passing comment.

          Fred G added a comment -

          Concerning the backwards compatibility: If someone wants the old (wrong) sort order back it could be made configurable. I'd suggest to wait until a user has a relevant use case though.

          Fred G added a comment - Concerning the backwards compatibility: If someone wants the old (wrong) sort order back it could be made configurable. I'd suggest to wait until a user has a relevant use case though.

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          http://jenkins-ci.org/commit/jenkins/f37dcabfb87788dd6ee46966d33b7d27b57cb49e
          Log:
          [FIXED JENKINS-12139] Sort workspace file list based on request locale.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html core/src/main/java/hudson/model/DirectoryBrowserSupport.java http://jenkins-ci.org/commit/jenkins/f37dcabfb87788dd6ee46966d33b7d27b57cb49e Log: [FIXED JENKINS-12139] Sort workspace file list based on request locale.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1389
          [FIXED JENKINS-12139] Sort workspace file list based on request locale.

          Christoph Kutzinski : f37dcabfb87788dd6ee46966d33b7d27b57cb49e
          Files :

          • core/src/main/java/hudson/model/DirectoryBrowserSupport.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #1389 [FIXED JENKINS-12139] Sort workspace file list based on request locale. Christoph Kutzinski : f37dcabfb87788dd6ee46966d33b7d27b57cb49e Files : core/src/main/java/hudson/model/DirectoryBrowserSupport.java changelog.html

            kutzi kutzi
            fredg Fred G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: