Uh oh!
There was an error while loading. Please reload this page.
feat: add library field to v1 and v2 public channel APIs, gate v1 ChannelVersion lookup - #5828
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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): |
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.
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
f3391beCompare
rtibbles
left a comment
There was a problem hiding this comment.
Changes are good - test coverage gives confidence.
Uh oh!
There was an error while loading. Please reload this page.
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?