Skip to content

Conversation

@NickPhura
Copy link
Contributor

@NickPhura NickPhura commented Feb 8, 2023

Overview

Links to Jira tickets

https://quartech.atlassian.net/browse/BHBC-2140

Bug found while testing in preparation for prod release: The codevalue validator was calling toLowerCase on the cell value, which would throw if the value was not a string.

Description of relevant changes

Add functions for safely lowercasing/trimming unknown values.

  • the stock .toLowerCase() and .trim() are probably still preferred when possible. The new functions are more for when when the type of the value is unknown or inconsistent (as with the cell/header values of the templates).

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

@github-actions
Copy link

github-actions bot commented Feb 8, 2023

@codecov
Copy link

codecov bot commented Feb 8, 2023

Codecov Report

Merging #939 (768431e) into dev (fee0b44) will increase coverage by 0.07%.
The diff coverage is 91.42%.

@@            Coverage Diff             @@
##              dev     #939      +/-   ##
==========================================
+ Coverage   65.71%   65.78%   +0.07%     
==========================================
  Files         349      350       +1     
  Lines       11295    11308      +13     
  Branches     1958     1959       +1     
==========================================
+ Hits         7422     7439      +17     
  Misses       3471     3471              
+ Partials      402      398       -4     
Impacted Files Coverage Δ
api/src/utils/media/xlsx/xlsx-utils.ts 51.51% <66.66%> (+1.51%) ⬆️
...edia/validation/file-type-and-content-validator.ts 95.83% <75.00%> (+0.08%) ⬆️
...rc/utils/media/csv/validation/csv-row-validator.ts 88.33% <90.90%> (+1.77%) ⬆️
api/src/utils/media/csv/csv-file.ts 74.50% <100.00%> (+2.23%) ⬆️
...utils/media/csv/validation/csv-header-validator.ts 96.00% <100.00%> (ø)
...src/utils/media/xlsx/validation/xlsx-validation.ts 93.10% <100.00%> (ø)
api/src/utils/string-utils.ts 100.00% <100.00%> (ø)

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

anissa-agahchen
anissa-agahchen previously approved these changes Feb 8, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 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

@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.

🧶

@NickPhura NickPhura merged commit f37b559 into dev Feb 8, 2023
@NickPhura NickPhura deleted the BHBC-2140-bugfix branch February 8, 2023 23:28
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