Skip to content

Run "dvc push" before running "git push"? #1765

Closed

Description

@seisman

pygmt/doc/contributing.md

Lines 640 to 641 in cd8dcef

git push
dvc push

The contributing guides tell that users should run git push then dvc push.

The problem is, when someone pushes changes to github (git push), the dvc-diff.yml workflow will be triggered immediately.

After the workflow starts, it will take about 45 seconds to set up everything and starts to pull images from DagsHub (i.e., running the dvc pull command). So it means that users must run dvc push quickly after running git push, otherwise the dvc-diff.yml workflow will fail.

From the commit message of e30c708, it seems that the order of dvc push and git push doesn't matter. I think running dvc push before git push is a better and safer option.

Activity

  1. added
    question
    on Mar 1, 2022
  2. maxrjones commented on Mar 1, 2022

    @maxrjones
    Member

    I think we should also add dvc status --remote upstream before dvc push as an option for checking that the appropriate files will be pushed.

  3. seisman commented on Mar 1, 2022

    @seisman
    MemberAuthor

    I think we should also add dvc status --remote upstream before dvc push as an option for checking that the appropriate files will be pushed.

    Sounds good.

  4. added
    documentation
    and removed
    question
    on Mar 1, 2022
  5. added this to the 0.6.0 milestone on Mar 1, 2022
  6. seisman commented on Mar 1, 2022

    @seisman
    MemberAuthor

    Do you have any idea what's the difference between dvc status and dvc status --remote upstream? They give different outputs for me and we use dvc status many times in the contributing guides.

    $ dvc status
    Data and pipelines are up to date.
    $ dvc status --remote upstream
    Cache and remote 'upstream' are in sync.
    
  7. maxrjones commented on Mar 1, 2022

    @maxrjones
    Member

    dvc status will tell you if there are differences between the "workspace" files and your local files in .dvc/cache while dvc status --remote upstream will tell you if there are differences between the files in your local .dvc/cache and the .dvc/cache of the remote repository set as upstream.

    For example, if you start with an up-to-date repository and run dvc status and dvc status --remote upstream you'll see the report that you mentioned above. If you were to then replace one of the dvc tracked image files inside pygmt/tests/baseline with a new file, the output from dvc status would change but the output from dvc status --remote upstream would not change (because the new file has not yet been added to your cache). If you were to then do dvc add following by committing the changed .dvc file to git, you would get Data and pipelines are up to date from dvc status and new information that the file is missing from the remote repository fromdvc status --remote upstream.

    As an aside, I generally find dvc diff more informative than dvc status. It does not matter as much for PyGMT with its 1:1 matching of .dvc files to images, but for GMT it reports much more helpful information about which specific files were changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions