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

Highlight experiments with errors #2072

Merged
merged 12 commits into from
Jul 21, 2022
Merged

Highlight experiments with errors #2072

merged 12 commits into from
Jul 21, 2022

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Jul 20, 2022

This PR contains the first iteration of #1636.

Users will now be able to see experiment errors in the UI.

Demo

Screen.Recording.2022-07-21.at.1.06.00.pm.mov

Things to note:

  1. We are not suppressing the selection of an experiment for plotting even if the experiment is completely broken.
  2. We are currently not highlighting experiment errors in the plots webview. This will be covered under Handle DVC errors gracefully in plots #1649.
  3. I updated the test fixture to contain error records which blew out the size of this PR (+~200 is for the test fixture by itself).
  4. Styles match between the webview and the tree.
  5. Errors cannot currently be filtered from the experiments table due to the hack we put in to stop queued items from being filtered by missing metrics.

@mattseddon mattseddon added the product PR that affects product label Jul 20, 2022
@mattseddon mattseddon self-assigned this Jul 20, 2022
@mattseddon mattseddon changed the title Show experiment errors Highlight experiments with errors Jul 20, 2022
@mattseddon mattseddon force-pushed the display-exp-errors branch from f2cdb71 to 2b2076a Compare July 20, 2022 09:42
const error = [
...(metricsData?.errors || []),
...(paramsData?.errors || [])
].join('\n')
Copy link
Member Author

Choose a reason for hiding this comment

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

[I] Test this bit and the tooltip showing up in the UI as markdown.

@@ -95,7 +95,7 @@ suite('Experiments Filter By Tree Test Suite', () => {
)
})
.map(experiment =>
experiment.queued
experiment.queued || experiment.error
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] This points out that the way we don't filter queued will spill over onto error records. You cannot filter by an undefined value which means that "full error" records will be "unfilterable".

@@ -16,19 +16,20 @@ export interface DepColumns {
}

export interface Experiment extends BaseExperimentFields {
deps?: DepColumns
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Sorted and added error?: string


const data = excludeErrors()

export default data
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Without this extra fixture there would be a lot of changes to plots tests which are currently unrelated to this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

And this is why the likes of extension/src/test/suite/plots/index.test.ts are now pointed at this.

Copy link
Member Author

Choose a reason for hiding this comment

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

When I come back to do plots errors I should be able to remove this. As we'll want to highlight the behaviour that we can have experiment errors but still try to plot those experiments.

@@ -0,0 +1,22 @@
import React from 'react'
Copy link
Member Author

Choose a reason for hiding this comment

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

[Q] Better placement for this? Should it be a shared component? We will probably use something very similar for plots.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can move it in the shared folder when it's used in both webviews.

@@ -16,7 +16,7 @@ import { ExperimentsData } from './data'
import { askToDisableAutoApplyFilters } from './toast'
import { Experiment, ColumnType, TableData } from './webview/contract'
import { WebviewMessages } from './webview/messages'
import { DecorationProvider } from './model/filterBy/decorationProvider'
import { DecorationProvider } from './model/decorationProvider'
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Move to a more central location as the decorations are now for both errors and filtered experiments

@@ -38,19 +43,27 @@ export class DecorationProvider
}

public provideFileDecoration(uri: Uri): FileDecoration | undefined {
if (this.errors.has(uri.fsPath)) {
return DecorationProvider.DecorationError
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] Take priority but under the current implementation, we can't have both.

[errorShas[0]]: {
error: {
type: 'YAMLFileCorruptedError',
msg: "unable to read: 'params.yaml', YAML file structure is corrupted"
Copy link
Member Author

Choose a reason for hiding this comment

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

[F] The fixture now contains one "full error" and one "partial error".

@mattseddon mattseddon marked this pull request as ready for review July 21, 2022 03:21
@mattseddon mattseddon requested review from maxagin and shcheklein July 21, 2022 03:21
@maxagin
Copy link
Contributor

maxagin commented Jul 21, 2022

Styles match between the webview and the tree.

@mattseddon this is only for now? Right? Will we have the styles for the table as we planned?

@mattseddon
Copy link
Member Author

Styles match between the webview and the tree.

@mattseddon this is only for now? Right? Will we have the styles for the table as we planned?

I have implemented everything as per my latest comments in the spec. The main point here is to highlight to users that there is an error and give them information about the error. We can adjust later when we get plot errors or user feedback.

@@ -0,0 +1,22 @@
import React from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

We can move it in the shared folder when it's used in both webviews.

@@ -0,0 +1,21 @@
import * as React from 'react'
Copy link
Contributor

Choose a reason for hiding this comment

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

We decided to remove theAllIcons enum that gave us the ability to view all available icons since it was duplicating the index file in the icons folder. We should either export this inside the index file or simply remove the index file.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we have a couple of other direct imports. I'll track them down today and move all imports to come from the index file. Let me know if you'd like to go the other way.

@codeclimate
Copy link

codeclimate bot commented Jul 21, 2022

Code Climate has analyzed commit 6008904 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 94.8% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.7% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 743f826 into main Jul 21, 2022
@mattseddon mattseddon deleted the display-exp-errors branch July 21, 2022 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants