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

FS-857 Add parse XLSX file function for BOM service with unit tests covered #235

Closed
wants to merge 1 commit into from

Conversation

Alva8756
Copy link
Contributor

@Alva8756 Alva8756 commented Aug 23, 2023

BOM service PostBomXlsx API need a parse XLSX helper function.

Implementation for XLSX parse helper function.
wrote unit tests cover for the helper function.

testdata folder to hold all xlsx files for testing purpose.

@Alva8756 Alva8756 changed the title draft PR with unit test draft PR to add parse XLSX file function for BOM service with unit tests covered Aug 23, 2023
@Alva8756 Alva8756 force-pushed the FS-857 branch 10 times, most recently from 131229f to a017fb3 Compare August 24, 2023 19:12
…box#233)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@Alva8756 Alva8756 marked this pull request as ready for review August 24, 2023 19:58
@Alva8756 Alva8756 requested a review from a team as a code owner August 24, 2023 19:58
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #235 (537788f) into main (a4fb59f) will increase coverage by 0.52%.
The diff coverage is 96.15%.

@@            Coverage Diff             @@
##             main     #235      +/-   ##
==========================================
+ Coverage   71.87%   72.40%   +0.52%     
==========================================
  Files          36       37       +1     
  Lines        3549     3627      +78     
==========================================
+ Hits         2551     2626      +75     
- Misses        745      747       +2     
- Partials      253      254       +1     
Flag Coverage Δ
unittests 72.40% <96.15%> (+0.52%) ⬆️

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

Files Changed Coverage Δ
pkg/api/v1/router_bom.go 96.15% <96.15%> (ø)

@Alva8756 Alva8756 changed the title draft PR to add parse XLSX file function for BOM service with unit tests covered FS-857 Add parse XLSX file function for BOM service with unit tests covered Aug 24, 2023
Copy link
Contributor

@DoctorVin DoctorVin left a comment

Choose a reason for hiding this comment

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

This is an impressive bit of work. I left a few comments that I'd like you to address, but nothing really show-stopping. Nice job!

This is marked as Needs Changes because it shouldn't be in ServerService (as we discussed earlier). But I think you could lift-and-shift this code to a proxy service and it would be fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider putting all the structs into a single file.

pkg/api/v1/router_bom.go Show resolved Hide resolved
pkg/api/v1/router_bom.go Show resolved Hide resolved
// which is the format of a file reading from the HTTP request.
stat, err := file.Stat()
if err != nil {
fmt.Println(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

you have a couple of better (IMO) options here. Consider t.Logf, t.Fatalf (better, I think) or require.NoError (if you are familiar with github.com/stretchr/testify/require.

@Alva8756 Alva8756 closed this Sep 1, 2023
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.

2 participants