-
Notifications
You must be signed in to change notification settings - Fork 109
Address gitlab API special character restrictions #7407
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
Conversation
…due to gitlab API restrictions
The verdict from the discussion in the chat was:
It should be configurations so that users themselves can act when GitLabs requirements change. |
Also TODO:
|
This change introduces two configurable stubs: project as an alternative to _repo_ (as a name for collection and hierarchy layouts root or subdataset projects) and - as a path separator for flat and collection subdataset names. The defaults comply to GitLabs naming rules for project paths, introduced in version 14.9: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/80055 They remain configurable via dedicated dataset-level configurations to allow overrides, for example to prevent name clashes with existing (sub)datasets or if path restrictions on gitlabs side are lifted. The configurations are: * datalad.gitlab-default-projectname * datalad.gitlab-default-pathseparator
Also mention the new dataset-level configurations to override the defaults
FTR: I tried to create |
yes, this was the motivation behind not using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this makes all sense. I left a bunch of comments and suggestions, some even on stuff that is only in the margin of the diffs.
The PR top-comment should mention that this closes #6681 (12 months old).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments
- Specification of the path separator via configuration
datalad.gitlab-default-pathseparator
should currently be done recursively in order to work correctly for subdatasets. For some other arguments set via config, the existing code infers the default from the top-level dataset (refds
), and I think this should be the case forpathsep
as well. I have made code suggestions to this effect. - This is more a question and explanation of my thoughts: it is not clear to me where exactly the path separator should be injected in a project's path. E.g. should it be injected twice when representing the path for a 2nd-level subdataset? And twice when representing a subdataset that's inside a subdirectory of the parent dataset? I tested out some examples below with
separator="+"
(note that the datasets all have dashes in them, just to add unnecessary complexity :D)- It seems like the collection path separation is done correctly (although this should actually be tested with even deeper levels)
- It looks like the flat path separation is wrong though, shouldn't all dashes after
BOB2
be replaced with the+
?
Dataset structure
BOB
.
├── gitlab-subtest (dataset)
│ └── gitlab-subsub (dataset)
└── subdir (directory)
└── gitlab-subdirdataset (dataset)
Collection example - BOB1
Flat example - BOB2
A note in case we have not seen this error before: I tried to specify the path separator as
|
Co-authored-by: Michael Hanke <michael.hanke@gmail.com>
This way, a custom configured path separator is applied between all elements of the generated paths, yielding more consistent appearance and behavior. Co-authored-by: Michael Hanke <michael.hanke@gmail.com> adjust test
32dd139
to
eaa6fe8
Compare
Code Climate has analyzed commit eaa6fe8 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #7407 +/- ##
==========================================
- Coverage 91.59% 91.54% -0.06%
==========================================
Files 325 325
Lines 43318 43338 +20
Branches 5781 5806 +25
==========================================
- Hits 39679 39675 -4
- Misses 3624 3648 +24
Partials 15 15
☔ View full report in Codecov by Sentry. |
Tests have passed! |
PR released in |
The main change is from
_repo_
torepo
. This PR serves as a space to brainstorm an effective solution.Closes #6681