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

ENH: Better feedback when create-sibling-gitlab is called with non-existing path #6701

Merged
merged 1 commit into from
May 30, 2022

Conversation

adswa
Copy link
Member

@adswa adswa commented May 23, 2022

When create-sibling-gitlab receives a path to a non-existing or non-dataset location, it does not provide any feedback to the user about this (#6700). This PR makes create-sibling-gitlab yield an impossible result whenever a provided path does not point to a subdataset:

$ datalad create-sibling-gitlab --site https://jugit.fz-juelich.de thisismyproject                    1 !
create_sibling_gitlab(impossible): thisismyproject (dataset) [No dataset found under /tmp/some/thisismyproject]

Changelog

💫 Enhancements and new features

  • When create-sibling-gitlab is called on non-existing subdatasets or paths it now returns an impossible result instead of no feedback at all

@adswa adswa added the semver-patch Increment the patch version when merged label May 23, 2022
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #6701 (682c910) into master (734a646) will decrease coverage by 0.73%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #6701      +/-   ##
==========================================
- Coverage   91.14%   90.40%   -0.74%     
==========================================
  Files         353      353              
  Lines       44485    45740    +1255     
==========================================
+ Hits        40545    41351     +806     
- Misses       3940     4389     +449     
Impacted Files Coverage Δ
datalad/distributed/create_sibling_gitlab.py 69.09% <100.00%> (+0.76%) ⬆️
...ad/distributed/tests/test_create_sibling_gitlab.py 98.49% <100.00%> (+0.03%) ⬆️
datalad/version.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/wtf.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/cmdline/main.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/addurls.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/interface/clean.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/interface/rerun.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/__init__.py 0.00% <0.00%> (-100.00%) ⬇️
datalad/plugin/no_annex.py 0.00% <0.00%> (-100.00%) ⬇️
... and 175 more

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 734a646...682c910. Read the comment docs.

…isting path

When create-sibling-gitlab receives a path to a non-existing or non-dataset
location, it does not provide any feedback to the user about this (datalad#6700)
This commit makes create-sibling-gitlab yield an impossible result
whenever a provided path does not point to a subdataset

Add a test case
@codeclimate
Copy link

codeclimate bot commented May 23, 2022

Analysis results are not available for those commits

View more on Code Climate.

Copy link
Member

@bpoldrack bpoldrack left a comment

Choose a reason for hiding this comment

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

Hm. This change looks to me as if the actual problem is subdatasets that should yield an impossible or error result when passing such a path. Then here that result could just be yielded upwards. WDYT, @adswa? Do I miss something?

@adswa
Copy link
Member Author

adswa commented May 25, 2022

oh true, I haven't thought in that direction at all yet

@adswa
Copy link
Member Author

adswa commented May 25, 2022

mhhh, looking into subdatasets seems to suggest that yielding an impossible or error result when a given path does not match a subdataset is against the way the path parameter is used, though. Its docstring says path/name to query for subdatasets. Defaults to the current directory[PY: , or the entire dataset if called as a dataset method PY] and internal logging confirms that it is a constrain for where to search underneath for subdataset, not where specifically a subdataset should be:

        if paths is not None:
            lgr.debug('Query subdatasets underneath paths: %s', paths)

Making subdatasets() yield impossible would probably be a quite severe API change with mostly bad consequences (I suspect this argument is especially useful in large datasets), so I wouldn't go down that road.

Copy link
Member

@bpoldrack bpoldrack left a comment

Choose a reason for hiding this comment

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

Ah, you're right. Apologies. Approved then. :)

@adswa
Copy link
Member Author

adswa commented May 30, 2022

Thanks for the review and approval, @bpoldrack! Merging, since no-one has complained for a week :)

@adswa adswa merged commit 1072fb3 into datalad:master May 30, 2022
@adswa adswa deleted the enh-gitlab branch May 30, 2022 06:33
@mih mih mentioned this pull request Jul 1, 2022
40 tasks
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.

create-sibling-github lacks feedback when no dataset can be determined
2 participants