-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
refactor: Add exception handling in background job within BOM Update Tool #30146
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## develop #30146 +/- ##
===========================================
+ Coverage 60.90% 60.94% +0.04%
===========================================
Files 1082 1083 +1
Lines 69078 69111 +33
===========================================
+ Hits 42071 42120 +49
+ Misses 27007 26991 -16
|
- Created BOM Update Log that will handle queued job status and failures - Moved validation and BG job to thus new doctype - BOM Update Tool only works as an endpoint
- Added Typing - Moved all job business logic to bom update log - Added `run_bom_job` that handles errors and runs either of two methods - UX: Replace button disabled until both inputs are filled - Show log creation message on UI for correctness - APIs return log document as result - Converted raw sql to QB
- test creation of log and it's impact
- Explain explicit commits and skip semgrep - Format client side translated string correctly
ankush
requested changes
Mar 30, 2022
ankush
reviewed
Mar 30, 2022
erpnext/manufacturing/doctype/bom_update_tool/bom_update_tool.py
Outdated
Show resolved
Hide resolved
- Renamed public function`update_new_bom` to `update_new_bom_in_bom_items` - Replaced `get_cached_doc` with `get_doc` - Removed click progress bar (drive through update log) - Removed `bom_obj.update_new_bom()`, was redundant. Did same job as `update_new_bom_in_bom_items` - Removed `update_new_bom()` in `bom.py`, unused. - Prettier query formatting - `update_type` annotated as non optional Literal - Removed redundant use of JobTimeoutException - Corrected type annotations in `create_bom_update_log()`
- Covers full validate function
@ankush as discussed will fix cost updation inconsistencies in a different PR. Good to go for now ? |
unrelated test failing. |
ankush
approved these changes
Mar 31, 2022
Fixed the failing test in #30509 |
marination
added a commit
that referenced
this pull request
Apr 6, 2022
…-30146 refactor: Add exception handling in background job within BOM Update Tool (backport #30146)
3 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue:
Working:
The Replace button is inactive until both BOMs are mentioned. On clicking on Replace, a BOM Update Log is created. This log maintains state and lets user know of failure.
This log has two types: Replace BOM and Update Cost. Each is self explanatory as to what job is being executed.
List View:
Failed Log:
Completed Log
Failed Log with simulated timeout error:
Todo: