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

SIMSBIOHUB-8: Validation/Transformation Updates/Cleanup #1036

Merged
merged 7 commits into from
Jun 5, 2023
Merged

Conversation

NickPhura
Copy link
Collaborator

@NickPhura NickPhura commented May 25, 2023

Overview

Links to Jira tickets

Not directly related to SIMSBIOHUB-8, but some things noticed while working in the biohubbc-utils repo.

Description of relevant changes

  • Remove unused notifications.ts const.
  • Cleaned up the validation/transformation json-schema definitions, as they were a bit out of date.
  • removed xlsx-transform-json-path-queries.ts as it is a helper file used in building configs (used in biohubbc-utils) but never used in SIMS.
  • Updated a bunch of object types to be Record<string,any>.
  • Added more comments/JSDoc to validation/transformation functions/types.
  • Added more sophisticated support for transforming date and time cells.

PR Checklist

A list of items that are good to consider when making any changes.

Note: this list is not exhaustive, and not all items are always applicable.

Code

  • New files/classes/functions have appropriately descriptive names and comment blocks to describe their use/behaviour
  • I have avoided duplicating code when possible, moving re-usable pieces into functions
  • I have avoided hard-coding values where possible and moved any re-usable constants to a constants file
  • My code is as flat as possible (avoids deeply nested if/else blocks, promise chains, etc)
  • My code changes account for null/undefined values and handle errors appropriately
  • My code uses types/interfaces to help describe values/parameters/etc, help ensure type safety, and improve readability

Style

  • My code follows the established style conventions
  • My code uses native material-ui components/icons/conventions when possible

Documentation

  • I have commented my code sufficiently, such that an unfamiliar developer could understand my code
  • I have added/updated README's and related documentation, as needed

Tests

  • I have added/updated unit tests for any code I've added/updated
  • I have added/updated the Postman requests/tests to account for any API endpoints I've added/updated

Linting/Formatting

  • I have run the linter and fixed any issues, as needed
    See the lint commands in package.json
  • I have run the formatter and fixed any issues, as needed
    See the format commands in package.json

SonarCloud

  • I have addressed all SonarCloud Bugs, Vulnerabilities, Security Hotspots, and Code Smells

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Merging #1036 (93d83ca) into dev (83a6431) will decrease coverage by 0.04%.
The diff coverage is 44.77%.

@@            Coverage Diff             @@
##              dev    #1036      +/-   ##
==========================================
- Coverage   67.71%   67.67%   -0.04%     
==========================================
  Files         394      392       -2     
  Lines       12196    12208      +12     
  Branches     2076     2083       +7     
==========================================
+ Hits         8258     8262       +4     
- Misses       3424     3433       +9     
+ Partials      514      513       -1     
Impacted Files Coverage Δ
api/src/constants/notifications.ts 100.00% <ø> (ø)
...edia/validation/file-type-and-content-validator.ts 95.83% <ø> (ø)
...utils/media/validation/validation-schema-parser.ts 73.00% <ø> (ø)
...lsx/transformation/xlsx-transform-schema-parser.ts 6.45% <ø> (ø)
.../utils/media/xlsx/transformation/xlsx-transform.ts 3.22% <0.00%> (-0.13%) ⬇️
api/src/utils/media/xlsx/xlsx-file.ts 80.76% <ø> (ø)
api/src/utils/media/media-file.ts 70.96% <33.33%> (ø)
api/src/utils/media/xlsx/xlsx-utils.ts 40.00% <33.33%> (-11.52%) ⬇️
...rc/utils/media/csv/validation/csv-row-validator.ts 90.90% <66.66%> (+1.56%) ⬆️
api/src/json-schema/transformation-schema.ts 100.00% <100.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@NickPhura NickPhura added Not Ready For Review Addressing feedback and/or refactoring and removed Not Ready For Review Addressing feedback and/or refactoring labels May 26, 2023
@NickPhura NickPhura requested a review from anissa-agahchen May 26, 2023 20:33
@NickPhura NickPhura added the Not Ready For Review Addressing feedback and/or refactoring label May 26, 2023
@NickPhura NickPhura marked this pull request as draft May 29, 2023 17:19
Updates to date handling in transformation code.
@NickPhura NickPhura marked this pull request as ready for review June 2, 2023 21:59
@NickPhura NickPhura removed the Not Ready For Review Addressing feedback and/or refactoring label Jun 2, 2023
curtisupshall
curtisupshall previously approved these changes Jun 5, 2023
Copy link
Contributor

@curtisupshall curtisupshall left a comment

Choose a reason for hiding this comment

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

Looks great! +1 for all the documentation added to all the validators 😎

api/src/utils/media/xlsx/transformation/xlsx-transform.ts Outdated Show resolved Hide resolved
anissa-agahchen
anissa-agahchen previously approved these changes Jun 5, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Contributor

@al-rosenthal al-rosenthal left a comment

Choose a reason for hiding this comment

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

🍏

@NickPhura NickPhura merged commit e1c8b0e into dev Jun 5, 2023
@NickPhura NickPhura deleted the SIMSBIOHUB-8 branch June 5, 2023 22:33
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.

4 participants