Skip to content

[refactor] Bulk actions - #12359

Merged
SchrodingersGat merged 16 commits into
inventree:masterfrom
SchrodingersGat:bulk-actions
Jul 12, 2026
Merged

[refactor] Bulk actions#12359
SchrodingersGat merged 16 commits into
inventree:masterfrom
SchrodingersGat:bulk-actions

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Jul 12, 2026

Copy link
Copy Markdown
Member

Implement helper functions for bulk offloading of background tasks and events:

  • Add bulk_create helper for background tasks
  • Add bulk_create helper for events

Also, add context wrappers to automatically extract common operations from deeply nested loops:

  • Capture tasks, and pass them to bulk_offload_task
  • Capture events, and pass them to bulk_trigger_event
  • Capture stock tracking entries and bulk create them

Performance Benchmarks

  • Performing bulk API operations with the specified number of entries
  • Record number of database operations before and after batching
  • 100x items used in each case
Endpoint Before After Reduction
/stock/count/ 2,618 2,019 600
/stock/add/ 2,618 2,019 600
/stock/remove/ 2,618 2,019 600
/stock/move/ 1,619 1,120 500

Note: There are some other major improvement opportunities identified here, these will be addressed in a follow-up PR

@SchrodingersGat SchrodingersGat added this to the 1.5.0 milestone Jul 12, 2026
@SchrodingersGat
SchrodingersGat requested a review from matmair as a code owner July 12, 2026 01:14
@netlify

netlify Bot commented Jul 12, 2026

Copy link
Copy Markdown

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 20b4b62
🔍 Latest deploy log https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6a5324a9c773690008c2b719
😎 Deploy Preview https://deploy-preview-12359--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (no change from production)
Accessibility: 81 (no change from production)
Best Practices: 100 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.76423% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.35%. Comparing base (4e00e2d) to head (20b4b62).
⚠️ Report is 1 commits behind head on master.

❌ Your project status has failed because the head coverage (65.57%) is below the target coverage (68.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (4e00e2d) and HEAD (20b4b62). Click for more details.

HEAD has 4 uploads less than BASE
Flag BASE (4e00e2d) HEAD (20b4b62)
backend 6 2
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12359      +/-   ##
==========================================
- Coverage   86.86%   81.35%   -5.51%     
==========================================
  Files        1399     1379      -20     
  Lines       92225    90471    -1754     
  Branches    10720    10077     -643     
==========================================
- Hits        80108    73600    -6508     
- Misses      12054    16810    +4756     
+ Partials       63       61       -2     
Flag Coverage Δ
backend 90.90% <97.76%> (+0.06%) ⬆️

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

Components Coverage Δ
Backend Apps 92.43% <98.53%> (+0.04%) ⬆️
Backend General 93.38% <ø> (ø)
Frontend 65.57% <ø> (-14.36%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SchrodingersGat SchrodingersGat added the api Relates to the API label Jul 12, 2026
@SchrodingersGat
SchrodingersGat merged commit b42521f into inventree:master Jul 12, 2026
40 of 42 checks passed
@SchrodingersGat
SchrodingersGat deleted the bulk-actions branch July 12, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant