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

Suppress context menus, hide run buttons and show stop button when an experiment is running #1848

Merged
merged 2 commits into from
Jun 7, 2022

Conversation

mattseddon
Copy link
Contributor

@mattseddon mattseddon commented Jun 7, 2022

Closes #1837.

The OP is that running an experiment through the terminal doesn't lead to the expected behaviour.

Description of what is going wrong:

We currently (try) to suppress all experiment commands when an experiment is running because they will fail due to a repo lock and/or give unexpected behaviour.

For everything in the extension this is based on the dvc.runner.running context which is dependant on the experiment being run through the runner. This is the bug and why the run buttons are still shown instead of the stop button.

For the webview we use the exp show data to suppress the context menu.

We can update so that both the exp show data and the runner contribute to the context value.

The change to replace dvc.runner running with a new dvc.experiment.running context value which is based on a combination of exp show data and the cliRunner status. If either show an experiment is running then we suppress context menus, hide run buttons and show the stop button.

Demo

Screen.Recording.2022-06-07.at.2.47.53.pm.mov
Screen.Recording.2022-06-07.at.2.50.00.pm.mov
Screen.Recording.2022-06-07.at.2.55.16.pm.mov

@mattseddon mattseddon added the bug Something isn't working label Jun 7, 2022
@mattseddon mattseddon self-assigned this Jun 7, 2022
@mattseddon mattseddon changed the title Change dvc.experiment.running context based on combination of exp show data and the cli runner status Suppress context menus, hide run buttons and stop stop button when an experiment is running Jun 7, 2022
@mattseddon mattseddon changed the title Suppress context menus, hide run buttons and stop stop button when an experiment is running Suppress context menus, hide run buttons and show stop button when an experiment is running Jun 7, 2022
hasCheckpoints
} = tableData

const someExperimentsRunning = React.useMemo(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

[F] Moved this back to the extension as we need it there to set the context value.

@mattseddon mattseddon marked this pull request as ready for review June 7, 2022 04:57
@mattseddon mattseddon force-pushed the hide-commands-when-exp-running branch from 23ca13c to cb87090 Compare June 7, 2022 04:58
@mattseddon mattseddon enabled auto-merge (squash) June 7, 2022 18:51
@codeclimate
Copy link

codeclimate bot commented Jun 7, 2022

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

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

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

View more on Code Climate.

@mattseddon mattseddon merged commit 936bf1e into main Jun 7, 2022
@mattseddon mattseddon deleted the hide-commands-when-exp-running branch June 7, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop button, context menu are not available if exp is running
3 participants