Skip to content

fix: timestamp tooltip message#6688

Merged
sid-bruno merged 2 commits intousebruno:mainfrom
pooja-bruno:fix/timestamp-tooltip-message
Jan 14, 2026
Merged

fix: timestamp tooltip message#6688
sid-bruno merged 2 commits intousebruno:mainfrom
pooja-bruno:fix/timestamp-tooltip-message

Conversation

@pooja-bruno
Copy link
Collaborator

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

Description

JIRA

Fixed misleading tooltip message for $timestamp and $isoTimestamp dynamic variables

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.
image

Summary by CodeRabbit

  • New Features

    • Support for time-based dynamic variables that generate current timestamps on each request.
    • Enhanced dynamic variable messaging and tooltips to distinguish time-based timestamp generators from random-value generators.
  • Tests

    • Added test coverage for time-based dynamic variables ($timestamp, $isoTimestamp) and for random dynamic variables.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

Walkthrough

Adds time-based dynamic variable support by exporting a timeBasedDynamicVars set and updating codemirror variable-info logic to mark dynamic variables as time-based, adjusting validation and read-only messaging; tests extended to cover timestamp and non-time dynamic cases.

Changes

Cohort / File(s) Summary
Core Dynamic Variable Definition
packages/bruno-common/src/utils/faker-functions.ts
Adds exported timeBasedDynamicVars Set with 'timestamp' and 'isoTimestamp'.
Bruno Common Exports
packages/bruno-common/src/index.ts
Re-exports timeBasedDynamicVars alongside existing mockDataFunctions.
Dynamic Variable UI Logic
packages/bruno-app/src/utils/codemirror/brunoVarInfo.js
Imports timeBasedDynamicVars; computes isTimeBased for $-prefixed dynamic vars, replaces isValidFakerVariable with isValidDynamicVariable, extends scopeInfo with isTimeBased, and updates read-only/readable messaging and validation/warning logic to distinguish timestamp vs random generators.
Test Coverage
packages/bruno-app/src/utils/codemirror/brunoVarInfo.spec.js
Extends mocks with timestamp/isoTimestamp and timeBasedDynamicVars; adds tests verifying “Dynamic” scope and timestamp-specific read-only note for time-based vars and random-value note for non-time dynamic vars.

Sequence Diagram(s)

(Skipped — changes are localized UI/validation logic and tests, not a multi-component sequential flow requiring visualization.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

size/S

Suggested reviewers

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

Poem

⏰ Tiny vars that mark the hour,
Some bring timestamps, some random power,
Code now knows which tick to chime,
Tests confirm the right-time rhyme ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: timestamp tooltip message' directly corresponds to the PR's main objective of fixing a misleading tooltip message for timestamp dynamic variables.
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.
✨ Finishing touches
  • 📝 Generate docstrings

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.

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

🧹 Nitpick comments (1)
packages/bruno-common/src/utils/faker-functions.ts (1)

3-3: LGTM! Consider adding a clarifying comment.

The timeBasedDynamicVars Set correctly identifies timestamp and isoTimestamp as the variables that return the current time and thus change on every evaluation. The distinction from other date-generating functions (like randomDateFuture, randomDatePast) is valid since those return faker-generated random dates rather than the current time.

Optional: Add JSDoc comment for clarity

Consider adding a brief comment to explain the distinction for future maintainers:

+/**
+ * Dynamic variables that return the current time and change on every evaluation.
+ * Other date functions (randomDateFuture, randomDatePast, etc.) return static faker-generated values.
+ */
 export const timeBasedDynamicVars = new Set(['timestamp', 'isoTimestamp']);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 17fc8c2 and cfaf6fe.

📒 Files selected for processing (1)
  • packages/bruno-common/src/utils/faker-functions.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (CODING_STANDARDS.md)

**/*.{js,jsx,ts,tsx}: Use 2 spaces for indentation. No tabs, just spaces
Stick to single quotes for strings. For JSX/TSX attributes, use double quotes (e.g., )
Always add semicolons at the end of statements
No trailing commas
Always use parentheses around parameters in arrow functions, even for single params
For multiline constructs, put opening braces on the same line, and ensure consistency. Minimum 2 elements for multiline
No newlines inside function parentheses
Space before and after the arrow in arrow functions. () => {} is good
No space between function name and parentheses. func() not func ()
Semicolons go at the end of the line, not on a new line
Names for functions need to be concise and descriptive
Add in JSDoc comments to add more details to the abstractions if needed
Add in meaningful comments instead of obvious ones where complex code flow is explained properly

Files:

  • packages/bruno-common/src/utils/faker-functions.ts
🧬 Code graph analysis (1)
packages/bruno-common/src/utils/faker-functions.ts (1)
packages/bruno-common/src/index.ts (1)
  • timeBasedDynamicVars (1-1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: SSL Tests - Windows
  • GitHub Check: SSL Tests - Linux
  • GitHub Check: SSL Tests - macOS
  • GitHub Check: Playwright E2E Tests
  • GitHub Check: Unit Tests
  • GitHub Check: CLI Tests

@sid-bruno sid-bruno merged commit 707ed63 into usebruno:main Jan 14, 2026
8 checks passed
FraCata00 pushed a commit to FraCata00/bruno that referenced this pull request Feb 9, 2026
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