fix(gunicorn): parse DEBUG env var as a boolean#3589
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (3)**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⚙️ CodeRabbit configuration file
Files:
src/ui/**/*.py⚙️ CodeRabbit configuration file
Files:
src/api/**/*.py⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (4)
Components affected
User-visible behaviour changesFixes a bug where setting Configuration changesThe DEBUG environment variable parsing now follows a strict boolean convention across all Gunicorn configurations (API and UI components), making behaviour consistent and predictable. Testing and documentationNo tests were added or updated. No documentation updates were made to reflect the change. WalkthroughA centralised boolean environment variable parser is introduced to ChangesBoolean Environment Variable Parsing
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Small fix, but pretty real.
DEBUGwas read with rawgetenv(...)in the API/UI Gunicorn configs. SoDEBUG=falseorDEBUG=0still turned debug mode on, because Python treats non-empty strings as truthy. Kinda sneaky.Repro:
DEBUG=falsesrc/ui/utils/tmp-gunicorn.conf.pyDEBUG == "false"daemon == Trueloglevel == "debug"reloadenabledThis path is actually live:
src/ui/entrypoint.shstartsutils/tmp-gunicorn.conf.pysrc/ui/entrypoint.shstartsutils/gunicorn.conf.pysrc/api/entrypoint.shstartsutils/gunicorn.conf.pyAfter this patch, false-ish values stay off and true-ish values still work, all good.