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: Decomplexify configure_origins() #4196

Merged
merged 1 commit into from Feb 26, 2020
Merged

RF: Decomplexify configure_origins() #4196

merged 1 commit into from Feb 26, 2020

Conversation

mih
Copy link
Member

@mih mih commented Feb 25, 2020

Previous code looked at two datasets simultaneously per iteration.
This could result in making a fetch attempt to a non-local repository,
because it would no check whether the second dataset was actually local.

The new code focuses on a single dataset at a time, and all checks are
performed on each one.

Previous code looked at two datasets simulatenously per iteration.
This could result in making a fetch attempt to a non-local repository,
because it would no check whether the second dataset was actually local.

The new code focuses on a single dataset at a time, and all checks are
performed on each one.
@kyleam
Copy link
Contributor

kyleam commented Feb 25, 2020

Previous code looked at two datasets simultaneously per iteration.
This could result in making a fetch attempt to a non-local repository,
because it would no check whether the second dataset was actually local.

Oy, good catch.

Rewrite looks good to me.

cfgds.config.get(r + '.url', None)
for r in cfgds.config.sections()
if r.startswith('remote.')
)
Copy link
Contributor

@kyleam kyleam Feb 25, 2020

Choose a reason for hiding this comment

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

Hmm, what's the scenario in which these duplicates would arise? Is it when, in a chain of origins---say "cfgds -> origin A -> origin B -> origin C"---origin C's "origin" remote points back to B?

Copy link
Member Author

@mih mih Feb 26, 2020

Choose a reason for hiding this comment

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

Yes, that is the scenario

@codecov
Copy link

codecov bot commented Feb 25, 2020

Codecov Report

Merging #4196 into master will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4196      +/-   ##
==========================================
- Coverage   89.28%   89.27%   -0.01%     
==========================================
  Files         275      275              
  Lines       36121    36126       +5     
==========================================
+ Hits        32250    32253       +3     
- Misses       3871     3873       +2     
Impacted Files Coverage Δ
datalad/distribution/siblings.py 76.59% <0.00%> (-0.31%) ⬇️

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 6fe0041...727ec62. Read the comment docs.

@mih
Copy link
Member Author

mih commented Feb 26, 2020

Thx @kyleam for the review!

@mih mih merged commit d5fcb48 into datalad:master Feb 26, 2020
15 of 17 checks passed
@mih mih deleted the bf-origins branch Feb 26, 2020
@yarikoptic yarikoptic modified the milestones: 0.12.3, 0.12.x Feb 26, 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