bito-code-review[bot] commented on code in PR #37216:
URL: https://github.com/apache/superset/pull/37216#discussion_r2699825094


##########
superset/mcp_service/storage.py:
##########
@@ -109,15 +115,46 @@ def _create_redis_store(
         return None
 
     try:
+        # Parse URL to handle SSL properly
+        parsed = urlparse(redis_url)
+        use_ssl = parsed.scheme == "rediss"
+
+        # Build clean URL without query params that may cause issues
+        clean_url = f"{parsed.scheme}://"
+        if parsed.password:
+            clean_url += f":{parsed.password}@"

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>URL auth parsing bug</b></div>
   <div id="fix">
   
   The URL reconstruction omits username when building the auth part, causing 
invalid Redis URLs like 'redis://:pass@host' instead of 
'redis://user:pass@host', which could lead to connection failures.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
           if parsed.username or parsed.password:
               auth = parsed.username if parsed.username else ''
               if parsed.password:
                   auth += f':{parsed.password}'
               clean_url += f"{auth}@"
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #566a93</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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