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

Add protection against invalid image path declarations for add #247

Closed
wants to merge 2 commits into from

Conversation

mih
Copy link
Member

@mih mih commented Oct 10, 2023

This is a bit painful, because datalad-next parameter validation is not available, but worth adding given the issue.

Closes #150

This is a bit painful, because datalad-next parameter validation
is not available, but worth adding given the issue.

Closes datalad#150
@codeclimate
Copy link

codeclimate bot commented Oct 10, 2023

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

View more on Code Climate.

@mih
Copy link
Member Author

mih commented Oct 11, 2023

Test failures reveal that internal use of the parameter is also inconsistent with its documented semantics.

@@ -199,6 +199,16 @@ def __call__(name, url=None, dataset=None, call_fmt=None, image=None,
purpose='add container')
runner = WitlessRunner()

if image is not None:
if op.isabs(image):
Copy link
Member

Choose a reason for hiding this comment

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

Docstring does say relative so I guess it is good. I just wanted to raise a comment that on general we are ok with providing absolute paths everywhere and I think we (or git) normalize them into relative if needed... so it would've been more consistent to just normalize absolute path to correct relative here

@yarikoptic yarikoptic added the patch Increment the patch version when merged label Oct 11, 2023
@yarikoptic
Copy link
Member

Appveyor shows now failing test_run_subdataset_install because path isn't absolute... I guess somewhat reflects on my comment above

@mih
Copy link
Member Author

mih commented Oct 12, 2023

Appveyor shows now failing test_run_subdataset_install because path isn't absolute... I guess somewhat reflects on my comment above

Yes, this is what I was referring to in #247 (comment)

The Q is: what is wrong? The docs or the test?

I interpret you statements above as: the docs should be adjusted (any path that points into the dataset), and the test relaxed accordingly.

@mih
Copy link
Member Author

mih commented Oct 12, 2023

After looking at this again, I decided to close this PR. There would be a significant effort resulting in the serial parameter validation that the ValidatedInterface and the associated tooling in datalad-next is trying to overcome.

I think this is better approached once that or an equivalent functionality is available to this extension.

@mih mih closed this Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

containers-add should throw error message when referenced image is outside of dataset
2 participants