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

chore: run bulk action interstitial component #9390

Merged

Conversation

ashtonG
Copy link
Contributor

@ashtonG ashtonG commented May 20, 2024

Ticket

ET-94

Description

this adds an interstitial component for run bulk actions. when opened, it runs a search given the current selection and filters and determines whether or not the selection contains any runs that are part of a search, returning the results to the opener. as a side effect, we pull out the mergeAbortControllers helper from trialDetailsLogs while also adding test coverage to that helper.

Test Plan

Component is not currently user-facing. Unit tests should comprehensively check functionality.

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.

@ashtonG ashtonG requested a review from a team as a code owner May 20, 2024 15:27
@cla-bot cla-bot bot added the cla-signed label May 20, 2024
Copy link

netlify bot commented May 20, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit bc9d056
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66589e12aa35bb0008713e37
😎 Deploy Preview https://deploy-preview-9390--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.

@ashtonG ashtonG requested review from keita-determined and removed request for thiagodallacqua-hpe May 20, 2024 15:28
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.

i wasnt sure how to use the modal on local, i'll reach out to you tomorrow

@@ -6,7 +6,7 @@ import { useCallback, useEffect } from 'react';
export type onInterstitialCloseActionType = (reason: 'ok' | 'close' | 'failed') => void;

interface Props<T> {
onCloseAction: (reason: 'ok' | 'close' | 'failed') => void;
onCloseAction: onInterstitialCloseActionType;
Copy link
Contributor

Choose a reason for hiding this comment

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

oops, nice improvement!

const { lastCall } = vi.mocked(searchRuns).mock;
const filterFormSetString = lastCall?.[0].filter;
expect(filterFormSetString).toBeDefined();
const filterFormSet = JSON.parse(filterFormSetString || '');
Copy link
Contributor

Choose a reason for hiding this comment

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

can we add type here? prob FilterFormSetWithoutId?

const onCloseAction = vi.fn();
userEvent.setup();

const view = render(
Copy link
Contributor

Choose a reason for hiding this comment

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

super nit: can we get rid of view?

);

return (
<InterstitialModal.Component
Copy link
Contributor

Choose a reason for hiding this comment

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

qq: this does not show the modal like the one in the ticket, right? will the modal be implemented in this PR?

export interface Props {
projectId?: number;
selection: SelectionType;
filterFormSet: FilterFormSetWithoutId;
Copy link
Contributor

Choose a reason for hiding this comment

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

FormSet doesn't have a function to return FilterFormSetWithoutId directly. can we use FilterFormSet because it's easier to pass it? but that will affect testing data...

Copy link

codecov bot commented May 28, 2024

Codecov Report

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

Project coverage is 49.28%. Comparing base (6919563) to head (31a4aec).

Additional details and impacted files
@@                        Coverage Diff                         @@
##           feature/actions-flat-run-table    #9390      +/-   ##
==================================================================
+ Coverage                           48.61%   49.28%   +0.66%     
==================================================================
  Files                                1235     1238       +3     
  Lines                              159575   159804     +229     
  Branches                             2810     2851      +41     
==================================================================
+ Hits                                77574    78754    +1180     
+ Misses                              81827    80878     -949     
+ Partials                              174      172       -2     
Flag Coverage Δ
backend 42.14% <ø> (ø)
harness 64.08% <ø> (ø)
web 45.96% <98.36%> (+1.56%) ⬆️

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

Files Coverage Δ
...eact/src/components/InterstitialModalComponent.tsx 100.00% <100.00%> (+100.00%) ⬆️
.../react/src/pages/TrialDetails/TrialDetailsLogs.tsx 15.60% <100.00%> (+0.47%) ⬆️
webui/react/src/utils/mergeAbortControllers.ts 100.00% <100.00%> (ø)
...ct/src/components/RunMoveWarningModalComponent.tsx 98.14% <98.14%> (ø)
...components/RunFilterInterstitialModalComponent.tsx 98.21% <98.21%> (ø)

... and 9 files with indirect coverage changes

@ashtonG ashtonG force-pushed the feat/ET-94/bulk-action-interstitial branch from 9aa0224 to 42c5b29 Compare May 28, 2024 16:52
@keita-determined keita-determined mentioned this pull request May 29, 2024
4 tasks
@ashtonG ashtonG force-pushed the feat/ET-94/bulk-action-interstitial branch from 42c5b29 to bc9d056 Compare May 30, 2024 15:41
@ashtonG ashtonG requested a review from a team as a code owner May 30, 2024 15:41
@ashtonG ashtonG requested a review from erikwilson May 30, 2024 15:41
@ashtonG ashtonG changed the base branch from main to feature/actions-flat-run-table May 30, 2024 17:04
@ashtonG ashtonG removed request for a team and erikwilson May 30, 2024 17:05
@ashtonG ashtonG force-pushed the feat/ET-94/bulk-action-interstitial branch from bc9d056 to 368958d Compare May 30, 2024 17:09
ashtonG and others added 5 commits May 30, 2024 16:07
this adds an interstitial component for run bulk actions. when opened,
it runs a search given the current selection and filters and determines
whether or not the selection contains any runs that are part of a
search, returning the results to the opener. as a side effect, we pull
out the `mergeAbortControllers` helper from `trialDetailsLogs` while
also adding test coverage to that helper.
@ashtonG ashtonG force-pushed the feat/ET-94/bulk-action-interstitial branch from a7226a0 to 31a4aec Compare May 30, 2024 20:07
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.

LGTM

The usage of this is

  • call RunFilterInterstitialModalComponent first
  • get the close reason
  • if statement
    • show RunMoveWarningModalComponent when has_search_runs is returned
    • show move modal when no_search_runs is returned without showing RunMoveWarningModalComponent
    • show error message when failed is retuend

is that correct?

@ashtonG
Copy link
Contributor Author

ashtonG commented May 31, 2024

i think we should show the move modal first -- that way we defer the check until after the user confirms the details of the move.

@keita-determined
Copy link
Contributor

got it. if its ready to get merged, could you merge it to work on the move action?

@ashtonG ashtonG merged commit faf66e2 into feature/actions-flat-run-table Jun 3, 2024
81 of 94 checks passed
@ashtonG ashtonG deleted the feat/ET-94/bulk-action-interstitial branch June 3, 2024 14:16
keita-determined added a commit that referenced this pull request Jun 3, 2024
keita-determined added a commit that referenced this pull request Jun 4, 2024
keita-determined added a commit that referenced this pull request Jun 5, 2024
keita-determined added a commit that referenced this pull request Jun 7, 2024
keita-determined added a commit that referenced this pull request Jun 10, 2024
keita-determined added a commit that referenced this pull request Jun 11, 2024
keita-determined added a commit that referenced this pull request Jun 13, 2024
keita-determined added a commit that referenced this pull request Jun 14, 2024
keita-determined added a commit that referenced this pull request Jun 14, 2024
keita-determined added a commit that referenced this pull request Jun 17, 2024
keita-determined added a commit that referenced this pull request Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants