kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

allow command-line import to take a token as a parameter

Open indirectlylit opened this issue 7 years ago • 6 comments

Observed behavior

Currently importchannel only takes channel IDs

Expected behavior

Should also take tokens

User-facing consequences

confusion and failure to properly import

Errors and logs

HTTPError: 404 Client Error: Not Found for url: https://studio.learningequality.org/content/databases/dakup-ripad.sqlite3

Context

0.10.0

indirectlylit avatar May 31 '18 03:05 indirectlylit

This is will open up more confusion as currently only Studio can interpret channel tokens. I think it is safer not fix this, than to deal with inevitable edge cases.

rtibbles avatar Aug 17 '21 22:08 rtibbles

currently only Studio can interpret channel tokens

Not sure I understand this statement. The Kolibri GUI takes channel tokens, and this issue was to simply make the command-line UI consistent.

indirectlylit avatar Aug 18 '21 16:08 indirectlylit

simply make the command-line UI consistent.

My point was that it isn't simple, because the Kolibri GUI isn't just calling the the command, but making a request to Kolibri Studio to get the channel associated with the token.

If importing from non-Studio sources, no such request can be made, so we would have to make a separate 'studio' import command to nest this option under.

rtibbles avatar Aug 18 '21 17:08 rtibbles

so we would have to make a separate 'studio' import command to nest this option under.

Alternatively, we can do what you said in https://github.com/learningequality/kolibri/issues/7346#issuecomment-900652647 – embed token information in the Channel DB metadata.

A while back I recall we made a decision that tokens would be the standard way end-users identify channels. My sense is we started but never quite finished that process.

indirectlylit avatar Aug 19 '21 14:08 indirectlylit

Alternatively, we can do what you said in #7346 (comment) – embed token information in the Channel DB metadata.

My inconsistency here did occur to me. My main concern is just adding additional bloat to already quite sprawling management commands, whereas for the GUI case we can always put that logic somewhere that isn't the command.

I think if we did this alongside a refactor and a breakdown of the commands into more discrete utilities, I would feel more comfortable.

rtibbles avatar Aug 19 '21 14:08 rtibbles

Yeah, agreed that the the management command UX needs cleanup. We have a related issue from long ago here: https://github.com/learningequality/kolibri/issues/3727

indirectlylit avatar Aug 19 '21 15:08 indirectlylit