Skip to content

chore: remove deprecated ioutil dependency#30

Merged
michael-valdron merged 1 commit intodevfile:mainfrom
trader7:alizer-ioutil-dependency
Sep 22, 2023
Merged

chore: remove deprecated ioutil dependency#30
michael-valdron merged 1 commit intodevfile:mainfrom
trader7:alizer-ioutil-dependency

Conversation

@trader7
Copy link
Contributor

@trader7 trader7 commented Sep 22, 2023

What does this PR do?

Removes deprecated ioutil dependency in 4 files listed below.
% find . -name "*.go" -type f -print | xargs grep /ioutil
./test/check_registry/check_registry.go: "io/ioutil"
./pkg/apis/enricher/framework/dotnet/dotnet_detector.go: "io/ioutil"
./pkg/apis/recognizer/devfile_recognizer.go: "io/ioutil"
./pkg/utils/detector.go: "io/ioutil"

Which issue(s) does this PR fix

Partial fix for devfile/api#1257

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Unit/Functional tests

  • Documentation

How to test changes / Special notes to the reviewer

os.ReadDir replacement for ioutil.ReadDir requires looping through []fs.DirEntry to access []fs.FileInfo. Consider revising error handling on this loop, I copied the previous error handling from the call to ioutil.ReadDir

@openshift-ci openshift-ci bot requested review from elsony and feloy September 22, 2023 17:51
@michael-valdron michael-valdron linked an issue Sep 22, 2023 that may be closed by this pull request
2 tasks
Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

Source changes for replacing "io/ioutil" looks good.

PR is just missing the linter check changes:

Enforce the package is not used in the future using linter (run the linter into CI)

Did you want to cover this part as well?

@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.06% ⚠️

Comparison is base (e486794) 70.48% compared to head (182a9ff) 70.42%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
- Coverage   70.48%   70.42%   -0.06%     
==========================================
  Files          11       11              
  Lines        1555     1562       +7     
==========================================
+ Hits         1096     1100       +4     
- Misses        393      395       +2     
- Partials       66       67       +1     
Files Changed Coverage Δ
pkg/apis/recognizer/devfile_recognizer.go 58.39% <0.00%> (ø)
pkg/utils/detector.go 85.94% <62.50%> (-0.42%) ⬇️
test/check_registry/check_registry.go 46.71% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trader7
Copy link
Contributor Author

trader7 commented Sep 22, 2023

PR is just missing the linter check changes:

Enforce the package is not used in the future using linter (run the linter into CI)
Did you want to cover this part as well?

I'm not familiar with how to make the linter changes

Copy link
Member

@michael-valdron michael-valdron left a comment

Choose a reason for hiding this comment

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

PR is just missing the linter check changes:

Enforce the package is not used in the future using linter (run the linter into CI)
Did you want to cover this part as well?

I'm not familiar with how to make the linter changes

No worries I will assign myself work on the linter changes.

I'll approve your PR as a partial fix.

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Sep 22, 2023
@openshift-ci
Copy link

openshift-ci bot commented Sep 22, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michael-valdron, trader7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@michael-valdron
Copy link
Member

Unit/Functional tests
Documentation

Not needed with these changes.

@trader7
Copy link
Contributor Author

trader7 commented Sep 22, 2023

No worries I will assign myself work on the linter changes.
I'll approve your PR as a partial fix.
/lgtm

Awesome, thanks! Sorry I missed the second part of the task there. I'll take a look at how you make the linter changes so that I'll know for next time.

@michael-valdron michael-valdron merged commit 4a254ca into devfile:main Sep 22, 2023
@trader7 trader7 deleted the alizer-ioutil-dependency branch September 22, 2023 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Alizer io/ioutil dependency

2 participants