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: Sibling setup missed update-server-info #5531

Merged
merged 4 commits into from Mar 26, 2021
Merged

Conversation

bpoldrack
Copy link
Member

create-sibling-ria missed out on calling git update-server-info after
setting up the remote repository. This would result in an unsuccessful
fetch at the end and would need a push to be fixed (since post update
hook is enabled).

Closes #5530

create-sibling-ria missed out on calling `git update-server-info` after
setting up the remote repository. This would result in an unsuccessful
fetch at the end and would need a push to be fixed (since post update
hook is enabled).

Closes datalad#5530
@bpoldrack bpoldrack changed the base branch from master to maint March 25, 2021 13:54
@codecov
Copy link

codecov bot commented Mar 25, 2021

Codecov Report

Merging #5531 (1db49c6) into maint (bc80aba) will decrease coverage by 0.56%.
The diff coverage is 90.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #5531      +/-   ##
==========================================
- Coverage   90.17%   89.61%   -0.57%     
==========================================
  Files         296      296              
  Lines       42022    42027       +5     
==========================================
- Hits        37895    37664     -231     
- Misses       4127     4363     +236     
Impacted Files Coverage Δ
datalad/distributed/create_sibling_ria.py 82.35% <80.00%> (+1.63%) ⬆️
...talad/distributed/tests/test_create_sibling_ria.py 100.00% <100.00%> (ø)
datalad/support/due.py 48.00% <0.00%> (-32.00%) ⬇️
datalad/ui/utils.py 56.25% <0.00%> (-21.88%) ⬇️
datalad/metadata/extractors/tests/test_base.py 87.80% <0.00%> (-12.20%) ⬇️
datalad/metadata/extractors/tests/test_xmp.py 88.46% <0.00%> (-11.54%) ⬇️
datalad/metadata/extractors/tests/test_image.py 88.46% <0.00%> (-11.54%) ⬇️
datalad/support/archive_utils_patool.py 29.87% <0.00%> (-10.39%) ⬇️
datalad/metadata/tests/test_extract_metadata.py 91.11% <0.00%> (-8.89%) ⬇️
datalad/metadata/extractors/tests/test_exif.py 92.00% <0.00%> (-8.00%) ⬇️
... and 57 more

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 bc80aba...1db49c6. Read the comment docs.

# Conditional on post_update_hook, since one w/o the other doesn't
# seem to make much sense.
subprocess.run("git update-server-info",
cwd=quote_cmdlinearg(ds.path))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the value for cwd should be quoted.

(Also, I suppose call_git could be used here?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. I just thought for the bugfix I'll keep it consistent within the rest of the implementation. The command itself will have to go through some refactoring anyway. Then those kind of changes can be made everywhere.

Copy link
Member Author

@bpoldrack bpoldrack Mar 25, 2021

Choose a reason for hiding this comment

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

^ That is re call_git.

Re quotation:
Really? What about spaces in the path?

Edit:

nah - I see. It's not part of the call. All good. You're right. However, rationale of doing the same thing as in other calls next to it remains.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well - screw it. Can as well go in here. Pushed ;-)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I just thought for the bugfix I'll keep it consistent within the rest of the implementation.

Sure.

You're right. However, rationale of doing the same thing as in other calls next to it remains.

Yep, my comment was only about the cwd argument for this subprocess.run call.

if post_update_hook:
# Conditional on post_update_hook, since one w/o the other doesn't
# seem to make much sense.
gr.call_git("update-server-info")
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh no, my parenthetical, reading-along thought is causing more trouble than it was worth :)

call_gits first argument should be a list.

Copy link
Member Author

Choose a reason for hiding this comment

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

God dammit. Don't code when ou're half way out to vacation. :-D

This makes the failure message more informative:

  AssertionError: path /tmp/[...]/config does not exist (or dangling symlink)

rather than

  AssertionError:
Copy link
Contributor

@kyleam kyleam left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.

I'm going push a tweak to test_create_simple so that it tests with post_update_hook=True (and checks the behavior change from this PR), but of course feel free to tweak that (or drop it entirely).

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 @bpoldrack and @kyleam

LGTM!

@mih mih merged commit 2b3468a into datalad:maint Mar 26, 2021
@mih mih deleted the bf-gh-5530 branch March 26, 2021 06:46
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