Repository navigation
Supplier Mixin - #9761
Supplier Mixin#9761
Conversation
✅ Deploy Preview for inventree-web-pui-preview canceled.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9761 +/- ##
==========================================
+ Coverage 87.62% 87.68% +0.06%
==========================================
Files 1266 1272 +6
Lines 56923 57337 +414
Branches 2047 2043 -4
==========================================
+ Hits 49877 50277 +400
- Misses 6543 6557 +14
Partials 503 503
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
And do you have any idea, why the PUI tests fail, I havent touched them in a while and I do net get anything from the error. There seems to be tests failing where I havent changed anything... I would really appriciate some pointers on how to fix them. Otherwise this PR is ready for a first review. |
|
without looking at it deeply - there is a lot of coverage on the backend missing |
matmair
left a comment
There was a problem hiding this comment.
Very good quality, as always. A few questions / nitpicks; nothing really blocking.
I think a few lines of user docs on this would be good too - if you have time.
This is a great start, there are a few things that I think could be more sketched out (in future PRs, by anyone):
- Caching
- Handling of rate limits
- oAuth (digikey and a few other have that)
- parameter normalizing among suppliers
- data structures to handle multiple supplier accounts
|
Thanks for that feedback, that are some good ideas. I have collected them in the initial PR description now, but I want to make sure that I full understand them:
What exactly do you mean by that?
I think that should be the goal of the SettingsMixin and UIMixin, also with the oauth stuff. And still, I would really appreciate some help with the PUI tests, do you have any idea @SchrodingersGat ? |
|
@matmair Maybe you can add some clarification on my above questions? |
Different supplier parts (even from the same supplier) can feature vastly different formats for the same parameter: This is a whole can of worms and could probably eat up an inifinite amount of time, so I never really looked into this much when developing Another thing that relates to this is the |
|
If I understand that correct, this is already implemented. You may can test that using the static sample plugin. |
https://en.wikipedia.org/wiki/Canonical_form#Computing ensuring that parameters and parameter units from different suppliers are handled in a standardized form
I seem to have overlooked that, could you point that out?
That would mean every plugin implements this itself, probably. In the future, I would prefer to have that as a core feature to ensure that the interface is the same between plugins and to make portability between plugins easier, might they become unmaintained / insecure. |
|
I have added it to the changelog now. |
Co-authored-by: Matthias Mair <[email protected]>
|
@SchrodingersGat ready for review and merge |
|
@wolflu05 I'll get onto this in the next couple of days. Sorry, super swamped! |
|
@wolflu05 firstly, great work, this is a huge undertaking and I think a very useful feature. As this is such a big feature, there are guaranteed to be some issues we will have to track down over the next few release cycles. I hope that you can take charge of these? |
|
Regarding documentation: While you have documented the plugin mixin type itself, I think it would be good to also add a general documentation page regarding importing parts from a supplier. This should be in the "parts" documentation category, and provide some generic documentation about the requirements and process for importing parts:
Happy for you to add that now, or we can make it a target for an additional PR? |
|
Overall, happy with this, I think that (after maybe some additional docs) we can merge in and make sure it gets tested thoroughly before the next release. Hopefully we can also provide some supplier-specific plugins in the future? |
|
Thanks for your review. I have added some user docs now. Just let me know if there is something else we need to change. |
|
Nice addition, thanks! I apologise in advance for any changes that I will request after this is merged - it's hard to catch everything on such a large feature addition. |
|
That makes sense. Hope that I will find some time then, because I will be pretty busy for the next weeks. |

This Adds a supplier mixin so that plugin can provide functions to import data from supplier APIs.
TODO
Future Ideas