feat(backend): ensure restore of backups only works in correct enviroments#11372
feat(backend): ensure restore of backups only works in correct enviroments#11372SchrodingersGat merged 19 commits intoinventree:masterfrom
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Merging this PR will improve performance by 11.3%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | test_search_performance[stockitem] |
108 ms | 100 ms | +8.05% |
| ⚡ | WallTime | test_api_options_performance[/api/order/po-line/] |
154 ms | 142.5 ms | +8.11% |
| ⚡ | WallTime | test_search_performance[build] |
35 ms | 32.6 ms | +7.44% |
| ⚡ | WallTime | test_api_list_performance[/api/build/item/] |
316.6 ms | 291.3 ms | +8.68% |
| ⚡ | WallTime | test_api_options_performance[/api/build/line/] |
392.4 ms | 352.6 ms | +11.3% |
| ⚡ | WallTime | test_api_options_performance[/api/build/item/] |
320.8 ms | 294.1 ms | +9.1% |
| ⚡ | WallTime | test_api_options_performance[/api/order/so/] |
53.9 ms | 50.7 ms | +6.44% |
Comparing matmair:matmair/issue11214 (21e402f) with master (246108e)1
Footnotes
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #11372 +/- ##
==========================================
+ Coverage 87.99% 88.02% +0.02%
==========================================
Files 1295 1295
Lines 58793 58917 +124
Branches 1938 1941 +3
==========================================
+ Hits 51733 51859 +126
+ Misses 6578 6574 -4
- Partials 482 484 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…matmair/issue11214
…matmair/issue11214
there is no realy db dep here
…matmair/issue11214
|
Nice work, and great job getting the functionality merged upstream. dbbackup versionHave we already updated to the required version of django-dbbackup? There is no version bump in this PR? docsIt would be great to add a brief paragraph to the backup docs regarding compatibility |
yes, that was included in the latest bump (5.2.0 included the change)
This PR mostly prevents footguns, there is no functional change other than (by default) stopping restores from newer versions. I will add a short section on some basic restrictions. Real world functional decencies will probably only enter with #11235 |
|
@matmair fair enough - if you can submit some brief docs too that would be great, but happy to merge this now |
…ments (inventree#11372) * [FR] ensure restore of backups only works in correct enviroments Fixes inventree#11214 * update PR nbr * fix wrong ty detection * fix link * ensure tracing does not enagage while running backup ops * fix import * remove debugging string * add error codes * add tests for backup and restore * complete test for restore * we do not need e2e on every matrix entry there is no realy db dep here * fix changelog format * add flag to allow bypass

This uses a new function I upstreamed in dbbackup to allow us checking various environment markers.
The names of variables are chosen in a manner to keep long-term restore compatibility in place as we might evolve this schema. It is no rocket science but should help with some common issues, especially if we get logs for debugging.
To-do:
Fixes #11214