Feature/batch info provider import#982
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #982 +/- ##
============================================
+ Coverage 59.83% 61.35% +1.51%
- Complexity 6050 6326 +276
============================================
Files 529 542 +13
Lines 20625 21730 +1105
============================================
+ Hits 12341 13332 +991
- Misses 8284 8398 +114 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Here is description of excel functionality pull report
|
|
Do not merge yet, there is a bug when user doesn't check prefetch and it still fetches info, causing timeout on larger sets. |
|
Hey @jbtronics any clue when this could be merged/rejected? Otherwise we will need to continue on our own fork, not providing any contributions here anymore. |
|
I will try to release the V2 version in the next few days, it's basically only missing some documentation. Then I can review and merge the PRs. As some base stuff changed, it will probably be easier to merge the PRs into the V2 changes than the other way around.... |
…import jobs to junction table and implement filtering based on bulk import jobs status and its associated parts' statuses.
…h fields to choose
|
All done, it should be better now, one thing i did was just refresh page (with js) after clicking a button in a bulk import job, maybe this code be done better. Also, why are github actions not running? |
|
@jbtronics Can you take a quick look at structure to see if it is better so you don't have to wait for me if you find out there are additional things to do |
… controller endpoints
Otherwise it is possible to inject invalid data
|
Its much better now. The controller is good now I think, extracting most of the logic into a service sounds good too. Still, I do not really like the large complex arrays that get passed around (especially between different logical units). The performBulkSearch in the BulkInofProviderService returns a large complex array, which is basically impossible to understand without looking into the source code. I think returning a DTO would be helpful for making that easier to understand what it contains and more maintainable in the long run. For the internal passing around of data inside the service the array is okay, but then the arrays should have some type and or structure hints for parameter and return value, otherwise its very hard to understand what is done there... I have already started to add some typehints, but they are still missing in some places. The field mapping could maybe also be extracted into a DTO, instead of an array, as it is used in many places. And the form could directly interact on these objects then. Im not too sure about how useful the BulkSearchRequestDTO is, because it is only used in the one method signature, and is directly created before the method call and split up immediatley afterwards again. Here replacing the dto with named arguments in the performBulkSearch is probably doing the same. I do not think its too useful to have BulkSearchResultDTO as child class of SearchResultDTO, as this needs to be updated everytime a new field is updated. I think it is more useful to just encapsulate the SearchResultDTO there. But i am not sure how it is used later. |
- Add BulkSearchResponseDTO, FieldMappingDTO for type safety - Use composition instead of inheritance in BulkSearchResultDTO - Remove unnecessary BulkSearchRequestDTO - Fix N+1 queries and API error handling - Fix Add Mapping button functionality
|
@jbtronics Please tell me if you see any more bugs or areas for improvement, also i fixed a bug where "Add Mapping" wasn't working. |
This maybe should be revisited in the future, but for now this fix should work
|
I did some refactoring to remove the remains of the arrays everywhere. Also did some other improvements. I have now merged the PR, thank you. Maybe some notes: The structure how the search results are serialized to the DB have changed slightly to your version, so if you had db entries already, you should probably delete all import jobs. In the For the future, it would probably be cool to make the whole data retrieval thing which can take some time truely asynchronous from the web tasks. This should be not so difficult with the symfony/messenger component, but so far Part-DB does not use it yet. |



Works in the following way:
Note: I have by a mistake continued to work right on top of my other addition (excel support), so it would be best to first finish that or maybe even discard it and do everything here.