Copilot commented on code in PR #16884:
URL: https://github.com/apache/pinot/pull/16884#discussion_r2375948385


##########
pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java:
##########
@@ -70,9 +72,15 @@ public class GcsPinotFS extends BasePinotFS {
 
   @Override
   public void init(PinotConfiguration config) {
+    String version = GcsPinotFS.class.getPackage().getImplementationVersion();
+    if (version == null) {
+      version = "unknown";
+    }
+    String userAgent = "apache-pinot/:" + version + "(GPN:apache-pinot)";
     Credentials credentials = null;
     try {
-      StorageOptions.Builder storageBuilder = StorageOptions.newBuilder();
+      StorageOptions.Builder storageBuilder = StorageOptions.newBuilder()
+          
.setHeaderProvider(FixedHeaderProvider.create(ImmutableMap.of("User-agent", 
userAgent)));

Review Comment:
   The HTTP header name 'User-agent' should be 'User-Agent' with a capital 'A'. 
HTTP header names are case-insensitive but the standard convention is to use 
proper capitalization.
   ```suggestion
             
.setHeaderProvider(FixedHeaderProvider.create(ImmutableMap.of("User-Agent", 
userAgent)));
   ```



##########
pinot-plugins/pinot-file-system/pinot-gcs/src/main/java/org/apache/pinot/plugin/filesystem/GcsPinotFS.java:
##########
@@ -70,9 +72,15 @@ public class GcsPinotFS extends BasePinotFS {
 
   @Override
   public void init(PinotConfiguration config) {
+    String version = GcsPinotFS.class.getPackage().getImplementationVersion();
+    if (version == null) {
+      version = "unknown";
+    }
+    String userAgent = "apache-pinot/:" + version + "(GPN:apache-pinot)";

Review Comment:
   The User-Agent string format is incorrect. There should not be a colon after 
'apache-pinot/' and before the version. The correct format should be 
'apache-pinot/' + version + ' (GPN:apache-pinot)'.
   ```suggestion
       String userAgent = "apache-pinot/" + version + " (GPN:apache-pinot)";
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to