feat(#304) Environments color 🎨 (#1053)#6974
feat(#304) Environments color 🎨 (#1053)#6974sid-bruno merged 4 commits intousebruno:feature/environment-color-extendedfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
WalkthroughThis PR adds support for storing and parsing color properties in environment files. It extends the grammar parser to recognize color entries, updates serialization to output color values, and adds optional color field validation to the environment schema. Changes
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/bruno-lang/v2/src/envToJson.js (1)
15-47: Color rule will consume the remainder of the file.
color = "color:" any*matches any character including newlines, so it will consume everything aftercolor:and block subsequentvars/vars:secretblocks from parsing. Bound color values to a single line instead.Proposed fix
- color = "color:" any* + color = "color:" st* colorvalue nl? + colorvalue = (~nl any)*- color: (_1, anystring) => { - return { - color: anystring.sourceString.trim() - }; - } + color: (_1, _2, value, _3) => { + return { + color: value.sourceString.trim() + }; + }
🧹 Nitpick comments (1)
packages/bruno-lang/v2/src/jsonToEnv.js (1)
23-48: Guard against multiline/invalid color values before serializing.Since
coloris emitted verbatim, a newline or malformed value can corrupt the env file. Consider trimming and rejecting values containing newlines (or normalizing to a validated format) before appending.🛠️ Suggested hardening
- const color = _.get(json, 'color', undefined); + const color = _.get(json, 'color'); + const colorValue = typeof color === 'string' ? color.trim() : ''; @@ - if (color) { - output += `color: ${color} + if (colorValue && !/[\r\n]/.test(colorValue)) { + output += `color: ${colorValue} `; }
ad8b7b7
into
usebruno:feature/environment-color-extended
Description
JIRA
Contribution Checklist:
Screen.Recording.2026-01-29.at.7.08.44.PM.mov