Page MenuHomeSoftware Heritage

loader: Implement uniform loading CLI
Closed, MigratedEdits Locked

Description

  • D2397: under the swh cli: swh loader <type> <url> <options>
  • all loaders (including the registering step within setup.py's entry_points mechanism)
    • D2397: loader-package (archive, debian, deposit, npm, pypi)
    • D2400: git
    • D2399: mercurial
    • D2398: svn

Note:
This also implies some unification work for the different loader's instantiation and trigger method call (load here).
The way forward, unifying with the lister, is to push the loader's state to be initialized within the constructor.
And to have the main method (load) to have no parameter whatsoever.
(This has been done in the multiple diffs referenced earlier).

Related Objects

Event Timeline

ardumont renamed this task from Implement uniform loading CLI to loader: Implement uniform loading CLI.Dec 3 2019, 2:34 PM
ardumont updated the task description. (Show Details)
ardumont updated the task description. (Show Details)

Sorry I'm commenting this a bit late, but wouldn't it make more sense to have something like:

swh loader run <loader-type> <url> [arg1=val1 [...]] with a fellow command
swh loader list that lists available loaders (possibly with a description of possible optional arguments)?

ie. having a clear swh <module> <command> pattern with the command being a verb "describing" what it does.

The good news is that it's not the big part of the task.
So, yes, i'll improve on the current implementation that after i'm done deploying and migrating all the things ;)
The big part is the implied refactoring pulled by this.
Which i'm almost done (that's the deploy and migrate part i'm doing).

swh loader run <loader-type> <url> [arg1=val1 [...]] with a fellow command

I wanted to initially do that but some strange behavior made me reconsider.
I prefer what you describe though so sure.
That's more consistent with other clis.

swh loader list that lists available loaders (possibly with a description of possible optional arguments)?

i'll see what i can do.
The listing seems simple enough.
The optional arguments part, i'm not so sure (i think i see a way but i'm not entirely sure yet).

Thanks for the heads up.

ardumont claimed this task.