Skip to content
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

[WIP] Background reports #9199

Merged
merged 18 commits into from
Mar 4, 2025

Conversation

SchrodingersGat
Copy link
Member

@SchrodingersGat SchrodingersGat commented Feb 27, 2025

Work in progress to allow report generation in the background worker

  • Crucial for long-running printing processes which would otherwise timeout the worker

TODO

  • Offload report printing
  • Offload label printing
  • Playwright testing

Future Work

Copy link

netlify bot commented Feb 27, 2025

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

Name Link
🔨 Latest commit 9cb863e
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/67c6eada500dfa0008c80c5e
😎 Deploy Preview https://deploy-preview-9199--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: 96 (🔴 down 2 from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 78 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 68.75000% with 35 lines in your changes missing coverage. Please review.

Project coverage is 86.15%. Comparing base (0d1ab4e) to head (9cb863e).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...rontend/src/components/buttons/PrintingActions.tsx 35.29% 20 Missing and 2 partials ⚠️
...venTree/plugin/builtin/labels/inventree_machine.py 75.00% 4 Missing ⚠️
src/backend/InvenTree/report/models.py 84.00% 4 Missing ⚠️
...end/InvenTree/plugin/builtin/labels/label_sheet.py 0.00% 3 Missing ⚠️
src/frontend/src/hooks/UseForm.tsx 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9199      +/-   ##
==========================================
- Coverage   86.15%   86.15%   -0.01%     
==========================================
  Files        1186     1186              
  Lines       52440    52501      +61     
  Branches     2211     2216       +5     
==========================================
+ Hits        45182    45234      +52     
+ Misses       6698     6696       -2     
- Partials      560      571      +11     
Flag Coverage Δ
backend 88.06% <84.05%> (+<0.01%) ⬆️
pui 70.03% <44.18%> (+0.13%) ⬆️

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.

@SchrodingersGat SchrodingersGat requested a review from matmair as a code owner March 1, 2025 07:51
@matmair
Copy link
Member

matmair commented Mar 1, 2025

@SchrodingersGat is there a reason to have separate output models and endpoints for reports and labels or can we merge these? We seem to duplicate a lot of functions between the two

@SchrodingersGat
Copy link
Member Author

It is a big duplication - and about to become a triplication with the data export plugins

If we moved all this onto one model, and define the "export type" field, then this could be reduced to a single model.

I might look into that after this PR, to reduce the scope

@SchrodingersGat SchrodingersGat added enhancement This is an suggested enhancement or new feature report Report/Label generation api Relates to the API User Interface Related to the frontend / User Interface labels Mar 4, 2025
@SchrodingersGat SchrodingersGat added this to the 1.0.0 milestone Mar 4, 2025
@SchrodingersGat SchrodingersGat merged commit d822b9b into inventree:master Mar 4, 2025
27 of 28 checks passed
@SchrodingersGat SchrodingersGat deleted the background-reports branch March 4, 2025 12:40
simonkuehling pushed a commit to simonkuehling/InvenTree that referenced this pull request Mar 4, 2025
* Update report generation progress

* Add shim task for offloading report printing

* Cleanup

* Add detail endpoints for label and report outputs

* Display report printing progress in UI

* Implement similar for label printing

* Reduce output for CI

* Add plugin slug

* Bump API version

* Ensure it works with machine printing

* Fix null comparison

* Fix SKU link

* Update playwright tests

* Massively reduce log output when printing
SchrodingersGat added a commit that referenced this pull request Mar 4, 2025
* increase character limits on all link fields to 2000

* update test to still trigger

* Don't fail when diff is too big for echo (#9205)

* Reduce severity of error message (#9209)

- Currently flooding sentry.io with reports

* Disable pagination for ConfigList class (#9210)

* [API] Auth login error (#9212)

Fixes #9211

* [UI] Table Update (#9220)

- Retain user selection for pageSize

* renumber migrations after merge from master

* Remove quick actions (#9222)

* Remove placeholder components

- No function
- Cleanup for 1.0.0

* Remove Placeholder.tsx

* feat(backend): Add user profile (#9116)

* Add user profile

* fix choice set

* ensure primary_group is valid

* add missing migrations

* fix tests

* merge migrations

* add migration test

* add new model to ruleset

* ensure changed to the m2m conenction also validate primary grups

* move signals

* fix import?

* patch user language through

* use set methods correctly

* bump api

* refactoring to make debugging and extending easier

* fix dum recurrsion problem

* fix user pk lookup

* rename migration

* add user and group page

* cleanup

* add hoverCard for user / owner / group render

* include owner_model in owner responses

* move user serializers to users

* add profile to list

* add brief serializer for profiles

* ensure profile is present in most apis

* extend rendered data

* store and observe langauge in profile

* reduce unneeded complexity

* enable access to full profle (including internal fields) in me serializer

* move theme to a single object

* persist theme settings

* fix radius lookup

* remove debug message

* fix filter

* remove unused field

* remove image fields

* add setting to control showing profiles

* fix settings

* update test

* fix theme reload

* Add contact UI

* Add profile edit screen

* fix test

* Add testing for user theme panel

* fix var name

* complete coverage of theme

* Add test for new pages

* make test more reliable in strict mode

* remove step

* fix ref

* add verbose names

* fix used setting

* extend tests

* fix permissions

* fix lookup

* use lookup to enuse ursls stay valid

* update migrations

* Add position field

* fix permissions

* Fix font size in location column (#9230)

* [WIP] Background reports (#9199)

* Update report generation progress

* Add shim task for offloading report printing

* Cleanup

* Add detail endpoints for label and report outputs

* Display report printing progress in UI

* Implement similar for label printing

* Reduce output for CI

* Add plugin slug

* Bump API version

* Ensure it works with machine printing

* Fix null comparison

* Fix SKU link

* Update playwright tests

* Massively reduce log output when printing

* handle null values in existing db data

* fix test to pass at max character limit again

---------

Co-authored-by: Matthias Mair <[email protected]>
Co-authored-by: Oliver <[email protected]>
Co-authored-by: Joe Rogers <[email protected]>
Copy link

sentry-io bot commented Mar 5, 2025

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ValidationError: {'error': ['Error generating report'], 'detail': ["Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS."], 'path': ['/']} report.models in print View Issue
  • ‼️ ValidationError: ['Error printing labels', "Invalid HTTP_HOST header: 'testserver'. You may need to add 'testserver' to ALLOWED_HOSTS."] report.models in print View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Relates to the API enhancement This is an suggested enhancement or new feature report Report/Label generation User Interface Related to the frontend / User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants