Skip to content

feat: export included_presets renderable bitmask for content-schema import gating#6040

Merged
rtibbles merged 5 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-6004-1973c5
Jul 13, 2026
Merged

feat: export included_presets renderable bitmask for content-schema import gating#6040
rtibbles merged 5 commits into
learningequality:hotfixesfrom
rtibblesbot:issue-6004-1973c5

Conversation

@rtibblesbot

@rtibblesbot rtibblesbot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

New Kolibri gates channel import by whether a device can render a node's files, but the exported content database carries no per-file signal of which renderers a file needs. This adds a nullable included_presets bitmask to the exported File mirror and populates each renderable file's own-preset bit at publish, leaving supplementary files NULL. It also advertises content schema version 6 so new Kolibri knows an export carries the column; the column is additive, so old Kolibri ignores it.

References

Fixes #6004. Kolibri import-gating counterpart: learningequality/kolibri#14893. Ships alongside the 64-bit file-size export change #5987.

Reviewer guidance

  • contentcuration/contentcuration/utils/publish.py:669included_presets is set only for non-supplementary files; confirm supplementary files (e.g. thumbnails) stay NULL and a preset absent from the append-only RENDERABLE_PRESETS_ORDER is logged-and-skipped rather than aborting the publish.
  • contentcuration/kolibri_content/constants/schema_versions.pyCONTENT_SCHEMA_VERSION moves to "6" while MIN_CONTENT_SCHEMA_VERSION stays "5"; confirm the version string matches Kolibri #14893 and that both additive columns riding this hotfix share one version bump (no VERSION_7).
  • contentcuration/contentcuration/migrations/0168_alter_assessmentitem_type.py — the le-utils 0.2.18 bump adds a QTI entry to exercises.question_choices, so Django emits a choices-only AlterField on assessmentitem.type; confirm carrying that no-op-DDL migration here is acceptable.

AI usage

Used Claude Code to implement the pre-approved plan with test-driven development, prompting it to follow the existing create_associated_file_objects and base_models.File patterns. Verified with the export-channel and import-metadata test suites and makemigrations --check.


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?
  • Ran pre-flight CI checks (lint, format, tests) and verified all pass
  • Rebased onto the target branch and resolved any conflicts
  • Reorganized commit history into clean, logical commits
  • Audited the diff to ensure only issue-relevant files are changed
  • Built PR body from the repository's PR template with evidence blocks
@rtibblesbot

🟡 Waiting for feedback

Last updated: 2026-07-12 22:57 UTC

rtibblesbot and others added 5 commits July 12, 2026 15:47
Provides RENDERABLE_PRESETS_ORDER for the included_presets bitmask.
The new le-utils adds a QTI question type to exercises.question_choices,
which Django picks up as an assessmentitem.type AlterField migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a nullable included_presets IntegerField to the abstract
kolibri_content.base_models.File, inherited by both the kolibri_content
(sqlite export) and kolibri_public (import-metadata API) File mirrors.
It holds a bitmask of the renderable presets a device needs to render a
file. The column is additive and nullable, so old Kolibri ignores it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In create_associated_file_objects, set each renderable (non-supplementary)
file's own-preset bit (2 ** RENDERABLE_PRESETS_ORDER.index(preset_id)) and
leave supplementary files NULL. A preset missing from the append-only
ordering is logged and skipped rather than aborting the channel publish.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add VERSION_6 carrying included_presets and set it as CONTENT_SCHEMA_VERSION
so new Kolibri knows an export carries the column. MIN_CONTENT_SCHEMA_VERSION
stays VERSION_5 since the column is additive and returned regardless.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rtibblesbot rtibblesbot marked this pull request as ready for review July 12, 2026 22:57

@rtibbles rtibbles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct updates.

@rtibbles rtibbles merged commit da92f80 into learningequality:hotfixes Jul 13, 2026
27 checks passed
@rtibblesbot rtibblesbot deleted the issue-6004-1973c5 branch July 13, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants