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 2022/07/05 14:46:27 UTC

[GitHub] [solr] gerlowskija opened a new pull request, #932: SOLR-15182: Remove remaining apispec files

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

   # Description
   
   Solr is in the process of moving away from 'apispec' defined v2 APIs, and towards annotated-based APIs.  Only a few apispec files remain.
    
   # Solution
   
   This commit removes the remaining apispec definitions.  `core.system.blob.json` and `core.system.blob.upload.json` are converted into annotated Java classes, and emptySpec.json is removed altogether.
   
   # Tests
   
   See V2BlobApiMappingTest.
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] 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.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] 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)
   - [x] I have developed this patch against the `main` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.


-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r913888507


##########
solr/core/src/java/org/apache/solr/api/ApiBag.java:
##########
@@ -17,37 +17,14 @@
 
 package org.apache.solr.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.SUPPORTED_METHODS;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.util.StrUtils.formatString;
-import static org.apache.solr.common.util.ValidatingJsonMap.ENUM_OF;
-import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
-
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.common.util.ContentStream;
-import org.apache.solr.common.util.JsonSchemaValidator;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.PathTrie;
-import org.apache.solr.common.util.Utils;
-import org.apache.solr.common.util.ValidatingJsonMap;
+import org.apache.solr.common.util.*;

Review Comment:
   .*; my old friend, I love to nit pick you.



-- 
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] gerlowskija commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r914878254


##########
solr/core/src/java/org/apache/solr/api/ApiBag.java:
##########
@@ -17,37 +17,14 @@
 
 package org.apache.solr.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.SUPPORTED_METHODS;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.util.StrUtils.formatString;
-import static org.apache.solr.common.util.ValidatingJsonMap.ENUM_OF;
-import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
-
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.common.util.ContentStream;
-import org.apache.solr.common.util.JsonSchemaValidator;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.PathTrie;
-import org.apache.solr.common.util.Utils;
-import org.apache.solr.common.util.ValidatingJsonMap;
+import org.apache.solr.common.util.*;

Review Comment:
   Wrote this one on a new laptop; always forget the IntelliJ setting, gah.



-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r913888965


##########
solr/core/src/java/org/apache/solr/api/ApiBag.java:
##########
@@ -58,6 +35,18 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.util.*;

Review Comment:
   My oldest of friends, `java.util.*;` ;-)



-- 
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] gerlowskija commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r914874464


##########
solr/core/src/test/org/apache/solr/handler/admin/V2ApiMappingTest.java:
##########
@@ -204,11 +204,12 @@ public String getHttpMethod() {
     return queryRequestCaptor.getValue().getParams();
   }
 
-  protected void assertAnnotatedApiExistsFor(String method, String path) {
+  protected AnnotatedApi assertAnnotatedApiExistsFor(String method, String path) {
     final AnnotatedApi api = getAnnotatedApiFor(method, path);
     assertTrue(
         "Expected to find API mapping for [" + method + " " + path + "] but none found!",
         api != null);
+    return api;

Review Comment:
   Tests that call this method can use the returned API for additional, more detailed asserting.
   
   For an example, see [here](https://github.com/apache/solr/pull/932/files#diff-e34dd712e2ac23556653b6da663842732181d039312b0d209376fe0120fb48ecR52)



-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r914923709


##########
solr/core/src/java/org/apache/solr/api/ApiBag.java:
##########
@@ -17,37 +17,14 @@
 
 package org.apache.solr.api;
 
-import static org.apache.solr.client.solrj.SolrRequest.SUPPORTED_METHODS;
-import static org.apache.solr.common.params.CommonParams.NAME;
-import static org.apache.solr.common.util.StrUtils.formatString;
-import static org.apache.solr.common.util.ValidatingJsonMap.ENUM_OF;
-import static org.apache.solr.common.util.ValidatingJsonMap.NOT_NULL;
-
 import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Maps;
-import java.io.IOException;
-import java.lang.invoke.MethodHandles;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.stream.Collectors;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SpecProvider;
-import org.apache.solr.common.util.CommandOperation;
-import org.apache.solr.common.util.ContentStream;
-import org.apache.solr.common.util.JsonSchemaValidator;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.PathTrie;
-import org.apache.solr.common.util.Utils;
-import org.apache.solr.common.util.ValidatingJsonMap;
+import org.apache.solr.common.util.*;

Review Comment:
   We really need some sort of default intellij setup....   in olden days I think you did "ant intellij" and everything was set up!



-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r914927788


##########
solr/core/src/java/org/apache/solr/handler/BlobHandler.java:
##########
@@ -22,6 +22,7 @@
 import static org.apache.solr.common.params.CommonParams.SORT;
 import static org.apache.solr.common.params.CommonParams.VERSION;
 
+import com.google.common.collect.Lists;

Review Comment:
   never mind, I dug around in JIRA and can't find it!



-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r913890551


##########
solr/core/src/java/org/apache/solr/handler/BlobHandler.java:
##########
@@ -22,6 +22,7 @@
 import static org.apache.solr.common.params.CommonParams.SORT;
 import static org.apache.solr.common.params.CommonParams.VERSION;
 
+import com.google.common.collect.Lists;

Review Comment:
   isn't there a PR to get away from this?



-- 
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] epugh commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
epugh commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r913892056


##########
solr/core/src/test/org/apache/solr/handler/admin/V2ApiMappingTest.java:
##########
@@ -204,11 +204,12 @@ public String getHttpMethod() {
     return queryRequestCaptor.getValue().getParams();
   }
 
-  protected void assertAnnotatedApiExistsFor(String method, String path) {
+  protected AnnotatedApi assertAnnotatedApiExistsFor(String method, String path) {
     final AnnotatedApi api = getAnnotatedApiFor(method, path);
     assertTrue(
         "Expected to find API mapping for [" + method + " " + path + "] but none found!",
         api != null);
+    return api;

Review Comment:
   why is this returned?    



-- 
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] gerlowskija merged pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
gerlowskija merged PR #932:
URL: https://github.com/apache/solr/pull/932


-- 
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] gerlowskija commented on a diff in pull request #932: SOLR-15182: Remove remaining apispec files

Posted by GitBox <gi...@apache.org>.
gerlowskija commented on code in PR #932:
URL: https://github.com/apache/solr/pull/932#discussion_r914883795


##########
solr/core/src/java/org/apache/solr/handler/BlobHandler.java:
##########
@@ -22,6 +22,7 @@
 import static org.apache.solr.common.params.CommonParams.SORT;
 import static org.apache.solr.common.params.CommonParams.VERSION;
 
+import com.google.common.collect.Lists;

Review Comment:
   Mm, that's news to me, I'll keep an eye out and stop using it if it goes through.



-- 
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