Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the channel labels from the non-public ContentNode API #12842

Open
3 tasks
nucleogenesis opened this issue Nov 13, 2024 · 0 comments · May be fixed by #12843
Open
3 tasks

Remove the channel labels from the non-public ContentNode API #12842

nucleogenesis opened this issue Nov 13, 2024 · 0 comments · May be fixed by #12843
Assignees
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: backend Python, databases, networking, filesystem...

Comments

@nucleogenesis
Copy link
Member

[General guidance: Product issues should describe the feature, but are not actually technically specced for dev work.]

Overview

Following-up from #12759 - there is no longer a need for the ContentNode API to provide a list of labels for the channels as we have removed the ability to select a Channel to search by through the filters interface. The user's search will be filtered instead, automatically, by scoping to the channel (or topic) they're currently in.

Guidance

We need to be sure that the channel labels are still made available through the public API so that older Kolibris which do have the option to search by a particular Channel will not run into any issues.

For searching the user's local Kolibri, however, from here on the labels are unnecessary data and processing.

A good place to start might be:

output["channels"] = _get_available_channels(base_queryset)

and the _get_available_channels function there.

Additionally, you'll see that the labels are generated in a method in the OptionalContentNodePagination class:

("labels", get_available_metadata_labels(self.queryset)),

which is used both in the public and private APIs' pagination_class field.

It could perhaps be as simple as adding a flag use_deprecated_channels_labels=False to that class, then handling the True case within the existing OptionalContentNodePagination class -- then subclassing it and setting that subclass's field to True to pass it into the public content node viewset's pagination_class field.

Acceptance criteria

  • Channel labels are no longer returned by the ContentNodeViewset API - specifically for the non-public API
  • The public API still provides the channel labels
  • You can navigate and search an 0.18.x Kolibri's library remotely from Kolibri 0.17.x and filter by Channels
@nucleogenesis nucleogenesis added DEV: backend Python, databases, networking, filesystem... APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) labels Nov 13, 2024
@Pulkitxm Pulkitxm linked a pull request Nov 14, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: backend Python, databases, networking, filesystem...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants