fix: strip whitespace from instance configuration values#8744
fix: strip whitespace from instance configuration values#8744okxint wants to merge 1 commit intomakeplane:previewfrom
Conversation
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughInstanceConfigurationEndpoint.patch now reads raw request values, coerces missing/None to an empty string, converts non-None values to stripped strings (removing leading/trailing whitespace) before applying encryption or saving them. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/api/plane/license/api/views/configuration.py`:
- Line 48: When building the new config value, don't call str(...) on a JSON
null; instead read the raw = request.data.get(configuration.key,
configuration.value) and if raw is None set value to an empty string (or other
empty/unset sentinel) before calling .strip(); this prevents JSON null from
becoming the literal "None" in persisted config and aligns with
get_configuration_value() semantics. Ensure you update the assignment around
request.data.get(configuration.key, configuration.value) (referenced by
configuration.key and configuration.value) to handle raw is None explicitly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e07f9fde-d22f-4ff3-bd46-379d4b142a8e
📒 Files selected for processing (1)
apps/api/plane/license/api/views/configuration.py
|
Hey, friendly follow-up on this — let me know if there's anything I should adjust. Happy to iterate on feedback! |
When patching instance configuration values, the raw values from request.data were used directly without sanitization. This adds: - Whitespace stripping via str().strip() to prevent leading/trailing spaces from being stored - Explicit None handling so that null values become empty strings instead of the literal string "None"
91f8ea2 to
83640d8
Compare
83640d8 to
79b7306
Compare
Strip whitespace from config values before persisting. Closes #8737
Summary by CodeRabbit