You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2023/01/02 21:47:34 UTC

[GitHub] [solr] vatsalpatel3689 opened a new pull request, #1261: MN-551 | working and tested changes of solr 9.1

vatsalpatel3689 opened a new pull request, #1261:
URL: https://github.com/apache/solr/pull/1261

   https://issues.apache.org/jira/browse/SOLR-XXXXX
   
   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Solr:
   
   * https://issues.apache.org/jira/projects/SOLR
   
   For something minor (i.e. that wouldn't be worth putting in release notes), you can skip JIRA. 
   To create a Jira issue, you will need to create an account there first.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * SOLR-####: <short description of problem or changes>
   
   SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   Please provide a short description of the changes you're making with this pull request.
   
   # Solution
   
   Please provide a short description of the approach taken to implement your solution.
   
   # Tests
   
   Please describe the tests you've developed or run to confirm this patch implements the feature or solves the problem.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [ ] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [ ] I have created a Jira issue and added the issue ID to my pull request title.
   - [ ] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [ ] I have developed this patch against the `main` branch.
   - [ ] I have run `./gradlew check`.
   - [ ] I have added tests for my changes.
   - [ ] I have added documentation for the [Reference Guide](https://github.com/apache/solr/tree/main/solr/solr-ref-guide)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #1261: MN-551 | working and tested changes of solr 9.1

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1261:
URL: https://github.com/apache/solr/pull/1261#discussion_r1060203693


##########
solr/core/src/java/org/apache/solr/search/facet/FacetModule.java:
##########
@@ -16,13 +16,14 @@
  */
 package org.apache.solr.search.facet;
 
+import static org.apache.solr.common.util.Utils.fromJSONString;
+
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 import org.apache.solr.client.solrj.SolrResponse;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;

Review Comment:
   <picture><img alt="39% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/39/display.svg"></picture>
   
   đŸ’Ŧ 2 similar findings have been found in this PR
   
   ---
   
   *opt.semgrep.java.lang.correctness.eqeq.eqeq:*  `a == a` or `a != a` is always true. (Unless the value compared is a float or double).
   To test if `a` is not-a-number, use `Double.isNaN(a)`.
   
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | solr/core/src/java/org/apache/solr/search/facet/FacetModule.java | [413](https://github.com/apache/solr/blob/7cd1645447c726b773dae2bd0fefddd89906207a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L413) |
   | solr/core/src/java/org/apache/solr/search/facet/FacetModule.java | [419](https://github.com/apache/solr/blob/7cd1645447c726b773dae2bd0fefddd89906207a/solr/core/src/java/org/apache/solr/search/facet/FacetModule.java#L419) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNT78GMRWADG7F2VXS2Z3AAC?t=Semgrep|opt.semgrep.java.lang.correctness.eqeq.eqeq" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365218733&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365218733&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365218733&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365218733&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365218733&lift_comment_rating=5) ]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] sonatype-lift[bot] commented on a diff in pull request #1261: MN-551 | working and tested changes of solr 9.1

Posted by GitBox <gi...@apache.org>.
sonatype-lift[bot] commented on code in PR #1261:
URL: https://github.com/apache/solr/pull/1261#discussion_r1060202487


##########
dev-tools/scripts/cherrypick.sh:
##########
@@ -0,0 +1,214 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Forked and adapted from https://github.com/factorial-io/cherrypicker - MIT license
+# Copyright (c) 2017 Shibin Das - @d34dman
+
+function LOG() {
+  local STATUS=$1
+  local MESSAGE=$2
+  echo "[$(date)] ${STATUS} ${MESSAGE}"
+}
+
+function usage() {
+  cat << EOF
+Usage: dev-tools/scripts/cherrypick.sh [<options>] <commit-hash> [<commit-hash>...]
+ -b <branch> Sets the branch(es) to cherry-pick to, typically branch_Nx or branch_x_y
+ -s          Skips precommit test. WARNING: Always run precommit for code- and doc changes
+ -t          Run the full test suite during check, not only precommit
+ -n          Skips git pull of target branch. Useful if you are without internet access
+ -a          Enters automated mode. Aborts cherry-pick and exits on error
+ -r <remote> Specify remote to push to. Defaults to whatever the branch is tracking.
+ -p          Push to remote. Only done if both cherry-pick and tests succeeded
+    WARNING: Never push changes to a remote branch before a thorough local test
+
+Simple script for aiding in back-porting one or more (trivial) commits to other branches.
+On merge conflict the script will run 'git mergetool'. See 'git mergetool --help'
+for help on configuring your favourite merge tool. Check out Sublime Merge (smerge).
+
+Example:
+  # Backport two commits to both stable and release branches
+  dev-tools/scripts/cherrypick.sh -b branch_9x -b branch_9_0 deadbeef0000 cafebabe1111
+EOF
+}
+
+function yesno() {
+  question=$1
+  unset answer
+  echo "$question"
+  while [[ "$answer" != "y" ]] && [[ "$answer" != "n" ]]; do
+    read -r answer
+    if [[ "$answer" == "y" ]]; then
+      true
+    else
+      false
+    fi
+  done
+}
+
+GIT_COMMAND=git
+PRECOMMIT="true"
+TESTARG="-x test"
+TEST=
+TESTS_PASSED=
+PUSH=
+REMOTE=
+NOPULL=
+AUTO_MODE=
+unset BRANCHES
+
+while getopts ":b:phstnar:" opt; do
+  case ${opt} in
+    b)
+      BRANCHES+=("$OPTARG")
+      ;;
+    r)
+      REMOTE=$OPTARG
+      ;;
+    p)
+      PUSH=true
+      ;;
+    s)
+      PRECOMMIT=
+      ;;
+    a)
+      AUTO_MODE="true"
+      ;;
+    n)
+      NOPULL="true"
+      ;;
+    t)
+      TEST="true"
+      TESTARG=""
+      ;;
+    h)
+      usage
+      exit 0
+      ;;
+   \?)
+      echo "Unknown option $OPTARG"
+      usage
+      exit 1
+   esac
+done
+shift $((OPTIND -1))
+
+COMMITS=( "$@" )
+
+if [ ${#BRANCHES[@]} -eq 0 ]; then
+  LOG INFO "Lacking -b option, must specify target branch. Supports multiple -b options too"
+  usage
+  exit
+fi
+
+if [ ${#COMMITS[@]} -eq 0 ]; then
+  LOG ERROR "Please specify one or more commits"
+  usage
+  exit
+fi
+
+## Loop over branches
+for BRANCH in "${BRANCHES[@]}"; do
+  echo ""
+  LOG "INFO" "============================================";
+  LOG "INFO" "Git branch: $BRANCH"
+  LOG "INFO" "============================================";
+  echo ""
+  LOG INFO "Checking out target branch $BRANCH"
+  # shellcheck disable=SC2086
+  $GIT_COMMAND checkout $BRANCH
+  if [ $? -gt 0 ]; then

Review Comment:
   <picture><img alt="5% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/5/display.svg"></picture>
   
   đŸ’Ŧ 3 similar findings have been found in this PR
   
   ---
   
   *[SC2181](https://github.com/koalaman/shellcheck/wiki/SC2181):*  Check exit code directly with e.g. 'if ! mycmd;', not indirectly with $?.
   
   ---
   
   <details><summary><b>🔎 Expand here to view all instances of this finding</b></summary><br/>
     
     
   <div align=\"center\">
   
   
   | **File Path** | **Line Number** |
   | ------------- | ------------- |
   | dev-tools/scripts/cherrypick.sh | [154](https://github.com/apache/solr/blob/7cd1645447c726b773dae2bd0fefddd89906207a/dev-tools/scripts/cherrypick.sh#L154) |
   | dev-tools/scripts/cherrypick.sh | [184](https://github.com/apache/solr/blob/7cd1645447c726b773dae2bd0fefddd89906207a/dev-tools/scripts/cherrypick.sh#L184) |
   | dev-tools/scripts/cherrypick.sh | [206](https://github.com/apache/solr/blob/7cd1645447c726b773dae2bd0fefddd89906207a/dev-tools/scripts/cherrypick.sh#L206) |
   <p><a href="https://lift.sonatype.com/results/github.com/apache/solr/01GNT78Y5TANX0BRWZ94XM7VKR?t=Shellcheck|SC2181" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
   
   
   
   ---
   
   <details><summary><b>ℹī¸ Learn about @sonatype-lift commands</b></summary>
   
   You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
   | **Command** | **Usage** |
   | ------------- | ------------- |
   | `@sonatype-lift ignore` | Leave out the above finding from this PR |
   | `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
   | `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
   
   **Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
   <sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
   
   
   
   ---
   
   Was this a good recommendation?
   [ [🙁 Not relevant](https://www.sonatype.com/lift-comment-rating?comment=365219205&lift_comment_rating=1) ] - [ [😕 Won't fix](https://www.sonatype.com/lift-comment-rating?comment=365219205&lift_comment_rating=2) ] - [ [😑 Not critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365219205&lift_comment_rating=3) ] - [ [🙂 Critical, will fix](https://www.sonatype.com/lift-comment-rating?comment=365219205&lift_comment_rating=4) ] - [ [😊 Critical, fixing now](https://www.sonatype.com/lift-comment-rating?comment=365219205&lift_comment_rating=5) ]



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org


[GitHub] [solr] vatsalpatel3689 closed pull request #1261: MN-551 | working and tested changes of solr 9.1

Posted by GitBox <gi...@apache.org>.
vatsalpatel3689 closed pull request #1261: MN-551 | working and tested changes of solr 9.1
URL: https://github.com/apache/solr/pull/1261


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org