Skip to content

feat: variable data types support - #8046

Merged
sid-bruno merged 15 commits into
usebruno:mainfrom
lohit-bruno:variable_datatype_support
Jun 19, 2026
Merged

sid-bruno merged 15 commits into
usebruno:mainfrom
lohit-bruno:variable_datatype_support

Conversation

@lohit-bruno

@lohit-bruno lohit-bruno commented May 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Typed environment, collection, folder, and request variables (string / number / boolean / object) with read-time parsing across BRU, OpenCollection YML.

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.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Summary by CodeRabbit

  • New Features

    • Add variable datatypes (number/boolean/object) with UI selector, preserved across persist/export/import; secrets hide type.
  • Bug Fixes

    • Multi-line variable editors and table rows no longer clip; empty/null/falsy values and placeholders handle correctly across variable and environment UIs.
  • Tests

    • Extensive unit and E2E coverage added (parsing, coercion, serialization, import/export, UI, Playwright flows).

@coderabbitai

coderabbitai Bot commented May 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds comprehensive typed-variable support: new datatype utilities, DatatypeSelector UI, table/editor adjustments, Redux persistence updates, filestore/OpenCollection converters, BRU/YML language tooling, Electron runtime parsing, and extensive unit and E2E tests/fixtures.

Changes

Typed variables end-to-end

Layer / File(s) Summary
Overall PR
multiple files
Implements datatype support across UI, state, converters, runtime, schemas, test fixtures, and Playwright suites as a single cross-cutting change.
  • Sequence Diagram(s): skipped.

Estimated code review effort:
🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs:

Suggested reviewers:

  • helloanoop
  • naman-bruno
  • bijin-bruno

"Typed values travel far and wide—
From editor rows to runtime side.
JSON, number, boolean true,
Tests and fixtures all in view.
🎉 Datatypes landed—nice and spry."

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@lohit-bruno lohit-bruno changed the title feat: variable data types support feat: variable data types support May 20, 2026
Comment thread packages/bruno-lang/v2/src/bruToJson.js Resolved
Comment thread package.json Resolved
@lohit-bruno
lohit-bruno marked this pull request as ready for review May 29, 2026 13:11

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (11)
packages/bruno-common/src/utils/datatype.ts (1)

9-37: 💤 Low value

Outer try/catch is redundant.

None of the operations inside the outer block throw (the only throwing call, JSON.parse, has its own inner try/catch). The wrapper can go, but it's harmless — leave it if you prefer the belt-and-braces.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-common/src/utils/datatype.ts` around lines 9 - 37, Remove the
redundant outer try/catch wrapper in the parseValueByDatatype function: the only
potentially-throwing operation (JSON.parse) is already protected by its own
inner try/catch, so eliminate the top-level try { ... } catch { ... }
surrounding the datatype branches in parseValueByDatatype to simplify control
flow and avoid swallowing unexpected errors unnecessarily.
packages/bruno-filestore/src/formats/yml/common/datatype.ts (1)

2-8: ⚡ Quick win

Use import type / export type for BrunoVariableDatatype

BrunoVariableDatatype is defined as a type in packages/bruno-common/src/utils/datatype.ts. packages/bruno-filestore/tsconfig(.build).json doesn’t enable isolatedModules, so the TS1205-specific risk is unlikely here, but re-exporting it via a value export is still brittle—export it as a type instead.

♻️ Proposed fix
 import type { VariableTypedValue } from '`@opencollection/types/common/variables`';
 import {
   parseValueByDatatype,
-  BrunoVariableDatatype,
   isBrunoVariableDatatype
 } from '`@usebruno/common/utils`';
+import type { BrunoVariableDatatype } from '`@usebruno/common/utils`';
 
-export { BrunoVariableDatatype, isBrunoVariableDatatype };
+export type { BrunoVariableDatatype };
+export { isBrunoVariableDatatype };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-filestore/src/formats/yml/common/datatype.ts` around lines 2 -
8, BrunoVariableDatatype is a type and should be imported/exported as a
type-only symbol: change the import to use "import type" for
BrunoVariableDatatype (keep parseValueByDatatype and isBrunoVariableDatatype as
regular imports) and change the re-export to "export type {
BrunoVariableDatatype }" while leaving "export { isBrunoVariableDatatype }" as a
value export so only the type is re-exported.
packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts (1)

36-36: ⚡ Quick win

Add defensive checks before non-null assertions.

If parseFolder returns an unexpected structure or the parsing fails, the non-null assertions will cause the test to crash rather than fail with a clear message.

🛡️ Proposed defensive checks
 const reparsed = parseFolder(yml);
+expect(reparsed.request).toBeDefined();
+expect(reparsed.request!.vars).toBeDefined();
+expect(reparsed.request!.vars!.req).toBeDefined();
 const reqVars = reparsed.request!.vars!.req!;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts` at line 36,
The test currently uses non-null assertions on reparsed.request!.vars!.req!
which will crash the test on unexpected parseFolder output; update
stringifyFolder.spec.ts to defensively check the structure returned by
parseFolder: verify reparsed is defined, then that reparsed.request,
reparsed.request.vars and reparsed.request.vars.req are defined (use
expect(...).toBeDefined() or conditional guards) and emit clear failure messages
before accessing req; reference the symbols reparsed, request, vars, req and the
parseFolder call to locate where to add these assertions/guards.
packages/bruno-filestore/src/formats/yml/stringifyItem.spec.ts (1)

42-42: ⚡ Quick win

Add defensive checks before non-null assertions.

Similar to the folder test, add explicit assertions to verify the structure before accessing nested properties.

🛡️ Proposed defensive checks
 const reparsed = parseItem(yml);
+expect(reparsed.request).toBeDefined();
+expect(reparsed.request!.vars).toBeDefined();
+expect(reparsed.request!.vars.req).toBeDefined();
 const reqVars = reparsed.request!.vars.req;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-filestore/src/formats/yml/stringifyItem.spec.ts` at line 42,
Add explicit defensive assertions before using the non-null assertion on
reparsed.request so the test fails with a clear message instead of throwing;
before the line referencing reqVars (reparsed.request!.vars.req) add checks such
as asserting reparsed.request is defined and has vars (e.g.,
expect(reparsed.request).toBeDefined() and
expect(reparsed.request!.vars).toBeDefined()) and/or assert that vars.req
exists, then assign const reqVars = reparsed.request!.vars.req safely; this
targets the usage of reparsed.request!.vars.req in stringifyItem.spec.ts.
packages/bruno-js/tests/setEnvVar.spec.js (1)

64-89: ⚖️ Poor tradeoff

Document the silent data loss risk in production code.

The tests correctly document that functions, symbols, and circular objects serialize to "" and are "silently lost on save round-trip." Consider adding runtime warnings in the actual setEnvVar implementation or documentation to alert users that these types won't persist correctly.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-js/tests/setEnvVar.spec.js` around lines 64 - 89, The tests
show functions, symbols, and circular objects stored via setEnvVar end up
serialized to "" by valueToString and are silently lost on persist; update the
setEnvVar implementation to detect non-serializable values (e.g., call
valueToString(value) and/or attempt JSON.stringify/valueToString and treat a
returned empty string as non-serializable) and emit a runtime warning when the
caller passes { persist: true } for such values; reference setEnvVar,
valueToString, mergeAndPersistEnvironment, and persistentEnvVariables—log a
clear warning (including the env var name and type) to the module logger or
console and skip persisting or coerce behavior so users are informed of the
data-loss risk.
packages/bruno-lang/v2/src/jsonToCollectionBru.js (1)

379-381: ⚡ Quick win

Extract duplicated serializeVar helper and move it up in the file.

The same serializeVar function is defined twice (once for reqvars at line 379 and again for resvars at line 409). As noted in past review comments, this helper should be moved up in the file and defined once to avoid duplication.

♻️ Proposed refactor
 const stripLastLine = (text) => {
   if (!text || !text.length) return text;

   return text.replace(/(\r?\n)$/, '');
 };

+const serializeVar = (item, prefix = '') => {
+  return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
+};
+
 const jsonToCollectionBru = (json) => {
   const { meta, query, headers, auth, script, tests, vars, docs } = json;
   // ... rest of function

   let reqvars = _.get(vars, 'req');
   let resvars = _.get(vars, 'res');
   if (reqvars && reqvars.length) {
     const varsEnabled = _.filter(reqvars, (v) => v.enabled && !v.local);
     const varsDisabled = _.filter(reqvars, (v) => !v.enabled && !v.local);
     const varsLocalEnabled = _.filter(reqvars, (v) => v.enabled && v.local);
     const varsLocalDisabled = _.filter(reqvars, (v) => !v.enabled && v.local);

-    const serializeVar = (item, prefix = '') => {
-      return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
-    };
-
     bru += `vars:pre-request {`;
     // ... rest of reqvars block
   }
   if (resvars && resvars.length) {
     const varsEnabled = _.filter(resvars, (v) => v.enabled && !v.local);
     const varsDisabled = _.filter(resvars, (v) => !v.enabled && !v.local);
     const varsLocalEnabled = _.filter(resvars, (v) => v.enabled && v.local);
     const varsLocalDisabled = _.filter(resvars, (v) => !v.enabled && v.local);

-    const serializeVar = (item, prefix = '') => {
-      return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
-    };
-
     bru += `vars:post-response {`;
     // ... rest of resvars block
   }

Also applies to: 409-411

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-lang/v2/src/jsonToCollectionBru.js` around lines 379 - 381,
There are two identical helpers named serializeVar (used for reqvars and
resvars); extract a single serializeVar function to a higher scope (above where
reqvars and resvars are built) and remove the duplicate definition, making sure
the shared serializeVar uses buildAnnotationsFromVariable and getValueString and
is referenced by both the request and response variable serialization code (so
both places call serializeVar(item, prefix) instead of redefining it).
packages/bruno-lang/v2/src/jsonToBru.js (1)

666-668: ⚡ Quick win

Extract duplicated serializeVar helper to reduce code duplication.

The same serializeVar function is defined twice (once for reqvars at line 666 and again for resvars at line 694). Consider defining it once before the reqvars block and reusing it for both.

♻️ Proposed refactor
  let reqvars = _.get(vars, 'req');
  let resvars = _.get(vars, 'res');
+ const serializeVar = (item, prefix = '') => {
+   return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
+ };
+
  if (reqvars && reqvars.length) {
    const varsEnabled = _.filter(reqvars, (v) => v.enabled && !v.local);
    const varsDisabled = _.filter(reqvars, (v) => !v.enabled && !v.local);
    const varsLocalEnabled = _.filter(reqvars, (v) => v.enabled && v.local);
    const varsLocalDisabled = _.filter(reqvars, (v) => !v.enabled && v.local);

    bru += `vars:pre-request {`;

-   const serializeVar = (item, prefix = '') => {
-     return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
-   };
-
    if (varsEnabled.length) {
      bru += `\n${indentString(varsEnabled.map((item) => serializeVar(item)).join('\n'))}`;
    }
    // ... rest of reqvars block
  }
  if (resvars && resvars.length) {
    const varsEnabled = _.filter(resvars, (v) => v.enabled && !v.local);
    const varsDisabled = _.filter(resvars, (v) => !v.enabled && !v.local);
    const varsLocalEnabled = _.filter(resvars, (v) => v.enabled && v.local);
    const varsLocalDisabled = _.filter(resvars, (v) => !v.enabled && v.local);

-   const serializeVar = (item, prefix = '') => {
-     return `${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}: ${getValueString(item.value)}`;
-   };
-
    bru += `vars:post-response {`;
    // ... rest of resvars block
  }

Also applies to: 694-696

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/bruno-lang/v2/src/jsonToBru.js` around lines 666 - 668, The helper
serializeVar is duplicated for reqvars and resvars; extract a single function
and reuse it: create one serializeVar(item, prefix = '') that returns
`${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}:
${getValueString(item.value)}` placed before the reqvars block, remove the
second definition, and update both reqvars and resvars code paths to call this
single serializeVar; keep the same parameter names and ensure references to
serializeAnnotations, buildAnnotationsFromVariable, and getValueString remain
unchanged.
tests/variable-datatypes/create-via-ui.spec.ts (1)

73-73: ⚡ Quick win

Replace fixed sleeps with event-driven waits for stability.

These page.waitForTimeout(...) calls make the test slower and can still be flaky. Prefer waiting on concrete UI/state signals (existing row/type-label assertions, save completion indicators, or post-save persisted-state checks) instead of wall-clock delays.

Suggested direction
-    await page.waitForTimeout(200);
+    // rely on explicit assertion that confirms the mutation/render completed

-  await page.waitForTimeout(500);
+  // wait for a deterministic save-complete signal (UI/state), then continue

-        await page.waitForTimeout(200);
+        // rely on type-label/value assertion for synchronization

-    await page.waitForTimeout(500);
+    // wait for env save completion signal before post-save assertions

As per coding guidelines: “Try to reduce usage of page.waitForTimeout(); in code unless absolutely necessary and the locator cannot be found using existing expect() playwright calls”.

Also applies to: 85-85, 207-207, 212-212

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/variable-datatypes/create-via-ui.spec.ts` at line 73, The test uses
fixed sleeps (await page.waitForTimeout(200)) which are slow and flaky; replace
them with event-driven waits tied to UI/state changes: for example, after
creating/saving a variable use await page.waitForResponse(...) to wait for the
save API response or await page.waitForSelector(...) / await
expect(someRowOrTypeLabelLocator).toBeVisible() to wait for the new row or
type-label to appear, and after edits use await page.waitForFunction(...) or
await expect(persistedStateLocator).toHaveText(...) to assert persistence;
update every occurrence of page.waitForTimeout (including the ones at the same
block and noted around lines 85, 207, 212) to use these locator/response-based
waits (refer to page, save button / save API, and the row/type-label locators
used elsewhere in create-via-ui.spec.ts).
tests/variable-datatypes/fixtures/workspace/collections/bru/folder/request.bru (1)

8-19: ⚡ Quick win

Avoid duplicating query params in both URL and params:query block.

Line 8 and Lines 13-19 define the same params twice. Keep only params:query (or only inline URL params) to prevent drift and flaky args assertions.

Suggested cleanup
 post {
-  url: https://httpbin.org/anything?q=hi&p_str={{req_str}}&p_num={{req_num}}&p_bool={{req_bool}}&p_obj={{req_obj}}
+  url: https://httpbin.org/anything
   body: json
   auth: none
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@tests/variable-datatypes/fixtures/workspace/collections/bru/folder/request.bru`
around lines 8 - 19, The request currently duplicates query parameters by
placing them in the URL string and again in the params:query block; remove the
inline query string from the url value (leave url as the base endpoint, e.g.
https://httpbin.org/anything) and keep the params:query block as the single
source of truth so p_str, p_num, p_bool, p_obj and q are only defined in
params:query; update any tests or consumers that expect inline params to use
params:query instead.
tests/variable-datatypes/parsed-from-fixture.spec.ts (2)

226-235: 🏗️ Heavy lift

Network reliance on httpbin.org makes these tests non-hermetic — the Linux run already hit a 502 Bad Gateway.

sendAndAssertAllTestsPass (and the multipart/form-urlencoded tests) post to a live external service, so a transient upstream outage fails the suite regardless of correctness. This also conflicts with the parallel-safe/no-external-state expectation for E2E tests. Consider routing these against a local/mocked HTTP endpoint so the wire-format assertions stay deterministic.

As per coding guidelines: "E2E tests must be parallel-safe. No shared user data directories, ports, files, DBs, caches, clipboard assumptions, or global app state."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/variable-datatypes/parsed-from-fixture.spec.ts` around lines 226 - 235,
The tests call external httpbin.org which makes them non-hermetic; change
sendAndAssertAllTestsPass (and the multipart/form-urlencoded test helpers) to
target a local/mock HTTP endpoint instead of the live service: implement a
Playwright route or an in-process test HTTP server that returns the same
responses and wire-format for the requests, ensure the mock is started/stubbed
per-test (using unique ports or request interception) so tests are
parallel-safe, and update assertions to use the mock’s responses rather than
relying on httpbin.org.

126-137: ⚡ Quick win

Replace the fixed waitForTimeout(300) with an event-driven wait.

Line 134 already confirms the label flipped; the draft/has-changes-icon state is the actual signal callers depend on before saving. Wait on that instead of a magic sleep.

♻️ Proposed change
   await expect(trigger).toHaveText(newType);
-  // Let the dispatched Redux mutation propagate before the caller saves.
-  await page.waitForTimeout(300);
+  // Wait for the dispatched mutation to mark the tab dirty before the caller saves.
+  await expect(page.locator('.request-tab.active .has-changes-icon')).toBeVisible();
As per coding guidelines: "Replace magic timeouts with event-driven waits in E2E tests." The same applies to `waitForTimeout(50)` (line 209) and `waitForTimeout(150)` (line 281).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/variable-datatypes/parsed-from-fixture.spec.ts` around lines 126 - 137,
The test uses a fixed sleep in changeRowDatatype (function changeRowDatatype)
after asserting the .type-label text; replace the magic waitForTimeout(300) with
an event-driven wait that waits for the row's "has-changes-icon"/draft state to
appear (or update) so callers know the Redux mutation propagated before saving;
locate the row Locator passed into changeRowDatatype and wait on a selector like
row.locator('.has-changes-icon') (e.g., toBeVisible or toHaveCount(1)) or wait
for the draft attribute/state change on that row, and apply the same pattern to
the other two fixed waits in the spec (the waitForTimeout(50) and
waitForTimeout(150)) so all three become event-driven waits tied to the UI
state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-app/src/components/EnvironmentVariablesTable/index.js`:
- Line 599: The value prop currently sets value={typeof variable.value ===
'string' ? variable.value : JSON.stringify(variable.value, null, 2)} which
causes null/undefined to render as "null"/"undefined"; update the logic in the
EnvironmentVariablesTable component where variable.value is used (the value prop
for the editor/input) to check for variable.value === null || variable.value ===
undefined and use an empty string (or placeholder) in that case, otherwise keep
the existing behavior (string as-is, non-string JSON.stringify). Ensure you
update any helper/inline expression referencing variable.value to handle
null/undefined consistently.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js`:
- Around line 2299-2309: The secret branch currently drops the datatype when
persisting (the block using v.secret and valueToString(found.value)), causing
typed secrets to become plain strings; update that branch to preserve or
propagate the datatype (use found.datatype or fall back to v.datatype) and
include it in the returned object alongside valueToString(found.value) so
secrets keep their datatype metadata. Locate the branch that checks v.secret
(references: v, found, valueToString) and return { ...rest, value:
valueToString(found.value), ...(datatype ? { datatype } : {}) } where datatype
is taken from found.datatype || v.datatype.

In `@packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js`:
- Around line 420-425: The code currently unconditionally overwrites
variable.datatype during ephemeral updates, causing deletes to restore
persistedValue but not the original datatype; modify the logic so you do not
clobber an existing datatype: only infer and assign variable.datatype when it is
currently undefined (e.g., if (!variable.datatype) variable.datatype = inferred
=== 'string' ? undefined : inferred), or alternatively capture the previous
datatype into the rollback/persisted state (persistedValue.previousDatatype) and
restore that on bru.deleteEnvVar() rollback; reference variable.datatype,
getDatatypeFromValue, persistedValue (rollback state), and the
bru.setEnvVar()/bru.deleteEnvVar() flow when implementing the fix.

In `@tests/environments/api-setEnvVar/api-setEnvVar-with-persist-typed.spec.ts`:
- Around line 61-62: The test uses newApp.firstWindow() immediately after
restartApp(), which can race on slow first-window startup; replace that with
waitForReadyPage(newApp) so the test waits for the app to reach
[data-app-state="loaded"] before interacting—call waitForReadyPage(newApp) and
use its returned page instead of newApp.firstWindow(); keep restartApp() as-is
and only swap the window-acquisition to waitForReadyPage to ensure reliable
startup handling.

In `@tests/variable-datatypes/parsed-from-fixture.spec.ts`:
- Around line 586-591: After opening the global environment settings with
openEnvironmentSettings(page, 'global'), the global env table is not scrolled so
trailing virtualized rows like strict_glob_num_str never mount; call
scrollEnvTableToBottom(page) after openEnvironmentSettings and before the
expectEnvVarTypeLabel assertions (e.g., before checking 'strict_glob_num_str')
so the virtualizer renders those rows; update the test sequence around
openEnvironmentSettings and expectEnvVarTypeLabel to include
scrollEnvTableToBottom(page) for the global table.
- Around line 297-318: The hover helper is racing against delayed hide timers:
after calling each popup._hidePopup({ immediate: true }) in hoverVarInBody,
ensure the DOM is actually free of any .CodeMirror-brunoVarInfo before
proceeding by waiting for the selector to disappear (e.g., await
page.waitForFunction(() => !document.querySelector('.CodeMirror-brunoVarInfo'))
or equivalent). This guarantees that any scheduled hide paths won’t remove the
next tooltip mid-assert; reference hoverVarInBody, the _hidePopup({ immediate:
true }) call, and the '.CodeMirror-brunoVarInfo' selector when making the
change.

---

Nitpick comments:
In `@packages/bruno-common/src/utils/datatype.ts`:
- Around line 9-37: Remove the redundant outer try/catch wrapper in the
parseValueByDatatype function: the only potentially-throwing operation
(JSON.parse) is already protected by its own inner try/catch, so eliminate the
top-level try { ... } catch { ... } surrounding the datatype branches in
parseValueByDatatype to simplify control flow and avoid swallowing unexpected
errors unnecessarily.

In `@packages/bruno-filestore/src/formats/yml/common/datatype.ts`:
- Around line 2-8: BrunoVariableDatatype is a type and should be
imported/exported as a type-only symbol: change the import to use "import type"
for BrunoVariableDatatype (keep parseValueByDatatype and isBrunoVariableDatatype
as regular imports) and change the re-export to "export type {
BrunoVariableDatatype }" while leaving "export { isBrunoVariableDatatype }" as a
value export so only the type is re-exported.

In `@packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts`:
- Line 36: The test currently uses non-null assertions on
reparsed.request!.vars!.req! which will crash the test on unexpected parseFolder
output; update stringifyFolder.spec.ts to defensively check the structure
returned by parseFolder: verify reparsed is defined, then that reparsed.request,
reparsed.request.vars and reparsed.request.vars.req are defined (use
expect(...).toBeDefined() or conditional guards) and emit clear failure messages
before accessing req; reference the symbols reparsed, request, vars, req and the
parseFolder call to locate where to add these assertions/guards.

In `@packages/bruno-filestore/src/formats/yml/stringifyItem.spec.ts`:
- Line 42: Add explicit defensive assertions before using the non-null assertion
on reparsed.request so the test fails with a clear message instead of throwing;
before the line referencing reqVars (reparsed.request!.vars.req) add checks such
as asserting reparsed.request is defined and has vars (e.g.,
expect(reparsed.request).toBeDefined() and
expect(reparsed.request!.vars).toBeDefined()) and/or assert that vars.req
exists, then assign const reqVars = reparsed.request!.vars.req safely; this
targets the usage of reparsed.request!.vars.req in stringifyItem.spec.ts.

In `@packages/bruno-js/tests/setEnvVar.spec.js`:
- Around line 64-89: The tests show functions, symbols, and circular objects
stored via setEnvVar end up serialized to "" by valueToString and are silently
lost on persist; update the setEnvVar implementation to detect non-serializable
values (e.g., call valueToString(value) and/or attempt
JSON.stringify/valueToString and treat a returned empty string as
non-serializable) and emit a runtime warning when the caller passes { persist:
true } for such values; reference setEnvVar, valueToString,
mergeAndPersistEnvironment, and persistentEnvVariables—log a clear warning
(including the env var name and type) to the module logger or console and skip
persisting or coerce behavior so users are informed of the data-loss risk.

In `@packages/bruno-lang/v2/src/jsonToBru.js`:
- Around line 666-668: The helper serializeVar is duplicated for reqvars and
resvars; extract a single function and reuse it: create one serializeVar(item,
prefix = '') that returns
`${serializeAnnotations(buildAnnotationsFromVariable(item))}${prefix}${item.name}:
${getValueString(item.value)}` placed before the reqvars block, remove the
second definition, and update both reqvars and resvars code paths to call this
single serializeVar; keep the same parameter names and ensure references to
serializeAnnotations, buildAnnotationsFromVariable, and getValueString remain
unchanged.

In `@packages/bruno-lang/v2/src/jsonToCollectionBru.js`:
- Around line 379-381: There are two identical helpers named serializeVar (used
for reqvars and resvars); extract a single serializeVar function to a higher
scope (above where reqvars and resvars are built) and remove the duplicate
definition, making sure the shared serializeVar uses
buildAnnotationsFromVariable and getValueString and is referenced by both the
request and response variable serialization code (so both places call
serializeVar(item, prefix) instead of redefining it).

In `@tests/variable-datatypes/create-via-ui.spec.ts`:
- Line 73: The test uses fixed sleeps (await page.waitForTimeout(200)) which are
slow and flaky; replace them with event-driven waits tied to UI/state changes:
for example, after creating/saving a variable use await
page.waitForResponse(...) to wait for the save API response or await
page.waitForSelector(...) / await
expect(someRowOrTypeLabelLocator).toBeVisible() to wait for the new row or
type-label to appear, and after edits use await page.waitForFunction(...) or
await expect(persistedStateLocator).toHaveText(...) to assert persistence;
update every occurrence of page.waitForTimeout (including the ones at the same
block and noted around lines 85, 207, 212) to use these locator/response-based
waits (refer to page, save button / save API, and the row/type-label locators
used elsewhere in create-via-ui.spec.ts).

In
`@tests/variable-datatypes/fixtures/workspace/collections/bru/folder/request.bru`:
- Around line 8-19: The request currently duplicates query parameters by placing
them in the URL string and again in the params:query block; remove the inline
query string from the url value (leave url as the base endpoint, e.g.
https://httpbin.org/anything) and keep the params:query block as the single
source of truth so p_str, p_num, p_bool, p_obj and q are only defined in
params:query; update any tests or consumers that expect inline params to use
params:query instead.

In `@tests/variable-datatypes/parsed-from-fixture.spec.ts`:
- Around line 226-235: The tests call external httpbin.org which makes them
non-hermetic; change sendAndAssertAllTestsPass (and the
multipart/form-urlencoded test helpers) to target a local/mock HTTP endpoint
instead of the live service: implement a Playwright route or an in-process test
HTTP server that returns the same responses and wire-format for the requests,
ensure the mock is started/stubbed per-test (using unique ports or request
interception) so tests are parallel-safe, and update assertions to use the
mock’s responses rather than relying on httpbin.org.
- Around line 126-137: The test uses a fixed sleep in changeRowDatatype
(function changeRowDatatype) after asserting the .type-label text; replace the
magic waitForTimeout(300) with an event-driven wait that waits for the row's
"has-changes-icon"/draft state to appear (or update) so callers know the Redux
mutation propagated before saving; locate the row Locator passed into
changeRowDatatype and wait on a selector like row.locator('.has-changes-icon')
(e.g., toBeVisible or toHaveCount(1)) or wait for the draft attribute/state
change on that row, and apply the same pattern to the other two fixed waits in
the spec (the waitForTimeout(50) and waitForTimeout(150)) so all three become
event-driven waits tied to the UI state.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bed82917-eebd-4976-bb9f-b203ac7a23e9

📥 Commits

Reviewing files that changed from the base of the PR and between e0de7d5 and cd35b5f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (131)
  • package.json
  • packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/StyledWrapper.js
  • packages/bruno-app/src/components/CollectionSettings/Vars/VarsTable/index.js
  • packages/bruno-app/src/components/DatatypeSelector/StyledWrapper.js
  • packages/bruno-app/src/components/DatatypeSelector/index.js
  • packages/bruno-app/src/components/EditableTable/index.js
  • packages/bruno-app/src/components/EnvironmentVariablesTable/index.js
  • packages/bruno-app/src/components/FolderSettings/Vars/VarsTable/StyledWrapper.js
  • packages/bruno-app/src/components/FolderSettings/Vars/VarsTable/index.js
  • packages/bruno-app/src/components/RequestPane/Vars/VarsTable/StyledWrapper.js
  • packages/bruno-app/src/components/RequestPane/Vars/VarsTable/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/actions.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/collections/index.spec.js
  • packages/bruno-app/src/providers/ReduxStore/slices/global-environments.js
  • packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
  • packages/bruno-app/src/utils/collections/export.js
  • packages/bruno-app/src/utils/collections/index.js
  • packages/bruno-app/src/utils/collections/index.spec.js
  • packages/bruno-app/src/utils/environments.js
  • packages/bruno-app/src/utils/environments.spec.js
  • packages/bruno-app/src/utils/tests/collections/datatype-export-import.spec.js
  • packages/bruno-common/src/utils/datatype.spec.ts
  • packages/bruno-common/src/utils/datatype.ts
  • packages/bruno-common/src/utils/index.ts
  • packages/bruno-converters/babel.config.js
  • packages/bruno-converters/jest.config.js
  • packages/bruno-converters/package.json
  • packages/bruno-converters/rollup.config.js
  • packages/bruno-converters/src/opencollection/common/datatype.ts
  • packages/bruno-converters/src/opencollection/common/variables.ts
  • packages/bruno-converters/src/opencollection/environment.ts
  • packages/bruno-converters/tests/opencollection/environment.spec.js
  • packages/bruno-converters/tests/opencollection/variables.spec.js
  • packages/bruno-converters/tsconfig.json
  • packages/bruno-electron/src/store/global-environments.js
  • packages/bruno-electron/src/utils/collection.js
  • packages/bruno-electron/tests/store/global-environments.test.js
  • packages/bruno-filestore/package.json
  • packages/bruno-filestore/rollup.config.js
  • packages/bruno-filestore/src/formats/yml/common/actions.ts
  • packages/bruno-filestore/src/formats/yml/common/datatype.spec.ts
  • packages/bruno-filestore/src/formats/yml/common/datatype.ts
  • packages/bruno-filestore/src/formats/yml/common/variables.spec.ts
  • packages/bruno-filestore/src/formats/yml/common/variables.ts
  • packages/bruno-filestore/src/formats/yml/parseCollection.spec.ts
  • packages/bruno-filestore/src/formats/yml/parseEnvironment.spec.ts
  • packages/bruno-filestore/src/formats/yml/parseEnvironment.ts
  • packages/bruno-filestore/src/formats/yml/parseFolder.spec.ts
  • packages/bruno-filestore/src/formats/yml/parseItem.spec.ts
  • packages/bruno-filestore/src/formats/yml/stringifyCollection.spec.ts
  • packages/bruno-filestore/src/formats/yml/stringifyEnvironment.spec.ts
  • packages/bruno-filestore/src/formats/yml/stringifyEnvironment.ts
  • packages/bruno-filestore/src/formats/yml/stringifyFolder.spec.ts
  • packages/bruno-filestore/src/formats/yml/stringifyItem.spec.ts
  • packages/bruno-filestore/tsconfig.build.json
  • packages/bruno-filestore/tsconfig.json
  • packages/bruno-js/src/bru.js
  • packages/bruno-js/tests/runtime.spec.js
  • packages/bruno-js/tests/setEnvVar.spec.js
  • packages/bruno-lang/package.json
  • packages/bruno-lang/v2/src/bruToJson.js
  • packages/bruno-lang/v2/src/collectionBruToJson.js
  • packages/bruno-lang/v2/src/envToJson.js
  • packages/bruno-lang/v2/src/jsonToBru.js
  • packages/bruno-lang/v2/src/jsonToCollectionBru.js
  • packages/bruno-lang/v2/src/jsonToEnv.js
  • packages/bruno-lang/v2/src/utils.js
  • packages/bruno-lang/v2/tests/bruToJson.spec.js
  • packages/bruno-lang/v2/tests/envToJson.spec.js
  • packages/bruno-lang/v2/tests/jsonToBru.spec.js
  • packages/bruno-lang/v2/tests/jsonToEnv.spec.js
  • packages/bruno-lang/v2/tests/utils.spec.js
  • packages/bruno-schema-types/src/collection/environment.ts
  • packages/bruno-schema-types/src/common/variables.ts
  • packages/bruno-schema/package.json
  • packages/bruno-schema/src/collections/index.js
  • packages/bruno-tests/collection/collection.bru
  • packages/bruno-tests/collection/environments/Local.bru
  • packages/bruno-tests/collection/environments/Prod.bru
  • packages/bruno-tests/collection/variable-datatypes/folder.bru
  • packages/bruno-tests/collection/variable-datatypes/form-urlencoded.bru
  • packages/bruno-tests/collection/variable-datatypes/multipart.bru
  • packages/bruno-tests/collection/variable-datatypes/typed vars.bru
  • packages/bruno-tests/yml-collection/environments/Local.yml
  • packages/bruno-tests/yml-collection/environments/Prod.yml
  • packages/bruno-tests/yml-collection/opencollection.yml
  • packages/bruno-tests/yml-collection/variable-datatypes/folder.yml
  • packages/bruno-tests/yml-collection/variable-datatypes/form-urlencoded.yml
  • packages/bruno-tests/yml-collection/variable-datatypes/multipart.yml
  • packages/bruno-tests/yml-collection/variable-datatypes/typed-vars.yml
  • playwright/index.ts
  • tests/environments/api-setEnvVar/api-setEnvVar-ephemeral-save.spec.ts
  • tests/environments/api-setEnvVar/api-setEnvVar-with-persist-typed.spec.ts
  • tests/environments/api-setEnvVar/api-setEnvVar-with-persist.spec.ts
  • tests/environments/api-setEnvVar/api-setEnvVar-without-persist.spec.ts
  • tests/environments/api-setEnvVar/fixtures/collection/api-setEnvVar-ephemeral-save.bru
  • tests/environments/api-setEnvVar/fixtures/collection/api-setEnvVar-with-persist-typed.bru
  • tests/environments/api-setEnvVar/fixtures/collection/environments/EphemeralSave.bru
  • tests/environments/api-setEnvVar/fixtures/collection/environments/Typed.bru
  • tests/environments/datatype-preservation/datatype-preservation.spec.ts
  • tests/environments/datatype-preservation/fixtures/bru/bruno.json
  • tests/environments/datatype-preservation/fixtures/bru/environments/typed_env.bru
  • tests/environments/datatype-preservation/fixtures/bru/test.bru
  • tests/environments/datatype-preservation/fixtures/yml/environments/typed_env.yml
  • tests/environments/datatype-preservation/fixtures/yml/opencollection.yml
  • tests/environments/datatype-preservation/fixtures/yml/test.yml
  • tests/environments/datatype-preservation/init-user-data/collection-security.json
  • tests/environments/datatype-preservation/init-user-data/preferences.json
  • tests/global-environments/collection/set-global-nonstring.bru
  • tests/global-environments/non-string-values.spec.ts
  • tests/variable-datatypes/create-via-ui.spec.ts
  • tests/variable-datatypes/fixtures/import/datatypes-collection.yml
  • tests/variable-datatypes/fixtures/workspace/collections/bru/bruno.json
  • tests/variable-datatypes/fixtures/workspace/collections/bru/collection.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/environments/test_env.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/folder.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/form_urlencoded.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/multipart.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/request.bru
  • tests/variable-datatypes/fixtures/workspace/collections/yml/environments/test_env.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/folder.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/form_urlencoded.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/multipart.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/request.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/opencollection.yml
  • tests/variable-datatypes/fixtures/workspace/environments/typed_global.yml
  • tests/variable-datatypes/fixtures/workspace/workspace.yml
  • tests/variable-datatypes/import.spec.ts
  • tests/variable-datatypes/init-user-data/preferences.json
  • tests/variable-datatypes/parsed-from-fixture.spec.ts
💤 Files with no reviewable changes (3)
  • tests/global-environments/collection/set-global-nonstring.bru
  • packages/bruno-js/src/bru.js
  • tests/global-environments/non-string-values.spec.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/bruno-tests/src/index.js`:
- Around line 90-101: The error handler mounted via app.use that returns an echo
for '/api/echo/everything' should only do so for body-parser parse failures;
update the conditional in that middleware to check the error is a malformed-body
error (e.g., err.type === 'entity.parse.failed' or err.status === 400) before
returning the JSON with method, url, query, headers, body (req.rawBody);
otherwise call next(err) to avoid masking other failures.

In `@tests/variable-datatypes/create-via-ui.spec.ts`:
- Around line 211-213: Replace the fixed sleep after calling
locators.environment.saveButton().click() with an explicit wait for the actual
post-save UI change: after invoking locators.environment.saveButton().click(),
wait for a specific locator to update (for example the saved environment row or
its type label) using an assertion or a locator wait (e.g., waitForSelector /
waitForFunction / expect(locator).toHaveText) instead of
page.waitForTimeout(500); target the environment row/label locator used
elsewhere in this spec (e.g., the saved row locator or type label locator) so
the test proceeds only once the UI reflects the save.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9486d455-ec1c-47d6-83f1-b06bd114ac22

📥 Commits

Reviewing files that changed from the base of the PR and between cd35b5f and dddd95f.

📒 Files selected for processing (36)
  • packages/bruno-app/src/components/DatatypeSelector/index.js
  • packages/bruno-app/src/utils/collections/export.js
  • packages/bruno-app/src/utils/environments.spec.js
  • packages/bruno-app/src/utils/tests/collections/datatype-export-import.spec.js
  • packages/bruno-converters/jest.config.js
  • packages/bruno-converters/src/opencollection/common/datatype.ts
  • packages/bruno-converters/src/opencollection/common/variables.ts
  • packages/bruno-converters/src/opencollection/environment.ts
  • packages/bruno-converters/tests/opencollection/environment.spec.js
  • packages/bruno-converters/tests/opencollection/variables.spec.js
  • packages/bruno-filestore/src/formats/yml/common/datatype.ts
  • packages/bruno-filestore/src/formats/yml/common/variables.spec.ts
  • packages/bruno-filestore/src/formats/yml/common/variables.ts
  • packages/bruno-filestore/src/formats/yml/stringifyEnvironment.spec.ts
  • packages/bruno-filestore/src/formats/yml/stringifyEnvironment.ts
  • packages/bruno-js/tests/runtime.spec.js
  • packages/bruno-js/tests/setEnvVar.spec.js
  • packages/bruno-lang/v2/src/jsonToBru.js
  • packages/bruno-lang/v2/src/jsonToCollectionBru.js
  • packages/bruno-lang/v2/src/utils.js
  • packages/bruno-tests/collection/variable-datatypes/typed vars.bru
  • packages/bruno-tests/src/index.js
  • packages/bruno-tests/yml-collection/variable-datatypes/typed-vars.yml
  • tests/environments/api-setEnvVar/api-setEnvVar-ephemeral-save.spec.ts
  • tests/utils/page/locators.ts
  • tests/variable-datatypes/create-via-ui.spec.ts
  • tests/variable-datatypes/fixtures/import/datatypes-collection.yml
  • tests/variable-datatypes/fixtures/workspace/collections/bru/collection.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/form_urlencoded.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/multipart.bru
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/request.bru
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/form_urlencoded.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/multipart.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/request.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/opencollection.yml
  • tests/variable-datatypes/parsed-from-fixture.spec.ts
💤 Files with no reviewable changes (1)
  • packages/bruno-js/tests/setEnvVar.spec.js
✅ Files skipped from review due to trivial changes (4)
  • tests/variable-datatypes/fixtures/workspace/collections/bru/folder/form_urlencoded.bru
  • packages/bruno-converters/jest.config.js
  • tests/variable-datatypes/fixtures/workspace/collections/yml/opencollection.yml
  • packages/bruno-converters/tests/opencollection/variables.spec.js
🚧 Files skipped from review as they are similar to previous changes (17)
  • tests/variable-datatypes/fixtures/workspace/collections/bru/collection.bru
  • tests/variable-datatypes/fixtures/import/datatypes-collection.yml
  • packages/bruno-filestore/src/formats/yml/stringifyEnvironment.spec.ts
  • packages/bruno-converters/tests/opencollection/environment.spec.js
  • packages/bruno-lang/v2/src/jsonToBru.js
  • packages/bruno-filestore/src/formats/yml/common/variables.spec.ts
  • packages/bruno-converters/src/opencollection/common/variables.ts
  • packages/bruno-js/tests/runtime.spec.js
  • packages/bruno-app/src/utils/collections/export.js
  • packages/bruno-filestore/src/formats/yml/common/datatype.ts
  • packages/bruno-converters/src/opencollection/environment.ts
  • packages/bruno-converters/src/opencollection/common/datatype.ts
  • packages/bruno-app/src/components/DatatypeSelector/index.js
  • packages/bruno-tests/yml-collection/variable-datatypes/typed-vars.yml
  • tests/variable-datatypes/fixtures/workspace/collections/yml/folder/request.yml
  • tests/environments/api-setEnvVar/api-setEnvVar-ephemeral-save.spec.ts
  • packages/bruno-lang/v2/src/utils.js

Comment thread packages/bruno-tests/src/index.js Resolved
@lohit-bruno
lohit-bruno force-pushed the variable_datatype_support branch from 73247c9 to 6f304e8 Compare June 5, 2026 13:24
@lohit-bruno
lohit-bruno force-pushed the variable_datatype_support branch from 5717735 to 819cbec Compare June 17, 2026 04:15
Comment thread tests/variable-datatypes/import.spec.ts Resolved
sid-bruno
sid-bruno previously approved these changes Jun 19, 2026
lohit-bruno and others added 13 commits June 19, 2026 19:23
Typed environment, collection, folder, and request variables
(string / number / boolean / object) with read-time parsing
across BRU, OpenCollection YML, and the legacy global env store.
Popup display and env/global/runtime scope lookups now keep 0, false, and ''.
Editor seeds objects via JSON.stringify so a blur can't dispatch '[object Object]'.
Adds hover-popup tests and broader fixture coverage; drops the global-environments
non-string spec, now subsumed by the variable-datatypes suite.
Pretty-print object variable values so .bru and .yml serialize consistently, centralize the v2 serializeVar helper, and stabilize the variable-datatypes Playwright suite under CI worker contention.
Temporary: isolates the variable-datatypes suite into a dedicated Playwright project with full traces + failure screenshots, and points the CI e2e step at it, to capture inspectable artifacts for the mac/windows failures. Revert after diagnosis.
Resolve the hovered variable from the pointer position instead of the token bounding-box center, whose midpoint falls between rows when a {{var}} reference wraps and resolved coordsChar to the wrong character.
Vars/env tables use react-virtuoso, so rows outside the scroll viewport aren't in the DOM and toHaveText can't mount them. Scroll the target row into view first; replaces the env-only scrollEnvTableToBottom helper, which targeted the wrong (non-scrolling) element.
Restores the e2e action, package script, and Playwright config to upstream/main now that the variable-datatypes failures are fixed and confirmed green in CI.
Secret environment variables now carry a dataType (number/boolean/object)
across collection and global environments in both bru and yml collections.
The value is stringified before encryption and parsed back on decrypt, so a
typed secret round-trips as its native JS type. Renames the variable
`datatype` prop and `Datatype` identifiers to `dataType`/`DataType`.
WORD_PATTERN's `$-/` was parsed as a character range (matching `( ) % & ' * + ,`),
so the word-extractor walked back across the `(` in `console.log(bru.get` and
captured the whole expression as one token, resolving to the wrong context.
Make `-` a literal so the token boundary stops at those characters.
EditableTable shared one react-virtuoso customScrollParent across the stacked
request var tables, so the layout jumped on scroll; each table now uses its own
content-sized scroller (mirroring the environment table). Also removes a spurious
scrollbar caused by the 1px-bordered scroller under border-box, and renders
object/array variable values pretty-printed via a new optional `indent` on
valueToString.
The per-table content-sized scroller mis-positioned rows in the stacked pre/post variable tables — rows rendered far off-screen. Revert to the shared scroll-parent model with fixed-height rows so the whole vars tab scrolls as one unit (matching main). Typed object values render single-line in the value cell.
Add a render-after-scroll test for the request/collection/folder variable tables. Re-scroll the headers windowing assertions inside a retry: under parallel load the one-shot scroll fired before the virtualised list finished sizing, so it stopped short of the target row.
A secret set via bru.setEnvVar infers its dataType like any var (expect @Number, not none). Add fixtures + assertions for variables declared without a dataType (numeric/boolean/object-looking values stay strings), and run the BRU and YML datatype suites from one parameterized factory so they can't drift.
lohit_user added 2 commits June 19, 2026 19:23
The component directory was committed as DatatypeSelector while every import
and the component itself use DataTypeSelector. macOS resolved it; Linux did
not, crashing the renderer before it signalled app-loaded and failing all
Playwright suites.
…ling

Add untyped variables (values that look typed but carry no annotation) to the
datatype-preservation fixtures and assert they round-trip as plain strings.

Share a scrollVirtuosoRowIntoView helper that targets the table-container
scroller and retries the scroll-to-top to beat virtuoso restoring a persisted
scroll position; use it from the datatype-preservation and parsed-from-fixture
specs in place of their duplicated local helpers.
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.

3 participants