Skip to content

BF: path from .gitmodules could not be used with source candidate template #7280

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

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

bpoldrack
Copy link
Member

The path property was treated as a special case in GitRepo.get_submodules_ presumably to not yield redundant information, because what is returned is a dict where the path is the key and the other properties from .gitmodules make up the value (another dict), prefixed with gitmodule_.

However, actual usage from get via subdatasets suggests, that the easiest is to just yield this "redundant" record. Once as the reported property exactly like url, datalad-id and whatever else, and in addition let the path remain the key. Throughout that chain the latter gets possibly turned into an absolute path anyway (which is not what we want to report here - it's just for internal use).

Closes #7274

template

The `path` property was treated as a special case in
`GitRepo.get_submodules_` presumably to not yield redundant information,
because what is returned is a dict where the path is the key and the
other properties from `.gitmodules` make up the value (another dict),
prefixed with `gitmodule_`.

However, actual usage from `get` via `subdatasets` suggests, that the
easiest is to just yield this "redundant" record. Once as the reported
property exactly like `url`, `datalad-id` and whatever else, and in
addition let the path remain the key. Throughout that chain the latter
gets possibly turned into an absolute path anyway (which is not what we
want to report here - it's just for internal use).

Closes datalad#7274
@bpoldrack bpoldrack added the semver-patch Increment the patch version when merged label Feb 7, 2023
@bpoldrack bpoldrack marked this pull request as ready for review February 7, 2023 03:48
@codecov
Copy link

codecov bot commented Feb 7, 2023

Codecov Report

Base: 88.72% // Head: 90.71% // Increases project coverage by +1.98% 🎉

Coverage data is based on head (9d0607f) compared to base (c92ae3a).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##            maint    #7280      +/-   ##
==========================================
+ Coverage   88.72%   90.71%   +1.98%     
==========================================
  Files         326      326              
  Lines       44423    44431       +8     
  Branches     5919     5919              
==========================================
+ Hits        39415    40305     +890     
+ Misses       4993     4111     -882     
  Partials       15       15              
Impacted Files Coverage Δ
datalad/distribution/get.py 96.52% <ø> (ø)
datalad/support/gitrepo.py 92.49% <ø> (ø)
datalad/distribution/tests/test_get.py 100.00% <100.00%> (ø)
datalad/customremotes/ria_remote.py 55.55% <0.00%> (-11.12%) ⬇️
datalad/_version.py 45.68% <0.00%> (ø)
datalad/tests/test_constraints.py 100.00% <0.00%> (ø)
datalad/distribution/tests/test_create_sibling.py 79.87% <0.00%> (+0.04%) ⬆️
datalad/support/annexrepo.py 90.51% <0.00%> (+0.08%) ⬆️
datalad/support/tests/test_annexrepo.py 98.03% <0.00%> (+0.13%) ⬆️
datalad/distribution/create_sibling.py 70.22% <0.00%> (+0.25%) ⬆️
... and 3 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -0,0 +1,7 @@
### 🐛 Bug Fixes

- Fixed that the `get` command would fail, when subdataset source-candidate-templates where using the `path` property from `.gitmodules`.
Copy link
Member

Choose a reason for hiding this comment

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

since it fixes smth, could there be a unittest which would demonstrate the effect of having smth fixed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not clear to me, @yarikoptic. Did you miss the change to test_get.py or do you consider this somehow insufficient?

Copy link
Member

@adswa adswa left a comment

Choose a reason for hiding this comment

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

Thx! I can confirm that this fixes the KeyError we saw in the office hour and that I observed when reproducing #7280

@adswa adswa merged commit bd302a7 into datalad:maint Mar 2, 2023
@yarikoptic-gitmate
Copy link
Collaborator

PR released in 0.18.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subdataset cannot be retrieved
4 participants