Skip to content

feat(#304) Environments color 🎨 (#1053)#6974

Merged
sid-bruno merged 4 commits intousebruno:feature/environment-color-extendedfrom
pooja-bruno:feat/env-color-picker
Jan 30, 2026
Merged

feat(#304) Environments color 🎨 (#1053)#6974
sid-bruno merged 4 commits intousebruno:feature/environment-color-extendedfrom
pooja-bruno:feat/env-color-picker

Conversation

@pooja-bruno
Copy link
Collaborator

@pooja-bruno pooja-bruno commented Jan 29, 2026

Description

JIRA

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.
Screen.Recording.2026-01-29.at.7.08.44.PM.mov

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Walkthrough

This 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

Cohort / File(s) Summary
Environment Color Parsing
packages/bruno-lang/v2/src/envToJson.js
Extends BruEnvFile grammar to accept color alternative; introduces color rule in grammar and corresponding semantic handler returning color property in AST.
Environment Color Serialization
packages/bruno-lang/v2/src/jsonToEnv.js
Refactors output construction from early returns to accumulated buffer approach; adds color line output when color property is present.
Environment Color Schema
packages/bruno-schema/src/collections/index.js
Adds optional color field (Yup.string().optional()) to environmentSchema object definition.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly Related PRs

Suggested Labels

pr-feature, long-term-goal, size/L

Suggested Reviewers

  • helloanoop
  • lohit-bruno
  • naman-bruno
  • bijin-bruno

Poem

🎨 Colors now paint your env files bright,
From parser to schema, each field in sight,
A chromatic touch where gray once was cast,
Configuration blooms—no more colorblind past! 🌈

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main feature: adding color support to environments, which is reflected in all three modified files (grammar parser, JSON converter, and schema validation).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pooja-bruno pooja-bruno changed the base branch from main to feature/environment-color-extended January 29, 2026 12:49
@pull-request-size pull-request-size bot added size/L and removed size/S labels Jan 29, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 after color: and block subsequent vars / vars:secret blocks 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 color is 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}
 `;
   }

@pooja-bruno pooja-bruno marked this pull request as ready for review January 29, 2026 13:40
@sid-bruno sid-bruno merged commit ad8b7b7 into usebruno:feature/environment-color-extended Jan 30, 2026
1 of 2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Feb 13, 2026
6 tasks
@coderabbitai coderabbitai bot mentioned this pull request Mar 3, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants