add cancel all button to dashboard#1455
Conversation
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1455 +/- ##
===========================================
- Coverage 88.94% 88.70% -0.24%
===========================================
Files 103 104 +1
Lines 3689 3736 +47
Branches 453 457 +4
===========================================
+ Hits 3281 3314 +33
- Misses 333 346 +13
- Partials 75 76 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
…hub.com/ssl-hep/ServiceX into 1296-add-cancel-all-button-to-dashboard
| def get(self): | ||
| if current_app.config.get("ENABLE_AUTH"): | ||
| user = self.get_requesting_user() | ||
| user_id = user.id if user is not None else None |
There was a problem hiding this comment.
How does the None case propagate?
| if current_app.config.get("ENABLE_AUTH"): | ||
| user = self.get_requesting_user() | ||
| user_id = user.id if user is not None else None | ||
| transform_reqs = TransformRequest.query.filter( |
There was a problem hiding this comment.
I feel Ben always likes these to be added to the model class so they can be reused easily
| namespace = current_app.config["TRANSFORMER_NAMESPACE"] | ||
| for transform_req in transform_reqs: | ||
| request_id = transform_req.request_id | ||
| if transform_req.status in ( |
There was a problem hiding this comment.
Possible race condition if something moves from pending_lookup to running before cancellation?
| cls.transformer_manager = transformer_manager | ||
|
|
||
| @auth_required | ||
| def get(self): |
There was a problem hiding this comment.
Not to be "that guy", but this should be a POST and not a GET since it is taking an action...
There was a problem hiding this comment.
Yeah you're right, I copied the pattern from the existing cancel route.
for more information, see https://pre-commit.ci
…hub.com/ssl-hep/ServiceX into 1296-add-cancel-all-button-to-dashboard
for more information, see https://pre-commit.ci
Adds Cancel All button to the Dashboard when ENABLE_AUTH=True. This will cancel all active transformations based upon the existing individual Cancel logic.
When ENABLE_AUTH=False, the button is not present and the route returns 400.