[Improvement] – Add --queued flag to dvc exp push#11009
Open
BALOGUN-DAVID wants to merge 4 commits intotreeverse:mainfrom
Open
[Improvement] – Add --queued flag to dvc exp push#11009BALOGUN-DAVID wants to merge 4 commits intotreeverse:mainfrom
BALOGUN-DAVID wants to merge 4 commits intotreeverse:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11009 +/- ##
==========================================
+ Coverage 90.68% 91.00% +0.32%
==========================================
Files 504 506 +2
Lines 39795 41224 +1429
Branches 3141 3264 +123
==========================================
+ Hits 36087 37515 +1428
- Misses 3042 3070 +28
+ Partials 666 639 -27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[Improvement] – Add
--queuedflag todvc exp pushDescription
Context
Previously,
dvc exp pushcould only push completed experiments (resolved via experiment names, revisions, or--all-commits). Queued experiments — which are stored internally as Git stash commits managed by the Celery task queue — had no mechanism to be pushed to a remote Git repository. This meant that users working across multiple machines or collaborating in teams could not transfer their pending experiment queue to a shared remote, forcing them to re-queue experiments manually on each machine.Approach
This change introduces a
--queuedflag todvc exp pushthat pushes all currently queued experiments to a Git remote using temporary refs. The implementation spans 4 files (+104 lines):dvc/repo/experiments/refs.py — Added a new
CELERY_QUEUEconstant (refs/exps/celery/queue) to define the ref namespace for queued experiment refs.dvc/repo/experiments/push.py (core logic) —
queued: boolparameter to the push() function, which early-returns to the new _push_queued() helper whenTrue.repo.experiments.celery_queue.iter_queued()refs/exps/celery/queue/<stash_rev>) for each entry's stash commitpush_refspecs()with progress reportingfinallyblock to ensure no ref leakage{"queued": [...]}result dict with human-readable experiment namesdvc/commands/experiments/push.py (CLI layer) —
--queuedargparse flag (action="store_true")--queuedis set, the command dispatches to the queued push path, displays pushed experiment names using rich-styled output, and bypasses all other push logic (cache upload, rev selection, Studio notification)tests/unit/command/test_experiments.py — Added test_experiments_push_queued verifying CLI argument parsing and correct forwarding to the push() function.
Impact
dvc exp push <remote> --queuedto push all pending queued experiments to a Git remote. Supports--forceto overwrite existing remote refs.finally-based cleanup to guarantee temp ref removal even on push failure.Tests
Unit Tests Summary
--queued --forceCLI args are parsed correctly and forwarded to push() withqueued=True, force=True. Validates return code0with mocked{"queued": ["exp-1", "exp-2"]}result.Visual Evidence
Run Tests
Diff Summary
[ x] ❗ I have followed the Contributing to DVC checklist.
📖 If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. 🙏