Skip to content

Detect devfiles only for main language in case of no component found#22

Merged
thepetk merged 5 commits intodevfile:mainfrom
thepetk:bug/fix_component_detection
Aug 22, 2023
Merged

Detect devfiles only for main language in case of no component found#22
thepetk merged 5 commits intodevfile:mainfrom
thepetk:bug/fix_component_detection

Conversation

@thepetk
Copy link
Contributor

@thepetk thepetk commented Aug 21, 2023

What does this PR do?

This PR updates the logic of SelectDevfilesFromTypes in order to match devfiles only for the main language of a source code if no component was found.

More detailed, upon SelectDevfilesFromTypes, if no component is found from the component analysis, it tries to match a devfile with the main language of the source code.

Which issue(s) does this PR fix

fixes devfile/api#1219

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

@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Patch coverage: 75.00% and project coverage change: +0.96% 🎉

Comparison is base (27607db) 66.26% compared to head (5322873) 67.23%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #22      +/-   ##
==========================================
+ Coverage   66.26%   67.23%   +0.96%     
==========================================
  Files          11       11              
  Lines        1405     1419      +14     
==========================================
+ Hits          931      954      +23     
+ Misses        414      405       -9     
  Partials       60       60              
Files Changed Coverage Δ
pkg/apis/recognizer/devfile_recognizer.go 58.39% <75.00%> (+4.76%) ⬆️

... and 1 file with indirect coverage changes

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

@thepetk thepetk changed the title WIP: Detect devfiles only for main language in case of no component found Detect devfiles only for main language in case of no component found Aug 21, 2023
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
@thepetk thepetk force-pushed the bug/fix_component_detection branch from 58b02bf to 277dc75 Compare August 22, 2023 11:06
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
Signed-off-by: thepetk <thepetk@gmail.com>
@thepetk
Copy link
Contributor Author

thepetk commented Aug 22, 2023

I've added more test cases in order to avoid having errors from the coverage reports

@openshift-ci
Copy link

openshift-ci bot commented Aug 22, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mike-hoang, thepetk

The full list of commands accepted by this bot can be found 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

@thepetk thepetk merged commit 04361c9 into devfile:main Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alizer SelectDevFileFromTypes matches PHP project as nodejs project

2 participants