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

Add bulk operations for processes #101

Merged
merged 6 commits into from
Sep 25, 2024
Merged

Add bulk operations for processes #101

merged 6 commits into from
Sep 25, 2024

Conversation

dalonsoa
Copy link
Collaborator

Description

This PR remove the per-process operations and add checkboxes and buttons such that the operations can be triggered for multiple processes at once. Asa bonus, the code has been simplified significantly.

Fixes #86

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • The documentation builds and looks OK (eg. python -m sphinx -b html docs docs/build)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future. (Indicate issue here: # (issue))

@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (66a2445) to head (4cb6d81).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #101   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines           43        43           
=========================================
  Hits            43        43           

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

@dalonsoa
Copy link
Collaborator Author

kill and flush drunc commands can work on multiple processes at once, but restart only works for a single process, otherwise there's an error, hence the loop.

Copy link
Contributor

@cc-a cc-a left a comment

Choose a reason for hiding this comment

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

Good stuff. A few tweaks and a question about why the restart command is different.

main/tables.py Show resolved Hide resolved
main/templates/main/index.html Show resolved Hide resolved
Comment on lines +95 to +97
for uuid_ in uuids_:
query = ProcessQuery(uuids=[uuid_])
await pmd.restart(query)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this different logic here? It makes things rather awkward and I'd be tempted to stick with the previous implementation, particularly if we take out the awaits.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

pmd.restart do not work with more than one uuid at the same time, so this one needs a loop. Where we put the loop, I don't mind.

tests/test_views.py Outdated Show resolved Hide resolved
@dalonsoa dalonsoa requested a review from cc-a September 25, 2024 10:04
Copy link
Contributor

@cc-a cc-a left a comment

Choose a reason for hiding this comment

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

Great stuff. Thanks for this.

@cc-a cc-a merged commit 8f99f14 into main Sep 25, 2024
4 checks passed
@cc-a cc-a deleted the bulk_operations branch September 25, 2024 11:13
@jamesturner246
Copy link
Contributor

Sorry I'm late! Possible bug with selecting all processes using the top checkbox:

Screenshot from 2024-09-25 21-57-01

I'm guessing this top box is meant to mean 'select all', but when I click it and try e.g. kill, nothing happens.

@dalonsoa
Copy link
Collaborator Author

That functionality is meant to be implemented in #87, not here.

@jamesturner246
Copy link
Contributor

Ah, I seem No worries. 👍

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.

Bulk operations for restart/kill/flush
4 participants