-
Notifications
You must be signed in to change notification settings - Fork 9
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
TACKLE-312: import dependencies #136
Conversation
Codecov Report
@@ Coverage Diff @@
## main #136 +/- ##
============================================
+ Coverage 97.32% 97.65% +0.33%
- Complexity 267 296 +29
============================================
Files 25 26 +1
Lines 448 511 +63
Branches 23 34 +11
============================================
+ Hits 436 499 +63
Misses 9 9
Partials 3 3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-brophy Thanks for creating this PR. Here are some observations from my review:
- I've created a CSV file that generates a
Circle dependency
. The content of the CSV is not processed and the file imported never appears listed onApplications import
page. Here is the CSV I've tried:
import-circle-dependency-generates-error.csv
- There are mainly format corrections I'd like to be done. Things like multiple white spaces or
System.out.println
statements can be enhanced I think.
Please let me know if you were able to reproduce the issue using the CSV attached to this comment.
src/main/java/io/tackle/applicationinventory/mapper/ApplicationDependencyAPIMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tackle/applicationinventory/mapper/ApplicationDependencyAPIMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tackle/applicationinventory/mapper/ApplicationDependencyAPIMapper.java
Outdated
Show resolved
Hide resolved
src/test/java/io/tackle/applicationinventory/resources/ApplicationImportNullTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/tackle/applicationinventory/services/ImportServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/tackle/applicationinventory/services/ImportServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/tackle/applicationinventory/services/ImportServiceTest.java
Outdated
Show resolved
Hide resolved
src/test/java/io/tackle/applicationinventory/services/ImportServiceTest.java
Outdated
Show resolved
Hide resolved
src/main/java/io/tackle/applicationinventory/services/ImportService.java
Outdated
Show resolved
Hide resolved
src/main/resources/db/migration/V20210914.1__alter_application_import.sql
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m-brophy this PR now works as expected. I mean, it does what is required.
Just one Enhancement I'd like to be done, and this is more about design rather than the functionality of the code. Currently, there are 2 classes that inherit ApplicationMapper
; one of them is ApplicationInventoryAPIMapper
and the other one is ApplicationDependencyAPIMapper
. Both children classes are instantiated in a different way; ApplicationInventoryAPIMapper
is instantiated with the new
operator, for instance new ApplicationInventoryAPIMapper()
. On the other hand, ApplicationInventoryAPIMapper
is instantiated using CDI injection, for instance @Inject ApplicationInventoryAPIMapper
. That seems odd.
I think the fact that both children are instantiated in a different way is a sign that perhaps both children shouldn't inherit a parent class. Moreover, it seems that the parent class is not used but only the children.
Either both children should be instantiated in the same way or both children classes should be independent and not share a common parent. Having different ways of instantiating children might create confusion.
Here is an example of 2 ways of instantiating the same class:
- https://github.com/m-brophy/tackle-application-inventory/blob/TACKLE-312/src/test/java/io/tackle/applicationinventory/resources/ApplicationImportNullTest.java#L247
- https://github.com/m-brophy/tackle-application-inventory/blob/TACKLE-312/src/main/java/io/tackle/applicationinventory/services/ImportService.java#L65
I'd like to know your thoughts about this.
Thanks, @m-brophy . This PR looks good to me! |
https://issues.redhat.com/browse/TACKLE-312