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: update copy when f_flat_runs is on #9642

Merged
merged 15 commits into from
Jul 26, 2024
Merged

Conversation

ashtonG
Copy link
Contributor

@ashtonG ashtonG commented Jul 11, 2024

Ticket

ET-572

Description

This updates the copy in the app when the flat runs feature is on. Places accessible in the app when flat runs is on should refer to searches and runs instead of experiments and trials.

Test Plan

when viewing the applcation with the f_flat_runs feature on, the user should not see the words "experiment" or "trial".

Checklist

  • Changes have been manually QA'd
  • New features have been approved by the corresponding PM
  • User-facing API changes have the "User-facing API Change" label
  • Release notes have been added as a separate file under docs/release-notes/
    See Release Note for details.
  • Licenses have been 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 July 11, 2024 19:52
@cla-bot cla-bot bot added the cla-signed label Jul 11, 2024
Copy link

netlify bot commented Jul 11, 2024

Deploy Preview for determined-ui ready!

Name Link
🔨 Latest commit 3275041
🔍 Latest deploy log https://app.netlify.com/sites/determined-ui/deploys/66a3cf1a2d9cc90008421a27
😎 Deploy Preview https://deploy-preview-9642--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

codecov bot commented Jul 11, 2024

Codecov Report

Attention: Patch coverage is 67.60563% with 161 lines in your changes missing coverage. Please review.

Project coverage is 49.91%. Comparing base (7260f04) to head (3275041).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9642      +/-   ##
==========================================
- Coverage   53.44%   49.91%   -3.54%     
==========================================
  Files        1257      934     -323     
  Lines      154350   125265   -29085     
  Branches     3298     3476     +178     
==========================================
- Hits        82494    62521   -19973     
+ Misses      71706    62598    -9108     
+ Partials      150      146       -4     
Flag Coverage Δ
harness ?
web 53.60% <67.60%> (+1.67%) ⬆️

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

Files Coverage Δ
webui/react/src/components/CheckpointModal.tsx 80.26% <100.00%> (+2.44%) ⬆️
...rc/components/CompareHyperparameters.test.mock.tsx 100.00% <100.00%> (ø)
...ui/react/src/components/CompareHyperparameters.tsx 96.47% <100.00%> (+4.06%) ⬆️
...bui/react/src/components/ExperimentCreateModal.tsx 81.58% <100.00%> (+4.11%) ⬆️
webui/react/src/components/ProjectCard.tsx 100.00% <100.00%> (ø)
webui/react/src/components/Searches/columns.ts 50.40% <100.00%> (ø)
...ui/react/src/pages/Cluster/ClusterOverallStats.tsx 89.55% <100.00%> (+0.15%) ⬆️
webui/react/src/pages/TrialDetails/TrialChart.tsx 82.73% <100.00%> (+63.46%) ⬆️
...ebui/react/src/pages/TrialDetails/TrialInfoBox.tsx 89.25% <100.00%> (+0.08%) ⬆️
...bui/react/src/components/ExperimentDeleteModal.tsx 84.31% <80.00%> (+0.98%) ⬆️
... and 36 more

... and 340 files with indirect coverage changes

@ashtonG ashtonG requested a review from EmilyBonar July 12, 2024 13:37
Copy link
Contributor

@thiagodallacqua-hpe thiagodallacqua-hpe left a comment

Choose a reason for hiding this comment

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

Looking good overall, just a few comments on readability and it would be nice to add a few test cases for all these new content/logic added here

Comment on lines 452 to 460
<Body>
{!modalIsInAdvancedMode
? isReactivate
? `Reactivate and continue the current ${entityCopyMap.trial} from the latest checkpoint`
: f_flat_runs
? "Start a new run from the current run's latest checkpoint"
: "Start a new experiment from the current trial's latest checkpoint"
: undefined}
</Body>
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a lot of new code here without coverage as well 😅

Copy link
Contributor

Choose a reason for hiding this comment

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

also, this is really tricky to read... maybe create a function with if... else to improve the readability

Comment on lines 146 to 148
filters !== undefined
? `Move ${capitalize(entityName)}`
: `Move ${capitalize(pluralizer.apply(null, [experimentIds.length, ...(f_flat_runs ? (['search', 'searches'] as const) : (['experiment'] as const))]))}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, about readability

Copy link
Contributor

Choose a reason for hiding this comment

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

This one is pretty rough, especially all on one line.

Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

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

Good start, and I know how annoying a job this is!

@@ -241,6 +241,7 @@ export const getColumnDefs = ({
tooltip: () => undefined,
width: columnWidths.experimentName ?? defaultColumnWidths.experimentName ?? MIN_COLUMN_WIDTH,
},
// TODO: should this change to search?
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, probably, for consistency

@@ -431,7 +433,8 @@ const ModelDetails: React.FC = () => {
<div className={css.noVersions}>
<p className={css.header}>No Model Versions</p>
<p className={css.subtext}>
Register a checkpoint from an experiment to add it to this model
Register a checkpoint from an {f_flat_runs ? 'run' : 'experiment'} to add it to this
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: 'an run' -> 'a run'

Comment on lines +55 to +64
const ExperimentCopyMap = {
experiment: 'experiment',
trial: 'trial',
};

const RunCopyMap = {
experiment: 'search',
trial: 'run',
};

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: since we're standardizing on run/search terminology, maybe we should use those terms to index the maps instead of trial/experiment

@@ -241,7 +259,7 @@ const TrialDetailsComp: React.FC = () => {
path: paths.workspaceDetails(experiment?.workspaceId ?? 1),
}
: {
breadcrumbName: 'Uncategorized Experiments',
breadcrumbName: `Uncategorized ${f_flat_runs ? 'Experiments' : 'Runs'}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might as well use copyMap

@@ -50,14 +52,14 @@ const TrialChart: React.FC<Props> = ({
setTrialSummary(Loaded(summary[0].metrics));
} catch (e) {
handleError(e, {
publicMessage: `Failed to load trial summary for trial ${trialId}.`,
publicSubject: 'Trial summary fail to load.',
publicMessage: `Failed to load ${f_flat_runs ? 'run' : 'trial'} summary for trial ${trialId}.`,
Copy link
Contributor

Choose a reason for hiding this comment

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

fix: need to replace second instance of 'trial'. could also cut out the first instance and go with "Failed to load summary for [trial/run] ${id}"

Comment on lines 146 to 148
filters !== undefined
? `Move ${capitalize(entityName)}`
: `Move ${capitalize(pluralizer.apply(null, [experimentIds.length, ...(f_flat_runs ? (['search', 'searches'] as const) : (['experiment'] as const))]))}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is pretty rough, especially all on one line.

severity: 'Error',
title: 'Retain Logs Failure',
});
} else {
openToast({
closeable: true,
description: `Failed to retain logs for ${numFailures} experiments out of ${
description: `Failed to retain logs for ${numFailures} ${pluralize(2)} out of ${
Copy link
Contributor

Choose a reason for hiding this comment

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

fix: not sure why that 2 is there, I believe it should be numFailures

@@ -24,6 +25,9 @@ interface Props {

const ExperimentStopModalComponent: React.FC<Props> = ({ experimentId, onClose }: Props) => {
const [type, setType] = useState<AvalableActions>(ActionType.Cancel);
const f_flat_runs = useFeature().isOn('flat_runs');

const buttonText = f_flat_runs ? 'Stop Search' : BUTTON_TEXT;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this feels like a footgun for a test that relies on BUTTON_TEXT failing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there's nothing importing BUTTON_TEXT from this module, would it make sense to inline?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, if BUTTON_TEXT isn't being used then definitely

Comment on lines 313 to 314
? 'Create New Run'
: 'Create New Experiment...',
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: these should both or neither end in ..., unless I'm missing that the Run version doesn't open a modal

@@ -302,7 +308,7 @@ export const TrialsComparisonTable: React.FC<TableProps> = ({
{Array.isArray(experiment) && (
<>
<tr>
<th scope="row">Experiment ID</th>
<th scope="row">{f_flat_runs ? 'Search' : 'Experiment'} ID</th>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might as well use entityName

@ashtonG ashtonG force-pushed the fix/ET-572/run-ux-copy branch 2 times, most recently from a1f69d0 to 4858c3c Compare July 22, 2024 19:33
Copy link
Contributor

@EmilyBonar EmilyBonar left a comment

Choose a reason for hiding this comment

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

Overall looks good

webui/react/src/components/ExperimentStopModal.tsx Outdated Show resolved Hide resolved
webui/react/src/components/CheckpointModal.test.tsx Outdated Show resolved Hide resolved
it('submits a valid cancel experiment request', async () => {
await setup();

await user.click(screen.getByRole('button', { name: BUTTON_TEXT }));
await user.click(screen.getByRole('button', { name: 'Stop Experiment' }));
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use fuzzy matching ({ name: 'Stop', exact: false })

webui/react/src/components/ExperimentStopModal.test.tsx Outdated Show resolved Hide resolved
@ashtonG ashtonG added the to-cherry-pick Pull requests that need to be cherry-picked into the current release label Jul 26, 2024
@ashtonG ashtonG merged commit 719f8be into main Jul 26, 2024
81 of 96 checks passed
@ashtonG ashtonG deleted the fix/ET-572/run-ux-copy branch July 26, 2024 17:26
github-actions bot pushed a commit that referenced this pull request Jul 26, 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.

3 participants