-
Notifications
You must be signed in to change notification settings - Fork 28
Share an experiment from context menus #2219
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bc9a883
refactor workspace internals in order to add new capability
mattseddon 61432a1
temp update branch command to share experiment
mattseddon 8ec02a6
change dep to data/MNIST/raw
mattseddon 2d501eb
add share experiment command
mattseddon 7a12eb4
add share experiment into experiments table
mattseddon 5203377
make conditions more readable
mattseddon cf0f31b
reinstate branch experiment into context menus
mattseddon 73ab5e4
show share experiment for experiments and checkpoints
mattseddon cdcb258
match context menu in tree to table
mattseddon 63b692e
add integration test
mattseddon 8d6dc49
add webview unit test
mattseddon 2fdb286
remove duplicate test
mattseddon 335c8b9
rename to share as branch
mattseddon f19b7c3
rename constants
mattseddon 04be7a0
match function signatures
mattseddon a621b3f
fix command text in tree
mattseddon 3c181e5
revert dvc.yaml
mattseddon 9b025f7
Merge branch 'main' into share-experiment
mattseddon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,9 @@ import { | |
| RegisteredCommands | ||
| } from '../../commands/external' | ||
| import { Title } from '../../vscode/title' | ||
| import { gitPushBranch } from '../../git' | ||
| import { Toast } from '../../vscode/toast' | ||
| import { Args } from '../../cli/constants' | ||
|
|
||
| type ExperimentDetails = { dvcRoot: string; id: string } | ||
|
|
||
|
|
@@ -153,7 +156,12 @@ const registerExperimentInputCommands = ( | |
| RegisteredCliCommands.EXPERIMENT_BRANCH, | ||
| () => | ||
| experiments.getCwdExpNameAndInputThenRun( | ||
| AvailableCommands.EXPERIMENT_BRANCH, | ||
| (cwd, ...args: Args) => | ||
| experiments.runCommand( | ||
| AvailableCommands.EXPERIMENT_BRANCH, | ||
| cwd, | ||
| ...args | ||
| ), | ||
| Title.ENTER_BRANCH_NAME | ||
| ) | ||
| ) | ||
|
|
@@ -162,7 +170,38 @@ const registerExperimentInputCommands = ( | |
| RegisteredCliCommands.EXPERIMENT_VIEW_BRANCH, | ||
| ({ dvcRoot, id }: ExperimentDetails) => | ||
| experiments.getExpNameAndInputThenRun( | ||
| AvailableCommands.EXPERIMENT_BRANCH, | ||
| (name: string, input: string) => | ||
| experiments.runCommand( | ||
| AvailableCommands.EXPERIMENT_BRANCH, | ||
| dvcRoot, | ||
| name, | ||
| input | ||
| ), | ||
| Title.ENTER_BRANCH_NAME, | ||
| dvcRoot, | ||
| id | ||
| ) | ||
| ) | ||
|
|
||
| internalCommands.registerExternalCliCommand( | ||
| RegisteredCliCommands.EXPERIMENT_VIEW_SHARE_AS_BRANCH, | ||
| ({ dvcRoot, id }: ExperimentDetails) => | ||
| experiments.getExpNameAndInputThenRun( | ||
| async (name: string, input: string) => { | ||
| await experiments.runCommand( | ||
| AvailableCommands.EXPERIMENT_BRANCH, | ||
| dvcRoot, | ||
| name, | ||
| input | ||
| ) | ||
| await experiments.runCommand( | ||
| AvailableCommands.EXPERIMENT_APPLY, | ||
| dvcRoot, | ||
| name | ||
| ) | ||
| await experiments.runCommand(AvailableCommands.PUSH, dvcRoot) | ||
| return Toast.showOutput(gitPushBranch(dvcRoot, input)) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [C] This makes me think that we should be showing all of the git commands that we run inside of our DVC output channel. I will follow up and give Git its own reader/executor. |
||
| }, | ||
| Title.ENTER_BRANCH_NAME, | ||
| dvcRoot, | ||
| id | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.