feat: add library field to v1 and v2 public channel APIs, gate v1 ChannelVersion lookup#5828
Merged
rtibbles merged 4 commits intolearningequality:unstablefrom Apr 13, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rtibbles
requested changes
Apr 13, 2026
Member
rtibbles
left a comment
There was a problem hiding this comment.
Implemented to spec, but just one area missing testing coverage.
| self.assertNotEqual(result["name"], self.channel.name) | ||
| self.assertNotEqual(result["description"], self.channel.description) | ||
|
|
||
| def test_channel_version_token_lookup_requires_channel_versions_param(self): |
Member
There was a problem hiding this comment.
Really expected to see a test confirming that without the channel_versions query parameter, the ChannelVersion token would not produce any result. Please add.
Contributor
Author
There was a problem hiding this comment.
Added test_channel_version_token_without_param_returns_404 — a focused standalone test that uses a channel-version token without ?channel_versions=true and asserts a 404 response. Kept it separate from the combined gate test so the negative case is unambiguously visible on its own.
…=true param and add library field to v1 API responses Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8aca5d6 to
f3391be
Compare
rtibbles
approved these changes
Apr 13, 2026
Member
rtibbles
left a comment
There was a problem hiding this comment.
Changes are good - test coverage gives confidence.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan: Add a
libraryenum field ("KOLIBRI","COMMUNITY", ornull) to the v1 and v2 public channel API endpoints, and gate v1 ChannelVersion token resolution behind achannel_versions=truequery parameter._get_channel_list_v1libraryfieldlibraryin_serialize_channel_version()libraryfield toPublicChannelSerializerlibraryfieldlibraryin V2consolidate()Summary
Adds a
libraryfield to the v1 and v2 public channel API endpoints, enabling Kolibri to distinguish Kolibri Library, Community Library, and other channels. Also gates v1 ChannelVersion token resolution behind?channel_versions=trueto prevent older Kolibri clients from accidentally retrieving data they cannot parse.References
Reviewer guidance
Risky areas worth careful review:
views_v1.pygate —?channel_versions=trueis a deliberate breaking change to the v1 API contract. Three existing channel-version tests were updated to include the parameter; without it, channel-version token lookups now return 404._get_channel_version_library()status filter — must include bothSTATUS_APPROVEDandSTATUS_LIVE; any other status (includingSTATUS_PENDING) correctly returnsnull.consolidate()mapping — non-public channels map to"COMMUNITY"(notnull), which differs from v1 behaviour where only channel-version tokens with a qualifying submission return"COMMUNITY".To test:
pytest contentcuration/kolibri_public/tests/ -vAI usage
Implemented using Claude Code following a pre-approved TDD plan (red-green-refactor). Tests were written before each implementation step; the full test suite passed before each commit.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?