Skip to content

DEMOS-1819-create-excel-report-file#1408

Merged
TARehman merged 5 commits into
mainfrom
DEMOS-1819-create-excel-report-file
Jun 9, 2026
Merged

DEMOS-1819-create-excel-report-file#1408
TARehman merged 5 commits into
mainfrom
DEMOS-1819-create-excel-report-file

Conversation

@TARehman

@TARehman TARehman commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This allows for creating of a formatted Excel report file from a query. I went back and forth awhile on the best ways to handle the typing and I feel that this is a good approach.

  • Settled on using excelts as the library for the time being, and added this to the install files. This appears to be a decent, fairly up-to-date, TS-native implementation.
  • Moved the queries into the same folders as the formerly-called schemas and renamed it to configs.
    • The *Config.ts files contain all the formatting and type information for a single report.
    • The *Query.ts files contain the actual SQL query as a multi-line string.
    • For every report, we'll have one of each; the *Query.ts file gets imported into the *Config.ts file, where we also set up various things like nicely-named string headers, etc.
    • I added some custom types for configs that are in their own file (to avoid circular dependencies with putting them in index.ts. These types are more generic so that downstream functions are more aware of what should be in every report type in terms of columns, etc.
    • In index.ts there is the exported report configurations, as well as an accessor (which makes some of the mocking of tests easier). This is also where we can infer a type from the Zod configuration for each row, which can be used in the formatting functions.
  • Simplified the runOnDemandReport.ts implementation very mildly and simplified the tests by ignoring the types in specific cases where they're not relevant, with comments to document why.
  • Added formatOnDemandReportInExcel.ts with very simple formatting for now; however, my hope is that if we need to add complexity, it can become part of the report configuration, and be passed into the function, keeping it fairly generic.
  • Updated the resolver to actually call the Excel formatter. Tested locally and it seems to be working!

Some housekeeping items:

  • Added S3_SKIP_SIGNATURE_VALIDATION to the docker-compose.yml file for local dev; this makes localstack enforce the timeout on download links among other things.
  • Updated concurrently to close a critical security bug; only used in dev dependencies.

@TARehman TARehman requested a review from a team June 9, 2026 18:10
@TARehman TARehman self-assigned this Jun 9, 2026
@TARehman TARehman added enhancement New feature or request data Relates to data infrastructure or development. javascript Pull requests that update javascript code server Relates to the server. labels Jun 9, 2026
@demos-git-service-account

demos-git-service-account commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

CORS_ALLOWED_HEADERS: "Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token,X-Amz-User-Agent"
CORS_EXPOSE_HEADERS: "ETag"
CORS_ALLOW_CREDENTIALS: "true"
S3_SKIP_SIGNATURE_VALIDATION: 0

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.

I didn't see this being used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you don't enable that, localstack doesn't enforce the timeout of the pre-signed URLs and other things locally.

@connor-parke-icf connor-parke-icf left a comment

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.

looks good to me; good find on the S3_SKIP_SIGNATURE_VALIDATION fix. Overall the xlsx formatting looks straightforward. no real comments

@TARehman TARehman added this pull request to the merge queue Jun 9, 2026
Merged via the queue into main with commit 2e03a6d Jun 9, 2026
24 checks passed
@TARehman TARehman deleted the DEMOS-1819-create-excel-report-file branch June 9, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data Relates to data infrastructure or development. enhancement New feature or request javascript Pull requests that update javascript code server Relates to the server.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants