Skip to content

add cancel all button to dashboard#1455

Open
MattShirley wants to merge 34 commits into
developfrom
1296-add-cancel-all-button-to-dashboard
Open

add cancel all button to dashboard#1455
MattShirley wants to merge 34 commits into
developfrom
1296-add-cancel-all-button-to-dashboard

Conversation

@MattShirley

@MattShirley MattShirley commented May 21, 2026

Copy link
Copy Markdown
Collaborator

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.

@MattShirley MattShirley linked an issue May 21, 2026 that may be closed by this pull request
@codecov

codecov Bot commented May 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.65079% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.24%. Comparing base (f06b45a) to head (e989b87).

Files with missing lines Patch % Lines
servicex_app/servicex_app/models.py 80.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1455      +/-   ##
===========================================
+ Coverage    89.20%   89.24%   +0.04%     
===========================================
  Files          103      104       +1     
  Lines         3732     3785      +53     
  Branches       460      465       +5     
===========================================
+ Hits          3329     3378      +49     
- Misses         326      329       +3     
- Partials        77       78       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MattShirley MattShirley marked this pull request as ready for review May 21, 2026 22:09
Comment thread servicex_app/servicex_app/resources/transformation/cancel_all.py Outdated
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(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I feel Ben always likes these to be added to the model class so they can be reused easily

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Two class methods were added to support this.

Comment thread servicex_app/servicex_app/resources/transformation/cancel_all.py Outdated
cls.transformer_manager = transformer_manager

@auth_required
def get(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not to be "that guy", but this should be a POST and not a GET since it is taking an action...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah you're right, I copied the pattern from the existing cancel route.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Both Cancel and Cancel All were updated to use post.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hm, can cancel be called by the frontend CLI?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, it can... I'm not sure it's worth making a breaking change over. Maybe keep cancel endpoint a GET and make CancelAll a POST.

Good catch, @ponyisi

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I've reverted the cancel to use get.

Could we support the same logic on both get and post and then deprecate the get on some timeline?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds reasonable. (Sounds like a feature flag. :-) )

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@ponyisi @BenGalewsky this has been finalized, with an additional frontend PR added to support it.

mock_conn.execute.assert_called_once()


class TestShutdownPod:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these tests here, and not in test_transformer_manager.py?

.all()
)

def shutdown_pod(self, transformer_manager: TransformerManager):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't belong in the database models. I think it should be an operation in transformer_manager.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agree, in my earlier comment I just meant that the DB query (active_user_transformations) should be in the model class

"capabilities": [
"poll_local_transformation_results",
"long_sample_titles_10240",
"post_cancel_transform",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find this name confusing... it sounds like it describes something that happens after a cancel (post-cancel-bliss). Maybe cancel_transform_post_method or somthing

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.

Add Cancel All Button to Dashboard

3 participants