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

Make push work with push.default=matching repos #4896

Merged
merged 6 commits into from Sep 8, 2020
Merged

Conversation

mih
Copy link
Member

@mih mih commented Sep 7, 2020

Story is in the commit messages. Big change is the push of the active branch.

Fixes #4888

mih and others added 5 commits September 7, 2020 12:08
By `push.default=matching` or another way.
Rational: in a dataset that is configured with `push.default=matching`
we have no other ability to trigger the push of a (new) branch
that gave the context for the PATHS that `push` might be moving.

datalad#4888
ok_() will pass as long as the first get_hexsha() returns true.
test_push_matching() fails on the crippled fs run because the target
repo already has an unrelated commit.  mk_push_target() has a
dedicated workaround for this, so use that instead of
create_sibling().

Also correct the hexsha comparison to avoid comparing an adjusted
branch in one repository to the corresponding branch in the other.

Cf: https://github.com/datalad/datalad/pull/4896/checks?check_run_id=1080990572
Copy link
Collaborator

@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.

Okay, so when we repurposed the optimization in 211fead as a fix for gh-4780, we traded the gh-4780 issue/limitation for this bug. (That commit was introduced in 0.13.2.)

The fix looks good to me. As you note, the always-push-current is a change in behavior, but given how young push is and how unlikely it seems that someone would rely on the previous behavior in general, I think it's safe.

I pushed a fix for the new test on crippled fs. It fixes the run for me locally under tools/eval_under_testloopfs. I'm hoping it also fixes the appveyor failure.

if is_annex_repo:
must_have_branches.append('git-annex')
for branch in must_have_branches:
# active_branch could be None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not true with the current upstream code :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Arrgh, true. Too many iterations if moving conditionals around. Will fix that up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@kyleam
Copy link
Collaborator

kyleam commented Sep 7, 2020

I pushed a fix for the new test on crippled fs.

The build still had a push test failure, but I think it's one we've been seeing. The new test_push_matching now passes.

https://github.com/datalad/datalad/pull/4896/checks?check_run_id=1081754243

I'm hoping it also fixes the appveyor failure.

It did: https://ci.appveyor.com/project/mih/datalad/builds/35069164/job/8ykc5ukd3n509wxp#L654

@codecov
Copy link

codecov bot commented Sep 7, 2020

Codecov Report

Merging #4896 into maint will decrease coverage by 0.04%.
The diff coverage is 92.59%.

Impacted file tree graph

@@            Coverage Diff             @@
##            maint    #4896      +/-   ##
==========================================
- Coverage   89.66%   89.62%   -0.05%     
==========================================
  Files         288      288              
  Lines       40406    40424      +18     
==========================================
- Hits        36230    36228       -2     
- Misses       4176     4196      +20     
Impacted Files Coverage Δ
datalad/core/distributed/push.py 89.15% <88.88%> (-0.43%) ⬇️
datalad/core/distributed/tests/test_push.py 97.97% <100.00%> (+0.04%) ⬆️
datalad/downloaders/http.py 81.85% <0.00%> (-2.71%) ⬇️
datalad/downloaders/tests/test_http.py 87.71% <0.00%> (-2.22%) ⬇️
datalad/interface/tests/test_unlock.py 95.87% <0.00%> (-2.07%) ⬇️

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...6c0c51d. Read the comment docs.

@mih mih linked an issue Sep 7, 2020 that may be closed by this pull request
@mih
Copy link
Member Author

mih commented Sep 8, 2020

Thx @kyleam

I believe the singularity failure on the -container tests is unrelated to this PR. Will merge.

@mih mih merged commit 249a562 into datalad:maint Sep 8, 2020
2 checks passed
@mih mih deleted the bf-4888 branch September 8, 2020 07:25
@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.

Fail to push git-annex branch
3 participants