Skip to content

refactor: DH-17778: Move exportLogs to the log package#2279

Merged
vbabich merged 13 commits intodeephaven:mainfrom
vbabich:move-log-export-to-log-package
Nov 4, 2024
Merged

refactor: DH-17778: Move exportLogs to the log package#2279
vbabich merged 13 commits intodeephaven:mainfrom
vbabich:move-log-export-to-log-package

Conversation

@vbabich
Copy link
Copy Markdown
Collaborator

@vbabich vbabich commented Nov 4, 2024

  • Move exportLogs and logInit to the log package so they could be reused in Enterprise
  • Remove @deephaven/redux and @deephaven/jsapi-shim dependencies from LogExport.ts
  • Serialize Maps in redux data
  • Unit tests for getReduxDataString

@vbabich vbabich self-assigned this Nov 4, 2024
@vbabich vbabich marked this pull request as ready for review November 4, 2024 21:25
@vbabich vbabich requested review from a team and bmingles and removed request for a team November 4, 2024 21:25
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 4, 2024

Codecov Report

Attention: Patch coverage is 15.38462% with 22 lines in your changes missing coverage. Please review.

Project coverage is 46.62%. Comparing base (229adf0) to head (bdd069a).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
packages/log/src/LogExport.ts 20.00% 16 Missing ⚠️
packages/log/src/LogInit.ts 0.00% 3 Missing ⚠️
packages/code-studio/src/index.tsx 0.00% 2 Missing ⚠️
packages/code-studio/src/settings/SettingsMenu.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2279      +/-   ##
==========================================
+ Coverage   46.57%   46.62%   +0.05%     
==========================================
  Files         698      702       +4     
  Lines       38767    38937     +170     
  Branches     9866     9902      +36     
==========================================
+ Hits        18054    18153      +99     
- Misses      20702    20730      +28     
- Partials       11       54      +43     
Flag Coverage Δ
unit 46.62% <15.38%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


logInit();
logInit(
parseInt(import.meta.env.VITE_LOG_LEVEL ?? '', 10),
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.

Is it ok that '' parses to NaN?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is existing code moved from LogInit - https://github.com/deephaven/web-client-ui/pull/2279/files#diff-8f738bb62eda99bdb9b608feb9a011431c9daef91788b6ad56166ff4d950ca9eL15
I don't know if this was the original intent, but NaN here results in a warning -

if (!Number.isFinite(level)) {
      console.warn(
        `Expected a number for log level. Received: ${level}. Ignoring`
      );
      return;
    }

FILENAME_DATE_FORMAT,
new Date()
)}_support_logs`,
logHistory: LogHistory,
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.

Should this be marked as a breaking change in the PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The exportLogs wasn't previously exposed. The @deephaven/code-studio package didn't export anything from LogExport.ts.

Copy link
Copy Markdown
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

Had 1 question + I think this needs to be marked as a breaking change due to exportLogs contract change. Otherwise looks good.

Copy link
Copy Markdown
Contributor

@bmingles bmingles left a comment

Choose a reason for hiding this comment

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

Looks good

@vbabich vbabich merged commit ee0af9c into deephaven:main Nov 4, 2024
@vbabich vbabich deleted the move-log-export-to-log-package branch November 4, 2024 23:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants