Let push honor multiple publication dependencies declared via siblings #6869
Conversation
Multiple publication dependencies configured via `siblings()` are not honored by `push()`
The documentation for declaring publication dependencies allows for two different ways to declare multiple dependencies: 1. Declaring a single config item with a list of dependencies (space-separated) 2. Declaring a config item multiple times with a single dependency each. Previously `push()` only supported (1), while `siblings()` produced (2). This change lets `push()` handle both scenarios. Fixes datalad#6867 Thanks to @LoannPeurey for the report!
This is the analog change to datalad/datalad#6869
Codecov Report
@@ Coverage Diff @@
## maint #6869 +/- ##
==========================================
+ Coverage 90.25% 91.15% +0.89%
==========================================
Files 354 354
Lines 46113 46135 +22
==========================================
+ Hits 41621 42053 +432
+ Misses 4492 4082 -410
Continue to review full report at Codecov.
|
| # multiple dependencies could come from multiple declarations | ||
| # of such a config items, but each declaration could also | ||
| # contain a white-space separated list of remote names | ||
| # see https://github.com/datalad/datalad/issues/6867 |
There was a problem hiding this comment.
where do we document/allow for a white-space separated list of names?
Rationale for asking: Indeed ATM git does not allow white-space in the name of the remote, and it seems we do not "disallowed" it explicitly since just allow for git to error out:
$> datalad siblings add -s "my name" --url https://example.com
CommandError: 'git -c diff.ignoreSubmodules=none remote add 'my name' https://example.com' failed with exitcode 128
fatal: 'my name' is not a valid remote nameso if in the future git for some reason decides to support that (unlikely, but not impossible IMHO) such splitting by space might become buggy. So I wondered to ask where we already document/allow for that, and may be we should add some explicit checking for the name to not contain spaces (since could lead to fail of this added logic)
There was a problem hiding this comment.
Hmm, I cannot find a user-facing documentation that made me conclude that we allow(ed) for this. Maybe it was a comment, but I cannot find that either.
There was a problem hiding this comment.
then since we didn't have that documented, and looking at original code above and behavior of ensure_list:
$> python -c 'from datalad.utils import ensure_list; print(ensure_list("w1 w2"))'
['w1 w2']that it doesn't split by space, I think we never had such a feature -- should we really add it along with this? may be just a matter of adding get_all=True and be done?
There was a problem hiding this comment.
@bpoldrack shines the archaeological light on the situation. We used to have get return all values by default, that caused issues, so get_all=False was introduced and thus broke prior behavior here which was to have all of the siblings pushed to (I guess the test didn't test for multiple). So I will push here a commit which replaces all the above with simple addition of get_all=True.
@bpoldrack shines the archaeological light on the situation. We used to have get return all values by default, that caused issues, so get_all=False was introduced and thus broke prior behavior here which was to have all of the siblings pushed to (I guess the test didn't test for multiple). So I will push here a commit which replaces all the above with simple addition of get_all=True.
|
2 travis fails known, one is something to note -- might need |
|
with all of the above in mind, let's proceed ! |
The documentation for declaring publication dependencies allows for two different ways to declare multiple dependencies:
Previously
push()only supported (1), whilesiblings()produced (2).This change lets
push()handle both scenarios.Fixes #6867
Thanks to @LoannPeurey for the report!