iterative / vscode-dvc

Machine learning experiment tracking and data versioning with DVC extension for VS Code
https://marketplace.visualstudio.com/items?itemName=Iterative.dvc
Apache License 2.0
197 stars 29 forks source link

Add basic "dvc add" workflow to DVC tracked panel #5037

Open shcheklein opened 1 year ago

shcheklein commented 1 year ago

For simpler onboarding (and tutorial) it would be handy to have a button like this. It can cover only new files (no complicated scenarios like adding files into a directory and such). + Icon and a "wizard" is enough It should cover a scenario when data is tracked by Git (it's needed to the onboarding tutorial). If this is too complicated we can postpone the whole feature since it won't move the needle at the moment most likely.

mattseddon commented 1 year ago

We already have the ability to add untracked files via the SCM panel:

https://github.com/iterative/vscode-dvc/assets/37993418/e155b812-a04e-4d4a-864b-ab61aa0dc4aa

and we do have "Add Data" via the tracked tree:

https://github.com/iterative/vscode-dvc/assets/37993418/4042158e-fe7d-4d60-affe-fe3bfa92f5b3

It does seem like a couple of days work to add this to the file explorer context menu as we will have to run some git commands up front in order to be able to run dvc add for files tracked by Git:

dvc add .github 
ERROR:  output '.github' is already tracked by SCM (e.g. Git).

    You can remove it from Git, then add to DVC.

        To stop tracking from Git:

            git rm -r --cached '.github'

            git commit -m "stop tracking .github" 

We also know how unstable things start getting when we chain commands together.

Other things to consider:

  1. show message if resource is already tracked by DVC.
  2. do not try to git rm files that are not tracked by Git.
  3. multi-project workspace with subprojects, need to work out which project to add to.