WIP: Add explicit `--fetch` flag to bst commands
Description
This introduces a new flag --fetch
that was mentioned in the mailing list.
Proposed changes
To put simply, this changes the following commands' behaviour so they'd not try to implicitly fetch junctions and elements (offline-first?).
-
bst {pull,push,track,checkout} element(s)
command- Before: Fetches the junction(s) if they are used and not cached yet.
- After: Don't do junction fetch implicitly. In case one is needed, error out by saying
need to fetch junction
.--fetch
is supplied tofetch_subprojects
.
-
bst source-bundle element
command- Before: (Possibly track and) fetch implicitly.
- After: Now we have 4 combinations in total (--fetch and --track)
- Only
--track
: Attempt track elements, error out if there is a new ref (since no--fetch
supplied, continue if there is nothing new. - Only
--fetch
: Fetch current refs for elements (including related junctions) - they might be cached already. -
--fetch
and--track
: Previous behaviour of the command with--track
, track for new refs if possible and fetch them. - No flags: error out if the current refs are not cached.
- Only
-
bst {workspace-open,workspace-reset} element.bst ..
We are interested in the cases whereno_checkout
is NOT used.- Before: Error out if junction(s) are required but not cached yet. Fetch for
element
is always done. Track before fetch can be requested using--track
. - After: Now we have 4 combinations in total (--fetch and --track)
- Only
--track
: Attempt track elements, error out if there is a new ref (since no--fetch
supplied, continue if there is nothing new. - Only
--fetch
: Fetch current refs for elements (including related junctions) - they might be cached already. -
--fetch
and--track
: Previous behaviour of the command with--track
, track for new refs if possible and fetch them. - No flags: error out if the current refs are not cached.
- Only
- Before: Error out if junction(s) are required but not cached yet. Fetch for
You can notice that the original behaviour of workspace commands are almost equivalent to source-bundle, except the latter implicitly fetches junctions where the former complains and terminates.
This merge request, when approved, will close: N/A at the moment.
Merge request reports
Activity
added 98 commits
-
7951f7f6...c7ac7e7d - 91 commits from branch
master
- 2975e27f - Add explicit fetch flag for 'bst pull' command
- 0d96fbca - Add explicit fetch flag for 'bst push' command
- 366844b8 - Add explicit fetch flag for 'bst track' command
- c21603e3 - Add explicit fetch flag for 'bst checkout' command
- 4807fc66 - Add explicit fetch flag for 'bst source-bundle'
- 5fb2ee60 - Add explicit fetch flag for 'bst workspace-open'
- 618a6cfe - Add explicit fetch flag for 'bst workspace-reset'
Toggle commit list-
7951f7f6...c7ac7e7d - 91 commits from branch
added 1 commit
- ca3b745b - fixup! Add explicit fetch flag for 'bst workspace-reset'
added 15 commits
-
d368a236...7f79b9ce - 8 commits from branch
master
- 3f15801c - Add explicit fetch flag for 'bst pull' command
- 28f53e33 - Add explicit fetch flag for 'bst push' command
- efff5259 - Add explicit fetch flag for 'bst track' command
- 781017b6 - Add explicit fetch flag for 'bst checkout' command
- 31f47d1f - Add explicit fetch flag for 'bst source-bundle'
- e35d54be - Add explicit fetch flag for 'bst workspace-open'
- 25578cec - Add explicit fetch flag for 'bst workspace-reset'
Toggle commit list-
d368a236...7f79b9ce - 8 commits from branch
added 1 commit
- 6cc4bfcb - fixup! Add explicit fetch flag for 'bst workspace-open'
To put simply, this changes the following commands' behaviour so they'd not try to implicitly fetch junctions and elements (offline-first?).
I think we want to be online-first, and have offline be the exception. We should be able to modify the behavior (through cli and configuration), but the defaults should work best for the common use case.
See https://mail.gnome.org/archives/buildstream-list/2018-October/msg00074.html for a bit more discussion. Maybe we need to expand there about implicit/explicit behavior in general.
added 132 commits
-
6cc4bfcb...abef70fe - 125 commits from branch
master
- 92067452 - Add no-fetch flag for 'bst pull' command
- bf827ed2 - Add no-fetch flag for 'bst push' command
- 834dc160 - Add no-fetch flag for 'bst track' command
- e00c5bc1 - Add no-fetch flag for 'bst checkout' command
- a45a40ff - Add no-fetch flag for 'bst source-bundle'
- dacfba35 - Add no-fetch flag for 'bst workspace-open'
- 1c45f727 - Add no-fetch flag for 'bst workspace-reset'
Toggle commit list-
6cc4bfcb...abef70fe - 125 commits from branch
Thank you @sstriker , I opened a
--no-fetch
version of the same changes athttps://gitlab.com/BuildStream/buildstream/merge_requests/970 and will close this now.