datalad / datalad-container

DataLad extension for containerized environments
http://datalad.org
Other
11 stars 17 forks source link

Unconditionally store image path in POSIX notation in configuration #243

Closed mih closed 1 year ago

mih commented 1 year ago

[This PR sits on #242, only the last commit is unique and relevant here]

This establishes a fixed format for the configuration. Previously, the path was stored in platform conventions without any indication of the nature of that platform. This turned platform detection into guesswork. Configuration created on windows was not functional on other platforms.

Some of that guesswork is now implemented in a path normalization helper (_normalize_image_path()). It is executed on-read, in order to keep older dataset configuration functional for the cases

Notably, this guesswork does not cover the case of an image that was configured on windows, and is hosted in a currently uninstalled subdataset. This seems rare enough of a case to not deserve the implied complexity of supporting it in a backward compatible way.

Closes #224

TODO:

The missing lines in the coverage are

image

I am not planning on adding a test for this case (a path that is verified to be in windows convention by finding a matching filesystem item). If this is unacceptable, I am OK with removing support for this entirely.

codeclimate[bot] commented 1 year ago

Code Climate has analyzed commit cd49d66a and detected 0 issues on this pull request.

View more on Code Climate.

codecov[bot] commented 1 year ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (c505e52) 94.69% compared to head (cd49d66) 94.70%. Report is 10 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #243 +/- ## ========================================== + Coverage 94.69% 94.70% +0.01% ========================================== Files 25 25 Lines 1093 1133 +40 ========================================== + Hits 1035 1073 +38 - Misses 58 60 +2 ``` | [Files](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad) | Coverage Δ | | |---|---|---| | [datalad\_container/containers\_add.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvY29udGFpbmVyc19hZGQucHk=) | `89.80% <100.00%> (+0.13%)` | :arrow_up: | | [datalad\_container/containers\_list.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvY29udGFpbmVyc19saXN0LnB5) | `95.74% <100.00%> (-0.81%)` | :arrow_down: | | [datalad\_container/containers\_remove.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvY29udGFpbmVyc19yZW1vdmUucHk=) | `97.43% <100.00%> (-0.07%)` | :arrow_down: | | [datalad\_container/containers\_run.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvY29udGFpbmVyc19ydW4ucHk=) | `84.84% <ø> (ø)` | | | [datalad\_container/tests/test\_containers.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvdGVzdHMvdGVzdF9jb250YWluZXJzLnB5) | `100.00% <100.00%> (ø)` | | | [datalad\_container/tests/test\_run.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvdGVzdHMvdGVzdF9ydW4ucHk=) | `100.00% <100.00%> (ø)` | | | [datalad\_container/utils.py](https://app.codecov.io/gh/datalad/datalad-container/pull/243?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=datalad#diff-ZGF0YWxhZF9jb250YWluZXIvdXRpbHMucHk=) | `92.68% <94.11%> (+6.96%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mih commented 1 year ago

Thanks for the reviews! Very helpful!