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


##########
docker/docker-bootstrap.sh:
##########
@@ -96,7 +96,9 @@ case "${1}" in
         echo "  🔒 Werkzeug debugger disabled (set SUPERSET_DEBUG_ENABLED=true 
to enable)"
     fi
 
-    flask run -p $PORT --reload $DEBUGGER_FLAG --host=0.0.0.0 
--exclude-patterns 
"*/node_modules/*:*/.venv/*:*/build/*:*/__pycache__/*:*/superset-frontend/*"
+    flask run -p $PORT --reload $DEBUGGER_FLAG --host=0.0.0.0 \
+      --extra-files "/app/superset/extensions/.reload_trigger" \
+      --exclude-patterns 
"*/node_modules/*:*/.venv/*:*/build/*:*/__pycache__/*:*/superset-frontend/*:*/superset/__init__.py"

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>CWE-20: Path Mismatch in Reload Trigger</b></div>
   <div id="fix">
   
   The `--extra-files` path is incorrect. Python's 
`local_extensions_watcher.py` computes the trigger path as 
`Path(__file__).resolve().parent / '.reload_trigger'`, which yields 
`/app/superset/superset/extensions/.reload_trigger` (because `__file__` is 
`superset/extensions/local_extensions_watcher.py`). The shell script monitors 
`/app/superset/extensions/.reload_trigger` instead, so Flask's reloader will 
never detect the trigger file being touched, breaking hot-reload for 
LOCAL_EXTENSIONS changes. Additionally, the exclude pattern 
`*/superset/__init__.py` is missing the `superset/` prefix to match the actual 
file at `*/superset/superset/__init__.py`. (See also: 
[CWE-20](https://cwe.mitre.org/data/definitions/20.html))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #dc75ca</i></small>
   </div><div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incomplete exclude pattern for __init__.py</b></div>
   <div id="fix">
   
   The exclude pattern `*/superset/__init__.py` only matches the top-level 
`superset/__init__.py` file (1 of 175 `__init__.py` files in the superset 
package). The pattern should be `*/superset/*/__init__.py` to match all nested 
package init files, or a broader pattern if the goal is to exclude all 
`__init__.py` files from triggering Flask reloads.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #bad9c7</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