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

Fix workflow presenter to run things from threads #514

Merged
merged 5 commits into from
Dec 5, 2024

Conversation

rboston628
Copy link
Contributor

@rboston628 rboston628 commented Dec 5, 2024

Description of work

There are some processes which take place inside workflows. It is important these be able to return errors. Many of these methods were not sent to separate threads, which meant errors could not be handled through the universal error handling point.

This fixes that, providing a method for all workflows to call to easily send methods to new thread.

Explanation of work

Inside WorkflowPresenter, split off the functionality that handles actions on continue to handle any kind of action.

Updated the workflows to make use of this functionality, instead of their prior try-catch blocks that only logged errors to the output.

To test

Dev testing

This impacts the following parts of the UI:

  • groupings populated in the drop down
  • recalculation on peak-tweak parameters
  • purging peaks from diffcal workflow

Make sure these parts of the workflow are still completely correctly.

CIS testing

N/A

Link to EWM item

There is no ticket for this work , but it supports other work in

EWM#7712

Verification

N/A

Acceptance Criteria

N/A

@rboston628 rboston628 requested a review from walshmm December 5, 2024 17:38
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.56%. Comparing base (40daa45) to head (91d73d0).

Additional details and impacted files
@@            Coverage Diff             @@
##             next     #514      +/-   ##
==========================================
- Coverage   95.60%   95.56%   -0.05%     
==========================================
  Files          66       66              
  Lines        4962     4962              
==========================================
- Hits         4744     4742       -2     
- Misses        218      220       +2     

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

continueOnSuccess = lambda success: self.advanceWorkflow() if success else None # noqa E731
self.handleAction(verifyAndContinue, None, continueOnSuccess)

def handleAction(self, action, args, onSuccess):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add typehints, I think its important we know onSuccess is a Callable

@rboston628 rboston628 marked this pull request as ready for review December 5, 2024 18:55
@rboston628 rboston628 merged commit da4b224 into next Dec 5, 2024
2 of 5 checks passed
@rboston628 rboston628 deleted the ewm7712-worker-pools branch December 5, 2024 18:59
rboston628 added a commit that referenced this pull request Dec 5, 2024
@walshmm walshmm restored the ewm7712-worker-pools branch December 5, 2024 19:01
rboston628 added a commit that referenced this pull request Dec 6, 2024
* fix workflow presenter to run things from threads

* fix use of requests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* add annotations to handleAction for callable

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants