Skip to content

fix(studio): Consolidate all console statements in Studio#308

Open
steramae-nvidia wants to merge 8 commits into
mainfrom
steramae/logger-consolidation
Open

fix(studio): Consolidate all console statements in Studio#308
steramae-nvidia wants to merge 8 commits into
mainfrom
steramae/logger-consolidation

Conversation

@steramae-nvidia

@steramae-nvidia steramae-nvidia commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

We wrap the console to ensure that anything logged to console is also passed to the optional telemetry service. There are still some exceptions but nearly all statements should now be wrapped.

Summary by CodeRabbit

  • Chores

    • Standardized logging across the Studio UI by replacing console.* calls with the site logger to improve structured error/warn reporting without changing user-facing behavior.
    • Enforced no-console linting for the Studio package with scoped exceptions for CLI and mock files.
    • Enhanced the site logger to emit richer diagnostics and normalize error values for more consistent troubleshooting.
  • Tests

    • Updated unit tests to align with the new logging signatures and behaviors.

Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
@steramae-nvidia steramae-nvidia requested review from a team as code owners June 12, 2026 17:38
@github-actions github-actions Bot added the fix label Jun 12, 2026
Signed-off-by: Sean Teramae <steramae@nvidia.com>
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 19033/25227 75.4% 61.4%
Integration Tests 11027/23999 46.0% 20.4%

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 369d6ca4-fa5c-4710-b263-c45ad9e1202b

📥 Commits

Reviewing files that changed from the base of the PR and between 57ecb1a and ae615e2.

📒 Files selected for processing (1)
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.test.tsx

📝 Walkthrough

Walkthrough

Replaces direct console.* calls with structured websiteLogger usage across the studio package, adds/ensures no-console linting for studio, and introduces toError plus logger signature changes for structured OTEL attributes.

Changes

Logging Infrastructure Consolidation

Layer / File(s) Summary
ESLint configuration and exceptions
web/eslint.config.js, web/packages/studio/src/mocks/node.ts, web/packages/studio/scripts/fetch-styles.ts, web/packages/studio/e2e-tests/pages/project-datasets.ts
Add no-console: error for packages/studio/**; exempt MSW mock, CLI script, and an E2E catch-site via inline ESLint disables.
API hooks & bulk ops
web/packages/studio/src/api/datasets/useDatasetFileContent.ts, web/packages/studio/src/components/filesets/hooks/useBulkDownload.ts, web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts, web/packages/studio/src/workers/LargeFileWorker.ts
Switch parquet/download/parse and bulk-download/duplicate error handlers to websiteLogger; normalize worker error messages using toError.
Dataset input & dropzone
web/packages/studio/src/components/DatasetInputFile/index.tsx, web/packages/studio/src/components/filesets/FilesetFileExplorer/DatasetFileDropzone/index.tsx
Use websiteLogger for missing-metadata, validation, accept/reject, and drop error logging.
Action menus, deletion flows & folder modal
web/packages/studio/src/components/FilesetActionMenu/index.tsx, web/packages/studio/src/routes/FilesetListRoute/ActionMenu/index.tsx, web/packages/studio/src/routes/FilesetListRoute/DatasetBulkDeleteModal/index.tsx, web/packages/studio/src/components/filesets/AddToFolderModal/index.tsx, web/packages/studio/src/components/filesets/FilesetFileExplorer/BulkDeleteModal/index.tsx
Replace console logs in delete-failure and navigation-warning paths with websiteLogger.
Evaluation job UI & file validation
web/packages/studio/src/components/evaluation/Jobs/ActionMenu.tsx, web/packages/studio/src/components/evaluation/Jobs/DetailsPanel.tsx, web/packages/studio/src/components/evaluation/Jobs/EvaluationJobBulkDeleteModal.tsx, web/packages/studio/src/components/evaluation/Configurations/form/InputFile.tsx
Log job deletion/cancellation/bulk-delete and file-validation errors via websiteLogger.
Dataset bulk-delete modal flows
web/packages/studio/src/routes/FilesetListRoute/DatasetBulkDeleteModal/index.tsx
Use websiteLogger in dataset bulk-delete failure paths.
Routes, synthesizer & ClaudeCode parsing
web/packages/studio/src/routes/DeploymentsListRoute/useDeleteDeploymentAndConfig.ts, web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx, web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/stream.ts
Switch deployment deletion, synthesizer job/form error, and ClaudeCode JSON parse failure logging to websiteLogger/toError.
Inference, workspace & deployment logs
web/packages/studio/src/components/ModelComparePrompts/index.tsx, web/packages/studio/src/components/WorkspaceDropdown/index.tsx, web/packages/studio/src/components/sidePanels/AgentPanels/AgentPanel/DeploymentLogsView.tsx
Replace console logging in inference failures, workspace-selection validation, and SSE log-stream interruption warnings with websiteLogger.
Utilities: parsing, LLM & strings
web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.ts, web/packages/studio/src/routes/agents/AgentSuggestionsRoute/api.ts, web/packages/studio/src/routes/agents/AgentSuggestionsRoute/useOptimizerSuggestions.ts, web/packages/studio/src/util/files.ts, web/packages/studio/src/util/llm.ts, web/packages/studio/src/util/strings.ts, web/packages/studio/src/util/logger.ts
Use websiteLogger.warn/error and new toError helper for malformed-line parsing, JSONL/JSON row warnings, template compilation errors, CSV parse errors, and to emit structured OTEL attributes from errors.
Tests updated
web/packages/studio/src/**/*.spec.tsx, web/packages/studio/src/util/logger.spec.ts
Update assertions and mocks to match new logging call signatures and OTEL/env mocks.

Possibly Related PRs

Suggested Reviewers

  • marcusds
  • dmariali
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title accurately reflects the primary change: consolidating console statements and wrapping them through a logger utility across the Studio package.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch steramae/logger-consolidation

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts (1)

154-154: ⚡ Quick win

String(err) loses stack traces.

Original console.error('Bulk duplicate failed', err) preserved the error object. If websiteLogger.error accepts multiple arguments like console.error, pass err separately instead of stringifying.

🤖 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 `@web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts` at
line 154, In useBulkDuplicate.ts, update the error logging in the bulk-duplicate
failure handler to stop stringifying the error; call websiteLogger.error with
the descriptive message and the actual err object as a separate argument (i.e.,
pass err instead of String(err)) so the logger can preserve stack and other
error properties — locate the call to websiteLogger.error in the
useBulkDuplicate failure path and change the single string argument to two
arguments (message, err).
🤖 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 `@web/packages/studio/src/components/filesets/hooks/useBulkDownload.ts`:
- Line 74: The log call in useBulkDownload.ts is converting the error to a
string which drops the stack; update the websiteLogger.error invocation to pass
the Error object (or include err.stack in the single message) instead of
String(err) so the stack is preserved—locate the websiteLogger.error call in
useBulkDownload (where err is caught) and replace the string interpolation with
a single-argument call that logs the Error object (or a message concatenated
with err.stack).

---

Nitpick comments:
In `@web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts`:
- Line 154: In useBulkDuplicate.ts, update the error logging in the
bulk-duplicate failure handler to stop stringifying the error; call
websiteLogger.error with the descriptive message and the actual err object as a
separate argument (i.e., pass err instead of String(err)) so the logger can
preserve stack and other error properties — locate the call to
websiteLogger.error in the useBulkDuplicate failure path and change the single
string argument to two arguments (message, err).
🪄 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: Enterprise

Run ID: 830bb427-ade2-4dd0-a74d-548aa601607d

📥 Commits

Reviewing files that changed from the base of the PR and between 5643114 and 41df4fb.

📒 Files selected for processing (25)
  • web/eslint.config.js
  • web/packages/studio/src/api/datasets/useDatasetFileContent.ts
  • web/packages/studio/src/components/DatasetInputFile/index.tsx
  • web/packages/studio/src/components/FilesetActionMenu/index.tsx
  • web/packages/studio/src/components/ModelComparePrompts/index.tsx
  • web/packages/studio/src/components/WorkspaceDropdown/index.tsx
  • web/packages/studio/src/components/evaluation/Configurations/form/InputFile.tsx
  • web/packages/studio/src/components/evaluation/Jobs/ActionMenu.tsx
  • web/packages/studio/src/components/evaluation/Jobs/DetailsPanel.tsx
  • web/packages/studio/src/components/evaluation/Jobs/EvaluationJobBulkDeleteModal.tsx
  • web/packages/studio/src/components/filesets/AddToFolderModal/index.tsx
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/BulkDeleteModal/index.tsx
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/DatasetFileDropzone/index.tsx
  • web/packages/studio/src/components/filesets/hooks/useBulkDownload.ts
  • web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts
  • web/packages/studio/src/components/sidePanels/AgentPanels/AgentPanel/DeploymentLogsView.tsx
  • web/packages/studio/src/mocks/node.ts
  • web/packages/studio/src/routes/DeploymentsListRoute/useDeleteDeploymentAndConfig.ts
  • web/packages/studio/src/routes/FilesetListRoute/ActionMenu/index.tsx
  • web/packages/studio/src/routes/FilesetListRoute/DatasetBulkDeleteModal/index.tsx
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx
  • web/packages/studio/src/routes/agents/AgentSuggestionsRoute/utils.ts
  • web/packages/studio/src/util/files.ts
  • web/packages/studio/src/util/llm.ts
  • web/packages/studio/src/util/strings.ts

Comment thread web/packages/studio/src/components/filesets/hooks/useBulkDownload.ts Outdated
Signed-off-by: Sean Teramae <steramae@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx (1)

97-100: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Inconsistent error logging pattern.

Line 65 passes error as the second argument (cause) but line 98 stringifies errors into the message. Pass errors as the cause for structured OTEL attributes.

Suggested fix
-  websiteLogger.error(`Form validation errors: ${String(errors)}`);
+  websiteLogger.error('Form validation errors', errors);
🤖 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 `@web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx` around
lines 97 - 100, handleSubmitError currently stringifies the validation errors
into the log message; change websiteLogger.error to pass the errors object as
the second argument (the cause) instead of embedding it in the message so OTEL
can capture structured attributes (update the call in handleSubmitError to
mirror the pattern used elsewhere where an error is passed as the second
argument), leaving setErrorMessage as-is.
🤖 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.

Outside diff comments:
In `@web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx`:
- Around line 97-100: handleSubmitError currently stringifies the validation
errors into the log message; change websiteLogger.error to pass the errors
object as the second argument (the cause) instead of embedding it in the message
so OTEL can capture structured attributes (update the call in handleSubmitError
to mirror the pattern used elsewhere where an error is passed as the second
argument), leaving setErrorMessage as-is.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a64a49fe-65cb-42fc-9879-3331fc9712d8

📥 Commits

Reviewing files that changed from the base of the PR and between cbaf7ed and 05e0c46.

📒 Files selected for processing (23)
  • web/packages/studio/e2e-tests/pages/project-datasets.ts
  • web/packages/studio/src/api/datasets/useDatasetFileContent.ts
  • web/packages/studio/src/components/FilesetActionMenu/index.tsx
  • web/packages/studio/src/components/ModelComparePrompts/index.tsx
  • web/packages/studio/src/components/evaluation/Configurations/form/InputFile.tsx
  • web/packages/studio/src/components/evaluation/Jobs/ActionMenu.tsx
  • web/packages/studio/src/components/evaluation/Jobs/DetailsPanel.tsx
  • web/packages/studio/src/components/evaluation/Jobs/EvaluationJobBulkDeleteModal.tsx
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/BulkDeleteModal/index.tsx
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/DatasetFileDropzone/index.tsx
  • web/packages/studio/src/components/filesets/hooks/useBulkDownload.ts
  • web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts
  • web/packages/studio/src/components/sidePanels/AgentPanels/AgentPanel/DeploymentLogsView.tsx
  • web/packages/studio/src/routes/DeploymentsListRoute/useDeleteDeploymentAndConfig.ts
  • web/packages/studio/src/routes/FilesetListRoute/ActionMenu/index.tsx
  • web/packages/studio/src/routes/FilesetListRoute/DatasetBulkDeleteModal/index.tsx
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/index.tsx
  • web/packages/studio/src/routes/agents/AgentSuggestionsRoute/api.ts
  • web/packages/studio/src/routes/agents/AgentSuggestionsRoute/useOptimizerSuggestions.ts
  • web/packages/studio/src/routes/agents/ClaudeCodeChatRoute/stream.ts
  • web/packages/studio/src/util/llm.ts
  • web/packages/studio/src/util/logger.ts
  • web/packages/studio/src/workers/LargeFileWorker.ts
✅ Files skipped from review due to trivial changes (5)
  • web/packages/studio/src/routes/DeploymentsListRoute/useDeleteDeploymentAndConfig.ts
  • web/packages/studio/src/components/evaluation/Jobs/DetailsPanel.tsx
  • web/packages/studio/e2e-tests/pages/project-datasets.ts
  • web/packages/studio/src/util/llm.ts
  • web/packages/studio/src/components/FilesetActionMenu/index.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • web/packages/studio/src/routes/FilesetListRoute/ActionMenu/index.tsx
  • web/packages/studio/src/routes/FilesetListRoute/DatasetBulkDeleteModal/index.tsx
  • web/packages/studio/src/components/evaluation/Jobs/ActionMenu.tsx
  • web/packages/studio/src/components/filesets/hooks/useBulkDuplicate.ts
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/BulkDeleteModal/index.tsx
  • web/packages/studio/src/components/evaluation/Configurations/form/InputFile.tsx
  • web/packages/studio/src/api/datasets/useDatasetFileContent.ts
  • web/packages/studio/src/components/filesets/FilesetFileExplorer/DatasetFileDropzone/index.tsx
  • web/packages/studio/src/components/ModelComparePrompts/index.tsx

Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
Signed-off-by: Sean Teramae <steramae@nvidia.com>
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.

1 participant