Address gitlab API special character restrictions - #7407
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 |
jsheunis
left a comment
There was a problem hiding this comment.
Comments
- Specification of the path separator via configuration
datalad.gitlab-default-pathseparatorshould 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 forpathsepas 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
BOB2be 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