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

Build History - Doesn't return correct result if search data has upper case

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • core
    • None
    • Jenkins v2.27

      Steps:
      1. Create a build with HelloWorld in the build description
      2. On the build history widget, search with HelloWorld

      Expected Result:
      Should return the build with "HelloWorld" in the description

      Actual Result:
      Doesn't return the correct build. It only works if you enter "helloworld", all lower case.

      The issue is at core/src/main/java/jenkins/widgets/HistoryPageFilter.java, line 352

          private boolean fitsSearchString(Object data) {
              if (searchString == null) {
                  return true;
              }
      
              if (data != null) {
                  if (data instanceof Number) {
                      return data.toString().equals(searchString);
                  } else {
                      return data.toString().toLowerCase().contains(searchString);
                  }
              }
      
              return false;
          }
      

      Here, the data is converted to lowercase, but the searchString, which is "HelloWorld" in this particular case, is not coverted. As a result, it's not returning the correct result.

          [JENKINS-39224] Build History - Doesn't return correct result if search data has upper case

          Just lowered priority to Minor from Critical. Also, not sure it even qualifies as a bug. I suspect it just works as designed.

          Note that I personally agree it should ignore case.

          Baptiste Mathus added a comment - Just lowered priority to Minor from Critical. Also, not sure it even qualifies as a bug. I suspect it just works as designed. Note that I personally agree it should ignore case.

          The behavior now is not case-sensitive search, nor case-insensitive... It could be qualified as bug since it is assuming all strings are lower.

          https://github.com/jenkinsci/jenkins/pull/2729

          Panagiotis Galatsanos added a comment - The behavior now is not case-sensitive search, nor case-insensitive... It could be qualified as bug since it is assuming all strings are lower. https://github.com/jenkinsci/jenkins/pull/2729

          Lets choose https://github.com/jenkinsci/jenkins/pull/2683 since it has also tests.

          Panagiotis Galatsanos added a comment - Lets choose https://github.com/jenkinsci/jenkins/pull/2683 since it has also tests.

            godfath3r Panagiotis Galatsanos
            samsun387 Kevin Yu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: