Commit Graph

4425 Commits

Author SHA1 Message Date
sanish chirayath
49b9af1046 feat(converters): re-enable variable scripting translations (#8388)
* feat(translations): restore commented-out collection and global variable methods

- Reintroduced translations for `setCollectionVar`, `deleteCollectionVar`, `deleteAllCollectionVars`, and their global counterparts in the Postman to Bruno and Bruno to Postman translators.
- Updated tests to validate the translations for these methods, ensuring accurate functionality and consistency across variable management.
- Removed outdated comments regarding UI updates, reflecting the current state of the implementation.

* feat(tests): add translations for bru.getAllGlobalEnvVars and pm.globals.toObject

- Introduced new test cases to validate the translation of `bru.getAllGlobalEnvVars` to `pm.globals.toObject` and vice versa.
- Enhanced the test suite for both Bruno to Postman and Postman to Bruno translations, ensuring comprehensive coverage for variable management methods.
2026-06-30 00:22:56 +05:30
Sid
f6f76423bc ci: use env vars instead of hard coded paths (#8389) 2026-06-29 17:05:31 +05:30
Sid
1c9355e49e feat(electron): add pkg configuration for installation location and relocatability (#8403) 2026-06-29 13:35:11 +05:30
sanish chirayath
87f74262bb feat(variables): persist scripted variable changes by default + re-enable disabled scripting APIs (#8315)
* feat(variables): add variable persistence with scripting

feat(collections): implement script-driven update for collection variables, ensuring direct root modification and draft synchronization

feat(collections): enhance script variable management with baseline tracking and draft preservation

* feat(variables): add runtime variable updates and optimize disk writes by implementing dirty flags

fix(collections): handle errors during environment persistence in script execution

feat(collections): implement baseline clearing for script execution and optimize variable update handling

feat(tests): add default persistence tests for environment variables and update runtime variable handling

refactor(collections): streamline variable update handling and improve draft management by removing redundant comments and optimizing code clarity

test(collection-vars): add verification for draft edits and script variable visibility in collection settings UI

refactor(collection-vars): update header value selection logic for improved clarity and accuracy in draft isolation tests

* feat(global-environments): enhance global environment updates to resolve stale active UIDs and improve persistence logic

- Updated the `updateGlobalEnvironments` reducer to handle stale active UIDs by matching against environment names.
- Improved the logic for setting global environments and active UIDs to ensure consistency after disk reloads.
- Removed outdated tests related to persisted values in favor of more relevant assertions for environment variable handling.

* feat(variables): enhance typed value handling and persistence in global and collection environments

- Added tests to infer data types (number, boolean, object) when setting environment and collection variables.
- Updated the logic to preserve existing data types when variables are not modified by scripts.
- Implemented dirty flags to track changes in typed variables, ensuring accurate persistence across sessions.
- Refactored related tests to verify the correct behavior of typed variables in various scenarios.

* refactor(variables): streamline data type inference and enhance deletion methods

- Removed redundant data type inference logic from global and collection variable updates to simplify the codebase.
- Updated deletion methods in the Bru class to use Object.keys for improved resilience against user-defined properties.
- Added tests to ensure deletion methods function correctly even when properties are shadowed.
- Enhanced clarity in draft merge tests by standardizing keyboard shortcuts for selecting all text.

* fix(tests): correct variable naming and improve environment panel interactions

- Updated test cases to reflect the correct variable name 'wasSaved' instead of 'was-saved'.
- Modified environment panel interaction to remove forced click, enhancing test reliability.
- Added a utility function to close the environment panel in safe mode tests for better readability and maintainability.

* feat(runtime): enhance variable management and cleanup logic

- Introduced a new method to clear script-driven variable baselines for collections, ensuring no stale data leaks into new requests.
- Updated the handling of runtime variables in the Bru class to track changes with a new dirty flag, improving state management.
- Refactored the application of script environment variables to prevent direct mutations, ensuring immutability and cleaner state updates.
- Enhanced the response handling in the script runtime to conditionally include runtime variables based on their dirty state.

* feat(variables): improve request handling and state management for collections and environments

- Enhanced event listeners to clear global environment baselines on both 'testrun-started' and 'request-queued' events, preventing stale data issues.
- Updated global environment and collection variable update events to ignore stale updates from superseded requests, ensuring accurate state management.
- Refactored the Bru class to optimize variable management, including checks for existing keys before updates and deletions, improving performance and reliability.
- Introduced request UID tracking to maintain consistency across variable updates during concurrent requests.

* refactor(collections): update action to clear script variable baselines

- Replaced the dispatch of `_clearScriptGlobalEnvBaseline` with `clearScriptVariableBaselines` to improve clarity and maintainability in the Redux action handling for collections.

* feat(environments): introduce getScriptModifiedKeys utility for improved variable management

- Added a new utility function, `getScriptModifiedKeys`, to identify keys modified by scripts relative to a baseline, enhancing the handling of data types during variable updates.
- Updated the application of script environment variables to prevent overwriting user-defined draft changes during no-op writes.
- Refactored related logic in collections and global environments to utilize the new utility, ensuring accurate state management and improved clarity in the Redux slices.

* refactor(global-environments): simplify active UID resolution logic in updateGlobalEnvironments reducer

- Streamlined the logic for resolving the active global environment UID by consolidating conditions into a more concise format.
- Removed outdated comments to enhance code clarity and maintainability.
- Updated tests to ensure accurate resolution of active UIDs based on incoming environment data.

* refactor(tests): remove outdated comments and streamline environment variable row expectations

- Eliminated comments related to state sync and inference issues to enhance code clarity.
- Adjusted expectations for environment variable row rendering in tests, focusing on relevant assertions.

* feat(tests): add comprehensive tests for secret variable persistence in environments

- Introduced new test cases to validate the preservation of secret variables when updated via scripts in both collection and global environments.
- Implemented tests to ensure that secret values are encrypted before storage and can be correctly decrypted for subsequent requests.
- Added fixtures and environment configurations for testing secret variable behavior in both bru and yml formats.
- Enhanced utility functions for managing environment configurations and interactions within the test suite.

* feat(tests): enhance environment variable tests and add global variable persistence

- Updated MultiLineEditor and SingleLineEditor components to include data-testid for secret reveal toggle buttons, improving testability.
- Introduced new tests for global environment variable persistence, ensuring non-secret variables survive app restarts and are correctly interpolated.
- Added fixtures for workspace and collections to support the new global variable tests, enhancing the overall test coverage for environment management.
- Refactored utility functions to streamline interactions with environment variables in tests.

* refactor(collections): optimize environment and collection saving logic

- Simplified the persistence logic for active environments by directly constructing the environment copy, reducing unnecessary cloning.
- Updated the collection saving process to utilize the fresh collection state, ensuring accurate data is saved without drafts.
- Enhanced error handling during the save operations to improve reliability and maintainability.

* feat(tests): implement collection variable persistence tests

- Added multiple test cases to validate the persistence of collection variables across app restarts, including typed values and multiple variable settings.
- Created new fixtures for collection variables to support the tests, ensuring accurate simulation of variable management scenarios.
- Enhanced the existing collection management logic to ensure that variables are correctly set and deleted as per the test requirements.

* feat(tests): add tests for typed global environment variable persistence

- Introduced a new test suite to validate the persistence of typed global environment variables across app restarts, ensuring correct data types are maintained.
- Created a fixture for the test collection to simulate setting global variables with various data types, including number, boolean, object, and string.
- Enhanced the test logic to verify that the environment file reflects the correct state before and after application restarts.

* fix(tests): update request tab close interaction in variable persistence tests

* fix(tests): improve hover interaction for collection actions in runner tests

- Updated the hover logic for revealing collection actions to handle sidebar re-renders more reliably.
- Replaced one-shot hover with a polling mechanism to ensure visibility of actions, enhancing test stability.

* refactor(environments): streamline environment variable handling and remove ephemeral metadata logic

- Simplified the comparison logic for environment variables by removing unnecessary ephemeral metadata handling.
- Updated the saving process to directly use the environment variables without stripping metadata, enhancing clarity and maintainability.
- Removed outdated comments and unused utility functions related to ephemeral variables, improving code cleanliness.

* fix(ipc): update persistActiveEnvironment to handle requestUid for stale updates

- Modified the persistActiveEnvironment function to accept a requestUid parameter, allowing for better management of stale updates.
- Enhanced the logic to prevent disk writes for superseded requests, improving data integrity during environment persistence.

* refactor(bru): remove unused envName variable in deleteAllEnvVars method

- Eliminated the envName variable from the deleteAllEnvVars method, simplifying the logic for deleting environment variables.
- Cleaned up the method by removing unnecessary checks related to the envName, enhancing code clarity and maintainability.

* fix(bru): prevent deletion of internal __name__ variable in deleteEnvVar method

- Added a check in the deleteEnvVar method to silently ignore attempts to delete the internal __name__ variable, preserving its integrity.
- Updated tests to verify that the __name__ variable remains unchanged when deleteEnvVar is called with this key.
- Enhanced runtime tests to ensure compatibility with QuickJS by confirming that environment variables set with persist options are handled correctly.

* feat(tests): add legacy support test for environment variable persistence

- Introduced a new test suite to validate that the legacy argument for setting environment variables with persistence is still functional in version 4.
- Created a fixture to simulate the legacy syntax, ensuring that the variable is correctly persisted on disk without errors.
- Enhanced integration testing to confirm that the legacy behavior aligns with the current implementation, maintaining backward compatibility.

* test(tests): enhance legacy environment variable persistence tests for safe and developer modes

- Updated the test suite for `bru.setEnvVar` to verify that the legacy persist flag is correctly handled in both safe and developer modes.
- Introduced a helper function to streamline the verification process and ensure consistent behavior across different execution contexts.
- Adjusted the test logic to reset the environment state between mode switches, maintaining test integrity.
- Improved hover interaction in multiple persistent variable tests to ensure reliable visibility of actions during execution.

* fix(EnvironmentVariablesTable): correct change detection logic for environment variables

- Updated the logic for determining changes in environment variables to compare active current and saved values instead of previously used variablesToSave and savedValues.
- This change ensures accurate detection of modifications before saving, improving user feedback when no changes are present.

* test(tests): enhance secret variable persistence tests for environment configurations

- Updated the test suites for `bru.setEnvVar` and `bru.setGlobalEnvVar` to include interactions with the secrets tab, ensuring visibility of secret variables during various states of the environment.
- Added checks to confirm that the eye toggle functionality correctly reveals the values of secret variables after setting and overwriting them.
- Improved test coverage for secret variable persistence, validating that the expected values are displayed in both collection and global environment contexts.
2026-06-26 23:01:37 +05:30
naman-bruno
30b4512983 feat(ai): mode toggle UI and add AI support for folder & collection (#8385) 2026-06-26 18:41:21 +05:30
mohit-bruno
33e8f5ca4a test: workspace import and validation testcase (TC-969) (#8349)
* test cases for workspace import and validation TC-969, jira: https://usebruno.atlassian.net/browse/BRU-3575

* incorporated comments, moved findWorkspaceDirByName function to helpers.ts, fixed all the comments

* modified as per comment provided , removed css locators , used playwright inbuilt methods , handled timeout

* Created file structure as per comment provided, added tc-id , resolved code-rabbit review

* incorporated comments removed commented line, removed timeouts, modified package.json added package in dev dependencies

* changed const l to locators for better readbility

* - Reorganized test helpers: split title-bar locators into title-bar.ts and
  import-workspace flow into workspace/import-workspace.ts for reuse
- Replaced brittle .bruno-modal-card/CSS locators with stable role/testid/label
  based locators
- Added a data-testid for the Import Workspace modal and removed the redundant one
- Cleaned up unnecessary comments
- Updated package-lock.json

* minor changes

* minor changes

* addressed comments

* addressed comments for variable naming

* minor changes
2026-06-26 16:57:02 +05:30
Sid
0a3ee95310 chore: update to latest stable lodash version (#8350) 2026-06-26 16:52:11 +05:30
sanish chirayath
7756564201 fix(workspace-watcher): update IPC channel names for environment file events to match renderer expectations and add regression tests (#8370) 2026-06-26 15:16:49 +05:30
Pooja
d6e17e1dab feat(environments): split variables and secrets into separate tabs (#8191) 2026-06-26 12:21:58 +05:30
naman-bruno
1ceea0797e feat(ai): add AI chat sidebar with code block and diff view components (#8358) 2026-06-25 18:21:56 +05:30
naman-bruno
d8d2fec166 refactor(migration): extract migration modal (#8359) 2026-06-25 16:53:31 +05:30
naman-bruno
437e0c7dac feat(ai): OpenAI-compatible endpoints support (#8365) 2026-06-25 16:15:22 +05:30
sanish chirayath
7765320aa5 feat(woof): add WOOF easter egg (#8301)
* feat(woof): add WOOF easter egg

* refactor(woof): extract WOOF response logic into a separate utility function

* refactor: rename the response function
2026-06-24 16:46:18 +05:30
ravindra-bruno
42e9c9a309 fix(ai): validate provider keys via /v1/models instead of a generatio… (#8340) 2026-06-24 13:52:44 +05:30
naman-bruno
84c53b65c2 feat(app): introduce standalone app functionality (#8338) 2026-06-24 13:21:05 +05:30
Sid
cbc812b131 chore: change app builder to bruno team (#8218) 2026-06-24 13:11:44 +05:30
Sid
577730609c ci: group the runner to PR (#8343) 2026-06-23 20:47:40 +05:30
sachin-thakur-bruno
7adbc6b14e feat(network-columns-resize)/added resizable columns in network panel (#8265) 2026-06-23 19:17:18 +05:30
adwait-bruno
800ab6fea0 fix(openapi): copy cURL icon now respects the theme variables (#8314)
Co-authored-by: Adwait Aayush <adwaitaayush@Adwaits-MacBook-Air.local>
2026-06-23 18:06:37 +05:30
naman-bruno
3f69977176 feat: integrate Markdown into NotificationDetail (#8335) 2026-06-23 15:24:04 +05:30
naman-bruno
bf0e9bcf23 feat(ai): implement AI autocomplete (#8300) 2026-06-23 13:09:17 +05:30
Sid
27c1970076 feat: add cli offline bundle script (#8192) 2026-06-23 12:08:15 +05:30
DeviSriSaiCharan
5f55a5924d fix: prevent redundant workspace switch toast (#8229)
* fix: prevent redundant workspace switch toast
- Added an early return check in the switchWorkspace Redux action.
- Prevents unnecessary state hydration and toast notifications when a user clicks on the already active workspace.

* fix: return boolean status from switchWorkspace action to handle success and error states correctly

* revert: changes made for the switchWorkspace to check if user switchedto the already active workspace

* refactor: prevent unnecessary workspace switches and success notification logic

* Remove async from handleWorkspaceSwitch function
2026-06-22 23:27:03 +05:30
Sid
222ac80f5e fix(devtools): network tab panel inner scroll (#8329)
* fix: ui overflow for the network tab

* test(e2e): scroller behaviour for network tab
2026-06-22 19:32:29 +05:30
shubh-bruno
46498e8423 fix(tests): flaky bound action e2e tests (#8071) 2026-06-22 18:55:05 +05:30
naman-bruno
d2de2d590e feat(app): add request level app (#8294) 2026-06-22 17:30:32 +05:30
Chirag Chandrashekhar
683d487181 feat: faster collection mount via file cache (Beta) (#8222) 2026-06-22 15:03:21 +05:30
naman-bruno
d1ebf578b2 feat: implement collection migration to YML format (#7669) 2026-06-22 15:01:43 +05:30
YONGJAE LEE (이용재)
21efded2bf Await the websocket visibility assertion so it actually runs (#8317)
The 'websocket requests are visible' test calls
expect(page.locator(...)).toBeVisible() without awaiting it. A Playwright
web-first matcher returns a Promise that polls and retries until the
element matches or the timeout elapses. When the expect is not awaited the
Promise is created and immediately discarded, so the assertion never runs
and the test passes whether or not the request is visible in the sidebar.

This is the sole assertion in that test, so the test gave no real coverage.
The six other expect calls in the same file are already awaited, so this
brings the line in line with the file's own idiom.

Signed-off-by: YONGJAE LEE <dev.yongjaelee@gmail.com>
2026-06-22 12:14:22 +05:30
Utkarsh
fd30eaeccf feat(ai-assist): add docs generation with folder and collection context (#8246) 2026-06-22 11:38:28 +05:30
Sid
ccf62641dd Update CODEOWNERS (#8324)
* Update CODEOWNERS
2026-06-22 11:20:49 +05:30
Bijin A B
099cdaf232 test(preferences): set default preferences values to be overriden by tests with custom preferences (#8321) 2026-06-21 15:07:12 +05:30
Bijin A B
34a61ebe28 fix(playwright): fix flaky tests (#8319) 2026-06-20 19:15:32 +05:30
Bijin A B
a93e1dc8bf test: fix test and update default retry in local to 0 (#8316) 2026-06-20 02:17:14 +05:30
sachin-bruno
4fffef51ba Feature(size/L): BRU-2542 Choose environments to include and show versions in the Generate Documentation modal (#8268)
* BRU-1128 bug fix OpenAPI import error message

* Feat:BRU-2542 Choose environments to include and show UI

* Feat:BRU-2542 Added virtualization for env lists

* Feat:BRU-2542 Reverted IPCError modal changes

* BRU-2542 removed wait mount from playwrite script

* BRU-2542 Added select all checkbox

* BRU-2542 Added portals for generate doc modal and fixed overlapping issue

* BRU-2542 Comments addressed

---------

Co-authored-by: bruno-sachin <bruno-sachin@brunos-MacBook-Air.local>
2026-06-20 01:30:16 +05:30
Bijin A B
6136d3ac62 tests: run playwright e2e fully parallel (#8313) 2026-06-19 19:40:24 +05:30
lohit
942f995717 feat: variable data types support (#8046) 2026-06-19 19:36:59 +05:30
naman-bruno
82ee8e1331 add: change log tab (#8289) 2026-06-19 15:10:20 +05:30
prateek-bruno
6711ccdda2 feat: redesign notification modal (#8140)
* fix: test expect

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: maintain state for read and cleared notification ids

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* feat: revamp Notifications

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: break things into components and use events

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: icon + more padding

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* chore: use classnames

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* chore: remove redundancy

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* chore: make it pixel accurate

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: remove redundant useMemo

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: colors of notification modal

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: use color paletter + fix badge color

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: ensure semantics for notification icon

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: handle keyboard navigation for drawer items

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: colors, no notification view, etc

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: don't crash on color of badge that is invalid

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix: use hex color for type of notification
Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

* fix

* Apply suggestions from code review

Co-authored-by: Sid <siddharth@usebruno.com>

* fix: use parseToRgb instead of custom isHexColor check + add unit tests

Co-authored-by: Prateek Sunal
<41370460+prateekmedia@users.noreply.github.com>

* fix: pointer events getting swallowed by iframe, causing resize issue

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>

---------

Co-authored-by: Prateek Sunal <41370460+prateekmedia@users.noreply.github.com>
Co-authored-by: naman-bruno <naman@usebruno.com>
Co-authored-by: Sid <siddharth@usebruno.com>
2026-06-18 21:28:47 +05:30
Pooja
a7efed674e feat(websocket): show full message name in a tooltip on hover (#8299) 2026-06-18 19:41:58 +05:30
Chirag Chandrashekhar
5345cb7b5f fix(transient): scope bruno- lookup to transient base, not full path (#8273) 2026-06-18 17:35:27 +05:30
prateek-bruno
36e59e992c fix: correctly parse insomnia exported yaml (#7966) 2026-06-18 14:07:00 +05:30
sachin-bruno
fab18d9e3e Feature (Size/M) : BRU-3560 Remove Beta badge from openAPI sync (#8250)
* BRU-3560 Remove Beta badge from openAPI sync

* BRU-3560 Comments fixed

* BRU-3560 Comments resolved

* BRU-3560 Comments resolved

* BRU-3560 Comments resolved

---------

Co-authored-by: bruno-sachin <bruno-sachin@brunos-MacBook-Air.local>
2026-06-17 19:24:26 +05:30
ravindra-bruno
7b94e069e9 feat(import): hide File Format option and default collections to Open… (#8247) 2026-06-17 16:56:33 +05:30
naman-bruno
ba063f6d82 feat: implement file mode (#8258)
* feat: implement file mode
2026-06-17 16:34:18 +05:30
Utkarsh
c857d27415 fix(postman-migration): install packages report npm install failed (#8284) 2026-06-17 14:17:10 +05:30
Abhishek Patil
3c576487c9 fix(perf):quickjs-memory-leak (#8219) 2026-06-17 13:46:14 +05:30
rajashreehj-bruno
277845b6d8 Fix (import): Postman import: OAuth2 tokenPlacement not set correctly, Header Prefix field hidden and value lost (#8197)
* Fix (oauth2): Postman import: OAuth2 tokenPlacement not set correctly, Header Prefix field hidden and value lost

* Add assert to persistes values

* id name change

* replace hardcoded timeout

* grant type fix

* missing keys in process auth

* process auth
2026-06-17 11:00:52 +05:30
vijayh-bruno
1907b2b3f0 add vijay to CODEOWNERS (#8278)
Co-authored-by: Vijay H <vijayh@usebruno.com>
2026-06-16 22:52:23 +05:30
Sundram
05ab2661fa feat(openapi-sync): preserve user-configured request values on sync (#8204)
Reconcile request structure against the spec on sync while preserving the
user's values (JSON body, params, headers, auth) and {{var}} references for
fields that still exist. A "Preserve values" toggle (default on) on the Spec
Updates review controls it; turning it off lets spec values overwrite. The diff
preview's EXPECTED column shows the post-merge result so unchanged values do not
render as changes.

- field-level merge for JSON body (by key path), form fields and params/headers
  (by name, duplicate names paired positionally), preserving value + enabled
- {{var}} masking so interpolated bodies parse, merge and restore safely,
  using a private-use sentinel that never collides with body text
- auth merged by mode: same mode keeps the user's values and adds spec-introduced
  fields; a mode change takes the spec. compareRequestFields compares auth by
  mode only, so preserved auth values no longer mark the collection out of sync
- preserveValues threaded through apply and diff-preview IPC handlers
- reset path left unchanged; scripts/tests/assertions preserved in sync and reset
- 67 unit tests covering the merge helpers and masking edge cases
2026-06-16 20:01:52 +05:30