datalad / datasalad

Python utilities for working with data in the vicinity of Git and git-annex
https://datalad.org
Other
2 stars 2 forks source link

Import candidate: special remote tooling #7

Open mih opened 6 months ago

mih commented 6 months ago

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 annexremote package, and pieces in https://github.com/datalad/datalad/tree/maint/datalad/customremotes: the base class SpecialRemote and the main() 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:

christian-monch commented 6 months ago

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:

mih commented 6 months ago

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 and git annex testremote.

Ah, that is an excellent idea!!

yarikoptic commented 6 months ago

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.