Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(4317): Xlsx to exceljs #4325

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

chore(4317): Xlsx to exceljs #4325

wants to merge 6 commits into from

Conversation

drernie
Copy link
Member

@drernie drernie commented Feb 15, 2025

Description

"Fixes issues #4317

Remove xlsx, which has been abandoned and has security issues.
Replace with exceljs.

TODO

  • [X ] Unit tests
  • Changelog entry (skip if change is not significant to end users, e.g. docs only)

@drernie
Copy link
Member Author

drernie commented Feb 15, 2025

It fails a "no error" test because the function rejects the invalid type. Do we need to change the type signature?

Copy link

codecov bot commented Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.44%. Comparing base (7488a87) to head (5f6b42e).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4325       +/-   ##
===========================================
+ Coverage   39.10%   91.44%   +52.34%     
===========================================
  Files         787      108      -679     
  Lines       34827     9974    -24853     
  Branches     5525        0     -5525     
===========================================
- Hits        13618     9121     -4497     
+ Misses      20666      853    -19813     
+ Partials      543        0      -543     
Flag Coverage Δ
api-python 91.41% <ø> (ø)
catalog ?
lambda 91.53% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@drernie drernie requested a review from fiskus February 15, 2025 04:52
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR replaces the deprecated 'xlsx' library with 'exceljs' for spreadsheet handling in the Quilt catalog, improving security and maintainability while preserving existing functionality.

  • Updated /catalog/app/utils/spreadsheets/spreadsheets.ts to use ExcelJS's eachRow method for parsing spreadsheets
  • Added new helper functions readXlsx and readCSVString in /catalog/app/utils/spreadsheets/spreadsheets.spec.ts for testing
  • Implemented proper async file reading with error handling in readSpreadsheet function
  • Maintained comprehensive test coverage across multiple file formats (xlsx, xlsm, ods, fods, csv)
  • Upgraded to ExcelJS 4.4.0 in package.json for enhanced security and stability

3 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines 157 to 159
it('parse invalid data with no error', () => {
const sheet = ['123']
const sheet = ['123'] // rejected by compiler
expect(spreadsheets.parseSpreadsheetAgainstSchema(sheet, schema)).toEqual({})
Copy link
Contributor

Choose a reason for hiding this comment

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

style: test case uses invalid input type but relies on TypeScript compilation - should test runtime behavior

drernie and others added 3 commits February 14, 2025 20:53
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@drernie drernie marked this pull request as draft March 12, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant