Skip to content

fix: redact duration propertly#9225

Merged
ematipico merged 1 commit intomainfrom
fix/json-reporter-stdout
Feb 24, 2026
Merged

fix: redact duration propertly#9225
ematipico merged 1 commit intomainfrom
fix/json-reporter-stdout

Conversation

@ematipico
Copy link
Member

Summary

Small bug fix for the CI. This won't affect production so it doesn't need a changeset

Test Plan

CI must stay the same

Docs

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

⚠️ No Changeset found

Latest commit: 2221da7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the A-CLI Area: CLI label Feb 24, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea6caeb and 2221da7.

📒 Files selected for processing (2)
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/snap_test.rs
🚧 Files skipped from review as they are similar to previous changes (2)
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/snap_test.rs

Walkthrough

The PR unifies JSON reporter behaviour by always serialising duration and scannerDuration as numeric nanoseconds (using .as_nanos()), removing debug-only placeholder string logic and related cfg blocks. Imports were adjusted to drop the now-unused JSON string factory. Snapshot tests were updated to redact duration and scannerDuration fields by replacing their values with "<TIME>" for deterministic comparisons.

Possibly related PRs

  • fix(cli): json reporter #9221 — originally added duration and scannerDuration JSON fields with debug-conditional formatting; this change standardises their serialisation to numeric nanoseconds.

Suggested labels

A-Diagnostic

Suggested reviewers

  • Netail
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: redact duration propertly' directly describes the main change: fixing duration redaction in snapshots, though it contains a typo ('propertly' instead of 'properly').
Description check ✅ Passed The description relates to the changeset by identifying it as a CI-related bug fix, matching the snapshot redaction changes for duration fields.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/json-reporter-stdout

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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@crates/biome_cli/src/reporter/mod.rs`:
- Around line 58-60: The code serializes self.duration as nanoseconds (creating
duration_value via
AnyJsonValue::JsonNumberValue(json_number_value(json_number_literal(self.duration.as_nanos()))))
while scannerDuration is serialized using as_millis(), mixing units; update the
serialization for duration_value to use the same unit as scannerDuration (e.g.,
use self.duration.as_millis() or convert scannerDuration to nanos) so both use
consistent units, and ensure the json_number_literal call and AnyJsonValue
construction (the duration_value creation) reflect that chosen unit and naming
so the payload contract is consistent.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9da81 and ea6caeb.

📒 Files selected for processing (2)
  • crates/biome_cli/src/reporter/mod.rs
  • crates/biome_cli/tests/snap_test.rs

@ematipico ematipico force-pushed the fix/json-reporter-stdout branch from ea6caeb to 2221da7 Compare February 24, 2026 13:17
@ematipico ematipico merged commit edb536a into main Feb 24, 2026
12 checks passed
@ematipico ematipico deleted the fix/json-reporter-stdout branch February 24, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants