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: Bulk Action bug #9255

Merged
merged 35 commits into from
May 2, 2024
Merged

fix: Bulk Action bug #9255

merged 35 commits into from
May 2, 2024

Conversation

johnkim-det
Copy link
Contributor

@johnkim-det johnkim-det commented Apr 26, 2024

Ticket

ET-237

Description

Removes boolean selectAll and dependent logic from BulkAction/BatchAction handling.

Test Plan

  • Select multiple rows from the Experiment List
  • Any action selected from the "Actions" menu that appears should function as expected. Action should not happen on more or less items than what's selected

Checklist

  • Changes have been manually QA'd
  • User-facing API changes need the "User-facing API Change" label.
  • Release notes should be added as a separate file under docs/release-notes/.
    See Release Note for details.
  • Licenses should be included for new code which was copied and/or modified from any external code.

Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 19.62025% with 254 lines in your changes are missing coverage. Please review.

Project coverage is 44.68%. Comparing base (aea83df) to head (c97f2c1).
Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9255      +/-   ##
==========================================
+ Coverage   44.66%   44.68%   +0.02%     
==========================================
  Files        1273     1273              
  Lines      155822   155830       +8     
  Branches     2439     2438       -1     
==========================================
+ Hits        69591    69629      +38     
+ Misses      85992    85962      -30     
  Partials      239      239              
Flag Coverage Δ
backend 41.75% <53.08%> (+0.01%) ⬆️
harness 64.21% <0.00%> (-0.02%) ⬇️
web 35.12% <8.40%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
master/internal/api_experiment.go 56.74% <100.00%> (+0.51%) ⬆️
master/internal/api_runs.go 73.61% <100.00%> (ø)
master/internal/core.go 4.10% <ø> (ø)
webui/react/src/components/UserSettings.tsx 85.71% <100.00%> (+2.20%) ⬆️
...ages/ExperimentDetails/ExperimentDetailsHeader.tsx 74.96% <100.00%> (+0.03%) ⬆️
.../react/src/components/ExperimentActionDropdown.tsx 0.00% <0.00%> (ø)
webui/react/src/components/ExperimentMoveModal.tsx 66.07% <50.00%> (-0.30%) ⬇️
...react/src/components/ExperimentRetainLogsModal.tsx 59.21% <75.00%> (+0.15%) ⬆️
webui/react/src/services/types.ts 0.00% <0.00%> (ø)
webui/react/src/pages/ExperimentList.tsx 0.00% <0.00%> (ø)
... and 8 more

... and 3 files with indirect coverage changes

Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit c97f2c1
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/6633c15a53d22600083b17ca
😎 Deploy Preview https://deploy-preview-9255--determined-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

The ticket says

Disable Infinite Scrolls (+ Remove from experiment view options & user preferences)

i can still enable infinite scroll.

Copy link
Contributor

@keita-determined keita-determined left a comment

Choose a reason for hiding this comment

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

mostly working good. few questions

@johnkim-det when filter is applied, should we reset selection?
cc: @corban-beaird

Screen.Recording.2024-04-26.at.1.39.41.PM.mov

qq:

BulkAction requests to include the relevant project id

where do we supposed to see the projectId? i didnt see it in archive API

@corban-beaird
Copy link
Contributor

It looks like the selection count isn't updating properly, the bulk action is properly scope to only the visible experiments, but we're telling users they have 22 out of 2 experiments selected.

Screen.Recording.2024-04-26.at.2.46.15.PM.mov

It also leads to some confusion because it looks like we've selected things, but we don't allow the option to do anything with them. To clarify the problem is not with the lack of an ability to perform actions on the "ghost" selections, but with the ghost selections.

It's also a tad quirky since now we make it seem like they can perform action across multiple pages, but we're not really giving them an option to do so.
Screenshot 2024-04-26 at 2 56 28 PM
Screenshot 2024-04-26 at 2 57 51 PM

@corban-beaird
Copy link
Contributor

corban-beaird commented Apr 26, 2024

@keita-determined

qq:

BulkAction requests to include the relevant project id

where do we supposed to see the projectId? i didnt see it in archive API

We're leaving this out as a requirement this is handled by exhaustively listing out the experiment ids.

@johnkim-det
However, the more I'm thinking about this, in the event that an experiment is no longer in the currently open project, then we'd like to make sure don't perform an action on it unintentionally. Assuming another user moved an experiment at the same time and their request was handled first.

So yes, we want to include the project_id, sorry for any confusion!

@carolinaecalderon carolinaecalderon added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Apr 26, 2024
@johnkim-det johnkim-det requested a review from a team as a code owner April 29, 2024 18:35
@johnkim-det johnkim-det requested a review from a team as a code owner April 29, 2024 19:12
@corban-beaird
Copy link
Contributor

corban-beaird commented Apr 30, 2024

Looks like there's a failure in tests/cluster/test_workspace_org.py::test_workspace_org that isn't occurring on main. There are also some timeouts in other tests, are those flakes?

@MikhailKardash
I was able to replicate tests/cluster/test_workspace_org.py::test_workspace_org on my local if I'm running a licensed instance on latest main w/RBAC enabled; however, the test passes on both this branch & main when it's not.

The issue I'm seeing is that the determined user doesn't have view permission on the Uncategorized workspace when RBAC is enabled which is being assumed.
**Edit: I was able to reproduce the workspace_org issue outside of the RBAC enabled devcluster, working to resolve now
*** Resolved, the bulk action move hadn't account for single experiment request like the others, corrected.

The timeout failures should now be resolved, the batch kill request had not been correctly adjusted originally; it should be now.

Copy link
Contributor

@ashtonG ashtonG left a comment

Choose a reason for hiding this comment

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

is returning infinite scroll on the roadmap? if not, i'd rather us remove the dead code instead of having to work around it indefinitely.

@johnkim-det
Copy link
Contributor Author

my understanding is that infinite scroll should be disabled for now, but ideally want to bring it back if we can find a solution that works well with row selection. I can create a ticket for that so it's captured and we make sure to have that discussion.

Copy link
Contributor

@maxrussell maxrussell left a comment

Choose a reason for hiding this comment

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

Still reviewing, but leaving some comments here to get convo started to hopefully move the PR along faster.

e2e_tests/tests/experiment/experiment.py Outdated Show resolved Hide resolved
e2e_tests/tests/experiment/experiment.py Outdated Show resolved Hide resolved
e2e_tests/tests/experiment/experiment.py Outdated Show resolved Hide resolved
e2e_tests/tests/experiment/experiment.py Outdated Show resolved Hide resolved
master/internal/experiment/bulk_action.go Outdated Show resolved Hide resolved
master/internal/experiment/bulk_action.go Outdated Show resolved Hide resolved
master/internal/experiment/bulk_action.go Outdated Show resolved Hide resolved
master/internal/experiment/bulk_action.go Outdated Show resolved Hide resolved
Co-authored-by: Max Russell <max.russell@hpe.com>
Copy link

cla-bot bot commented May 1, 2024

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @corban-beaird on file. In order for us to review and merge your code, please start the CLA process at https://determined.ai/cla.

After we approve your CLA, we will update the contributors list (private) and comment @cla-bot[bot] check to rerun the check.

@cla-bot cla-bot bot removed the cla-signed label May 1, 2024
@corban-beaird
Copy link
Contributor

@cla-bot[bot] check

@cla-bot cla-bot bot added the cla-signed label May 1, 2024
Copy link

cla-bot bot commented May 1, 2024

The cla-bot has been summoned, and re-checked this pull request!

selection.rows,
users,
]);

const getHeaderMenuItems = (columnId: string, colIdx: number): MenuItem[] => {
if (columnId === MULTISELECT) {
const items: MenuItem[] = [
selection.rows.length > 0
settings.selection.type === 'ONLY_IN' && settings.selection.selections.length > 0
Copy link
Contributor

@ashtonG ashtonG May 1, 2024

Choose a reason for hiding this comment

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

Suggested change
settings.selection.type === 'ONLY_IN' && settings.selection.selections.length > 0
settings.selection.type === 'ALL_EXCEPT' || settings.selection.selections.length > 0

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

Comment on lines 266 to 268
const allSelectedExperimentIds = useMemo(() => {
return settings.selection.type === 'ONLY_IN' ? settings.selection.selections : [];
}, [settings.selection]);
Copy link
Contributor

@ashtonG ashtonG May 1, 2024

Choose a reason for hiding this comment

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

move this up to be a dependency of loadedSelectedExperimentIds

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@maxrussell maxrussell left a comment

Choose a reason for hiding this comment

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

Backend portion LGTM

const fetchExperimentsByIds = useCallback(async (selectedIds: number[]) => {
const CHUNK_SIZE = 80; // match largest pageSizeOption used for Pagination components
const chunkedExperimentIds = _.chunk(selectedIds, CHUNK_SIZE);
const responses = await Promise.all(
Copy link
Contributor

Choose a reason for hiding this comment

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

missing try catch

@johnkim-det johnkim-det merged commit f6e42cd into main May 2, 2024
86 of 99 checks passed
@johnkim-det johnkim-det deleted the ET-237 branch May 2, 2024 17:52
carolinaecalderon pushed a commit that referenced this pull request May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed to-cherry-pick Pull requests that need to be cherry-picked into the current release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants