Import candidate: special remote tooling #7
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
datalad/datasalad#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The datalad-next entry point to this code is https://github.com/datalad/datalad-next/tree/main/datalad_next/annexremotes and strong dependencies exist on the
annexremotepackage, and pieces in https://github.com/datalad/datalad/tree/maint/datalad/customremotes: the base classSpecialRemoteand themain()entrypoint for all special remotes.This is a challenging piece (in a good way), because it will bring up a number of questions re encapsulation (how much datalad-logic should be in the resulting implementation?), and it should sharpen the concept of this library going through them.
Moreover, the special remote code in datalad-core is heavily patched already, and consolidating these changes into a reusable implementation would be of high value.
Discussion items:
main()ui.set_backend('annex')) -- is this even necessary still? can it be implemented within the datalad package via some kind of generic setup-hook mechanism?git annex testremote).I agree with everything. Especially a proper test environment for special remote implementation would be a big leap forward.
Below are a few out-of-order thoughts and observations regarding special remotes and general code structure:
Special remote tooling is a bold choice, I like it!
You mention "remove dependencies on
datalad.ui". This point highlights a general issue in the datalad code base. We often use one class and its subclasses, e.g.ui, to perform operations in different contexts. Different contexts are covered by using instances of other subclasses. This leads to tighter dependencies, for example on the classui, and to complex class hierarchies and object-instantiation logic. I believe it would be beneficial to apply a more "delegate"-oriented approach, where an optional delegate is given to an object. This would align with the "hook mechanism" that you mentioned.A git-annex independent driver for special remote implementations, probably based on
datalad_next.shell, might be helpful for high-level testing of special remote implementations. This driver would allow tests that fill a gap between unit-tests andgit annex testremote.Ah, that is an excellent idea!!
FWIW we had a flavor of "git-annex independent driver" for testing purposes in the core in the past, last seen around https://github.com/datalad/datalad/blob/0.15.2/datalad/customremotes/tests/test_base.py#L129 . So may be some ideas there could be reincarnated.