Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: push since='' -> push --since='^' #4617

Merged
merged 2 commits into from Jun 11, 2020
Merged

RF: push since='' -> push --since='^' #4617

merged 2 commits into from Jun 11, 2020

Conversation

mih
Copy link
Member

@mih mih commented Jun 9, 2020

Implements the decision made in gh-4582 to use this character as a more
intuitive alternative than an empty string.

Fixes gh-4582

Implements the decision made in dataladgh-4582 to use this character as a more
intuitive alternative than an empty string.

Fixes dataladgh-4582
@mih mih added this to the 0.13.0 milestone Jun 9, 2020
@mih
Copy link
Member Author

mih commented Jun 9, 2020

======================================================================
ERROR: datalad.core.distributed.tests.test_push.test_push(True,)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/tests/utils.py", line 714, in newfunc
    return t(*(arg + (filename,)), **kw)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/tests/utils.py", line 714, in newfunc
    return t(*(arg + (filename,)), **kw)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/core/distributed/tests/test_push.py", line 167, in check_push
    res = src.push(to='target', since="^", jobs=2)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/distribution/dataset.py", line 498, in apply_func
    return f(**kwargs)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/interface/utils.py", line 494, in eval_func
    return return_func(generator_func)(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/interface/utils.py", line 482, in return_func
    results = list(results)
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/interface/utils.py", line 413, in generator_func
    allkwargs):
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/interface/utils.py", line 552, in _process_results
    for res in results:
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/core/distributed/push.py", line 246, in __call__
    for dspath, dsrecords in ds_spec:
  File "/opt/hostedtoolcache/Python/3.5.9/x64/lib/python3.5/site-packages/datalad/core/distributed/push.py", line 316, in _datasets_since_
    'Cannot handle non-OK diff result: {}'.format(res))
RuntimeError: Cannot handle non-OK diff result: {'action': 'diff', 'status': 'impossible', 'refds': '/crippledfs/datalad_temp_check_push_g146xa0', 'path': '/crippledfs/datalad_temp_check_push_g146xa0', 'message': "Git reference 'target/adjusted/master(unlocked)' invalid", 'logger': <logging.Logger object at 0x7f9efe134fd0>}

I can replicate that locally. Real bug, stupid, and should be fixed now.

Otherwise we would require managed branches on either end.
@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #4617 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4617      +/-   ##
==========================================
+ Coverage   89.53%   89.55%   +0.01%     
==========================================
  Files         286      286              
  Lines       38822    38822              
==========================================
+ Hits        34760    34767       +7     
+ Misses       4062     4055       -7     
Impacted Files Coverage Δ
datalad/core/distributed/push.py 89.13% <100.00%> (+3.04%) ⬆️
datalad/core/distributed/tests/test_push.py 99.32% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b2cea75...efeb7d3. Read the comment docs.

@@ -114,8 +114,8 @@ class Push(Interface):
constraints=EnsureStr() | EnsureNone(),
doc="""specifies commit-ish (tag, shasum, etc.) from which to look for
changes to decide whether pushing is necessary.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"whether"! I feel you now!

If an empty string is given, the last state of the current branch
at the sibling is taken as a starting point."""),
If '^' is given, the last state of the current branch at the sibling
is taken as a starting point."""),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

starting point for what? Unrelated to the intent of this PR, so I will just approve as is, but this option might need further explanation of "its purpose in life" - that unlike git " Using this option allows to avoid considering subdatasets where no changes were made since the that starting point" or alike

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# figure out state of remote branch and set `since`
since = _get_corresponding_remote_state(ds_repo, to)
if not since:
lgr.info(
"No tracked remote for active branch, "
"detection of last pushed state not in effect.")
elif since:
# will blow with ValueError if unusable
ds_repo.get_hexsha(since)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to the comment this suggestion

Suggested change
ds_repo.get_hexsha(since)
since = ds_repo.get_hexsha(since)

is probably (who knows what helper functions do/report) is necessary. Just a note to myself then

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would turn a potentially symbolic ref into a hexsha and make subsequent log messages harder to decode. I'd rather not do that.

@mih mih merged commit 3360cc1 into datalad:master Jun 11, 2020
@mih mih deleted the bf-4582 branch June 11, 2020 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Q: push --since setup
3 participants