allow command-line import to take a token as a parameter
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
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.
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.
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.
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.
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.
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