-
Notifications
You must be signed in to change notification settings - Fork 357
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
Conversation
✅ Deploy Preview for determined-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this 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
<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> |
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
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
filters !== undefined | ||
? `Move ${capitalize(entityName)}` | ||
: `Move ${capitalize(pluralizer.apply(null, [experimentIds.length, ...(f_flat_runs ? (['search', 'searches'] as const) : (['experiment'] as const))]))}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, about readability
There was a problem hiding this comment.
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.
There was a problem hiding this 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? |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'
const ExperimentCopyMap = { | ||
experiment: 'experiment', | ||
trial: 'trial', | ||
}; | ||
|
||
const RunCopyMap = { | ||
experiment: 'search', | ||
trial: 'run', | ||
}; | ||
|
There was a problem hiding this comment.
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'}`, |
There was a problem hiding this comment.
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}.`, |
There was a problem hiding this comment.
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}"
filters !== undefined | ||
? `Move ${capitalize(entityName)}` | ||
: `Move ${capitalize(pluralizer.apply(null, [experimentIds.length, ...(f_flat_runs ? (['search', 'searches'] as const) : (['experiment'] as const))]))}`; |
There was a problem hiding this comment.
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 ${ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
? 'Create New Run' | ||
: 'Create New Experiment...', |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
a1f69d0
to
4858c3c
Compare
f3ef800
to
10fe08a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good
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' })); |
There was a problem hiding this comment.
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 }
)
(cherry picked from commit 719f8be)
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
docs/release-notes/
See Release Note for details.