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

BF+TST: ephemeral clone to account for bare repo #4899

Merged
merged 3 commits into from Sep 10, 2020

Conversation

bpoldrack
Copy link
Member

Somehow we managed to ignore the intial usecase leading to the development of RIA stores and ephemeral clones! facepalm

This fixes clone to symlink an ephemeral clone's annex correctly, if origin is a bare repo.
Tests are enhanced in two ways:

  1. Test merely the right link in test_clone.py as this is all clone itself is concerned with.
  2. Add a new test file for usecases/workflows involving RIA stores and add the first one, which is an enhancement of what @dickscheid described in install --reckless ephemeral creates invalid link to remote annex if source is a bare repo #4893 in that it writes to the unlocked file in the clone and propagates everything back to origin via the store.

Ping @mih

In context of RIA stores it's important to be able to have an ephemeral
clone of a bare repository. clone --reckless=ephemeral didn't account
for that and symlinked into '.git/annex' of a bare repo, which is
invalid, of course.

Added test for correct symlinking of that clone option and another one
for an actual workflow involving a RIA store.

(Closes datalad#4893)
@bpoldrack bpoldrack changed the base branch from master to maint September 8, 2020 15:10
@bpoldrack bpoldrack requested a review from mih September 8, 2020 15:12
@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #4899 into maint will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #4899      +/-   ##
==========================================
+ Coverage   89.66%   89.67%   +0.01%     
==========================================
  Files         288      289       +1     
  Lines       40406    40477      +71     
==========================================
+ Hits        36230    36298      +68     
- Misses       4176     4179       +3     
Impacted Files Coverage Δ
datalad/interface/common_opts.py 100.00% <ø> (ø)
datalad/core/distributed/clone.py 88.75% <100.00%> (+0.13%) ⬆️
datalad/core/distributed/tests/test_clone.py 94.21% <100.00%> (+0.11%) ⬆️
datalad/distributed/tests/test_ria.py 100.00% <100.00%> (ø)
datalad/interface/diff.py 93.16% <0.00%> (-0.63%) ⬇️
datalad/core/distributed/push.py 89.15% <0.00%> (-0.43%) ⬇️
datalad/distribution/tests/test_publish.py 100.00% <0.00%> (ø)
datalad/core/distributed/tests/test_push.py 97.97% <0.00%> (+0.04%) ⬆️
datalad/distribution/publish.py 88.92% <0.00%> (+0.11%) ⬆️

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 7ae434f...0443519. Read the comment docs.

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

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

Thx, this will feel a painfull void. Left a few comment

# the path
# Note, that w/o support for bare repos in GitRepo we also
# can't use ConfigManager ATM.
from datalad.cmd import GitWitlessRunner, StdOutErrCapture
Copy link
Member

Choose a reason for hiding this comment

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

That is not true, and tested to be such:

def test_bare(path):

Copy link
Member Author

Choose a reason for hiding this comment

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

It is true. GitRepo can only "handle" a bare repo, that it is actively creating. It can't be instantiated on an existing one. And ConfigManager requires a repo instance.

Copy link
Member Author

@bpoldrack bpoldrack Sep 9, 2020

Choose a reason for hiding this comment

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

Just looked into fixing GitRepo/ConfigManager for it, since it seemed to work for creation. Conclusion: It doesn't! The test you pointed to is misleading. Doesn't actually read a bare repo's config. Instead it pretends to by first writing to it and then read out that value (into and from the wrong location, though).

I'll give it shot, but not within this PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

See PR #4911

datalad/core/distributed/tests/test_clone.py Outdated Show resolved Hide resolved
inodes needs to be minimized.
inodes needs to be minimized. Please note, that you might run into issues
when using this mode to link a bare (or any tuned annex) and a non-bare
repository that way, since their annex object trees are organized differently.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe: Using this mode with bare repositories (outside of a RIA store) or tuned repositories is not supported, because their annex object trees are organized differently.

It will not work. There is no uncertainty

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so. First of all: It is supported in that --reckless=ephemeral will do it's thing. Second, there is uncertainty, since you can have a tuned repo, using dirhashlower. It will work in that case. Third: At some point I tested, that a bare repo can actually deal with dirhashmixed keys in its object tree. It just wouldn't put it in there itself. So, if you use an ephemeral clone to write to it you can also read those keys from another clone. But the linked ephemeral clone can't handle existing dirhashlower objects in the bare repo.
All depends on the setup. Can work or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

But will add "outside RIA store" as a hint.

@bpoldrack
Copy link
Member Author

Failure in datalad-container is known and unrelated. And I'm pretty damn sure the one in crippledFS is unrelated, too (added it to the list).

Copy link
Member

@mih mih left a comment

Choose a reason for hiding this comment

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

Two exclamation marks?! I would still say that revealing the importance of dirhash_mixed or dirhash method equivalence is sufficient and appropriate, but this will do too.

@bpoldrack bpoldrack merged commit 44d798b into datalad:maint Sep 10, 2020
2 checks passed
@yarikoptic yarikoptic added this to the 0.13.5 milestone Dec 12, 2020
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.

None yet

3 participants