Skip to content

Call machine func - #9191

Merged
SchrodingersGat merged 13 commits into
inventree:masterfrom
SchrodingersGat:call-machine-func
Feb 28, 2025
Merged

SchrodingersGat merged 13 commits into
inventree:masterfrom
SchrodingersGat:call-machine-func

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Feb 26, 2025 •

Copy link
Copy Markdown
Member

Adds framework for calling a specific machine / driver function by string lookup.

Avoids pickling and caching issues when offloading machine tasks to the background worker process.

Closes #9171

@SchrodingersGat SchrodingersGat added plugin Plugin ecosystem refactor labels Feb 26, 2025
@SchrodingersGat SchrodingersGat added this to the 1.0.0 milestone Feb 26, 2025
@netlify

netlify Bot commented Feb 26, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview canceled.

Name Link
🔨 Latest commit 29c96c8
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/67c0e28848cdc200082a7f49

@codecov

codecov Bot commented Feb 26, 2025 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 65.15152% with 23 lines in your changes missing coverage. Please review.

Project coverage is 86.05%. Comparing base (92edbf4) to head (29c96c8).
Report is 217 commits behind head on master.

Files with missing lines Patch % Lines
src/backend/InvenTree/machine/registry.py 59.57% 19 Missing ⚠️
src/backend/InvenTree/plugin/registry.py 57.14% 3 Missing ⚠️
src/backend/InvenTree/machine/machine_type.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9191      +/-   ##
==========================================
- Coverage   86.05%   86.05%   -0.01%     
==========================================
  Files        1182     1182              
  Lines       52116    52175      +59     
  Branches     2185     2187       +2     
==========================================
+ Hits        44850    44900      +50     
- Misses       6706     6714       +8     
- Partials      560      561       +1     
Flag Coverage Δ
backend 88.06% <65.15%> (-0.04%) ⬇️
pui ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@matmair matmair left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; plugin and machine registry seem to become more similar over time; this pattern might make sense to unify

@SchrodingersGat SchrodingersGat added bug Identifies a bug which needs to be addressed backport Apply this label to a PR to enable auto-backport action backport-to-0.17.x labels Feb 26, 2025
@SchrodingersGat SchrodingersGat changed the title [WIP] Call machine func Call machine func Feb 27, 2025
@SchrodingersGat
SchrodingersGat merged commit 6c52f00 into inventree:master Feb 28, 2025
@SchrodingersGat
SchrodingersGat deleted the call-machine-func branch February 28, 2025 10:08
@github-actions

Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
❌ 0.17.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

backport --pr 9191

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

SchrodingersGat added a commit to SchrodingersGat/InvenTree that referenced this pull request Mar 14, 2025
* Force label printing to background worker

* Refactor "check_reload" state of machine registry

- In line with plugin registry
- More work can be done here (i.e. session caching)

* Better handling of call_plugin_function

* Wrapper for calling machine function

* Use AttributeError instead

* Simplify function offloading

* Check plugin registry hash when reloading machine registry

* Cleanup

* Fixes

* Adjust unit test

* Cleanup

* Allow running in foreground if background worker not running

* Simplify call structure
SchrodingersGat added a commit that referenced this pull request Mar 14, 2025
* Force label printing to background worker

* Refactor "check_reload" state of machine registry

- In line with plugin registry
- More work can be done here (i.e. session caching)

* Better handling of call_plugin_function

* Wrapper for calling machine function

* Use AttributeError instead

* Simplify function offloading

* Check plugin registry hash when reloading machine registry

* Cleanup

* Fixes

* Adjust unit test

* Cleanup

* Allow running in foreground if background worker not running

* Simplify call structure
@github-actions github-actions Bot mentioned this pull request Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Apply this label to a PR to enable auto-backport action bug Identifies a bug which needs to be addressed plugin Plugin ecosystem refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

label printing error: Can't pickle <class 'inventree_brother.brother_plugin.BrotherLabelPrinterDriver'>

2 participants