Fix alizer hanging while getting potential dockerfile locations#31
Fix alizer hanging while getting potential dockerfile locations#31thepetk merged 5 commits intodevfile:mainfrom
Conversation
Signed-off-by: thepetk <[email protected]>
3281b7f to
fc9c8c5
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
==========================================
+ Coverage 70.42% 70.49% +0.07%
==========================================
Files 11 11
Lines 1562 1566 +4
==========================================
+ Hits 1100 1104 +4
Misses 395 395
Partials 67 67
☔ View full report in Codecov by Sentry. |
rm3l
left a comment
There was a problem hiding this comment.
Also, do you think it could be possible to add a test case to prevent future regressions on this?
I was thinking maybe we could enrich the resources/projects/dockerfile-nested test project with a bunch of new directories. And adding a timeout to the test case to make sure it does not hang. WDYT?
Signed-off-by: thepetk <[email protected]>
Signed-off-by: thepetk <[email protected]>
Signed-off-by: thepetk <[email protected]>
Signed-off-by: thepetk <[email protected]>
@rm3l I've added 20 test dirs in the test resource and updated the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: michael-valdron, rm3l, thepetk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What does this PR do?
This PR creates a separate slice of
stringinside thegetLocationfunction, in order to avoid looping forever in thelocationsslice.More detailed, for a big project, alizer was trying to get a all potential locations of dockerfiles with
utils.getLocations. This process tries to locate any Dockerfile/Containerfile inside the root level or one level down. So if thegetLocationsidentifies an item that is a directory inside the root dir of the component it adds this item to the list.The above process was hanging for a big project as the
getLocationswas looping in a bigger and bigger slice. By adding thefilenamesslice and looping for potential filenames there, this issue is now fixed.Which issue(s) does this PR fix
fixes devfile/api#1279
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