Migrate kolibri-sentry-plugin into the Python monorepo
Overview
Migrate the kolibri-sentry-plugin from its standalone repository (learningequality/kolibri-sentry-plugin) into the Kolibri monorepo as a member of the python_packages/ workspace. Unlike kolibri-sync-extras-plugin, this plugin contains frontend code in addition to Python, so the migration also extends the pnpm workspace to cover python_packages/*.
This is the second per-plugin migration under #13720, building on the monorepo setup completed in #14663.
Complexity: Medium Target branch: develop
Context
kolibri-sentry-plugin is one of the most frequently used Kolibri plugins internally. Its standalone repository contains:
- A Python package (
kolibri_sentry_plugin/) with akolibri_plugin.py, options, settings, and locale data. - A frontend portion (
kolibri_sentry_plugin/assets/) withpackage.jsondeclaring the plugin asprivate: true. The JS depends on@sentry/vueand on workspace packages already in the Kolibri monorepo (kolibri,kolibri-plugin-data,browserslist-config-kolibri). - A
setup.cfg/setup.pybuild config, pre-commit config, and CI.
The plugin's frontend code is bundled into the Python package's wheel at build time (the standard Kolibri plugin pattern); there is no separate npm publish for it.
The Kolibri monorepo's existing pnpm-workspace.yaml already lists kolibri/plugins/* as workspace members, which is the precedent for "Python plugin with embedded JS workspace package". Extending the same pattern to python_packages/* lets a single directory under python_packages/ hold both the Python and JS bits of a plugin.
The Change
Code migration:
- The contents of
learningequality/kolibri-sentry-pluginare moved intopython_packages/kolibri-sentry-plugin/in this repository. setup.cfg/setup.pyare replaced with apyproject.tomlconsistent with the conventions established by #14663. The plugin gets its own staticversionfield (independent of the main Kolibri version, per the versioning decision in #14663).- The plugin's
package.jsonis preserved atpython_packages/kolibri-sentry-plugin/package.json. It remainsprivate: true— the JS is bundled into the wheel at build time, not published to npm. - Repo-local files that no longer apply (the standalone CI under
.github/,Makefile,MANIFEST.in,CONTRIBUTING.rst,.pre-commit-config.yaml) are dropped — they are subsumed by the monorepo's equivalents. The plugin's code must conform to the monorepo's pre-commit config (ruff, per #14457).
Git history:
The migration preserves git history by running git filter-repo --to-subdirectory-filter python_packages/kolibri-sentry-plugin on a fresh clone of the source repo, then merging into the monorepo with git merge --allow-unrelated-histories (the procedure from https://developers.netlify.com/guides/migrating-git-from-multirepo-to-monorepo-without-losing-history/, established by #14663). Historical commit hashes are rewritten — acceptable because the source repo is archived as part of this task.
Workspace integration:
pnpm-workspace.yamlis extended to includepython_packages/*as workspace members so the plugin'spackage.jsonis recognized bypnpmand its workspace dependencies (kolibri,kolibri-plugin-data, etc.) resolve to the local packages. This change is general — it benefits any future Python member package with a frontend, not just sentry.- The plugin is added to the
python_packages/*glob in the uv workspace config, souv syncresolves it. - The plugin is added to the explicit publishable-packages list in the PyPI publishing workflow (created in #14663).
Build / CI:
- The plugin's existing build commands (
kolibri-tools build prod --plugins kolibri_sentry_plugin) continue to work via the monorepo's existing JS tooling. - The plugin's Python tests (if any) run under the Stage 2 per-member-package test job (per #14663). If the plugin has no tests, this is a no-op for now.
- The plugin's wheel build is verified end-to-end before merge — installing the resulting wheel into a fresh virtualenv and confirming the plugin loads under Kolibri.
External repository:
- The original
learningequality/kolibri-sentry-pluginrepository is archived once the migrated version successfully publishes to PyPI from the monorepo.
Out of Scope
- Migrating any other external plugin — handled by separate per-plugin tasks under #13720.
- Adding new functionality to the Sentry plugin — this is a like-for-like migration.
- Changes to how the JS bundle is produced or how the plugin is loaded by Kolibri.
- Publishing the plugin's frontend code to npm — it remains
private: trueand ships only inside the wheel.
Acceptance Criteria
Code migration
- [ ] Plugin code lives at
python_packages/kolibri-sentry-plugin/, including the Python module (kolibri_sentry_plugin/) andpackage.json. - [ ] A
pyproject.tomlreplacessetup.cfg/setup.py, follows the conventions established by #14663, and declares an explicit staticversionfield. - [ ] Standalone-only files (
.github/,Makefile,MANIFEST.in,CONTRIBUTING.rst,.pre-commit-config.yaml,setup.cfg,setup.py) are not present in the migrated directory. - [ ] The migrated code passes the monorepo's pre-commit config (ruff and others) without per-file ignores.
- [ ] Plugin history is preserved via
git filter-repo --to-subdirectory-filter;git blameon migrated files traces back to the original commits.
Workspace integration
- [ ]
pnpm-workspace.yamlincludespython_packages/*as a workspace glob. - [ ]
pnpm installfrom the repo root resolves the plugin's workspace dependencies (kolibri,kolibri-plugin-data, etc.) to local workspace packages. - [ ] The plugin appears as a member of the uv workspace;
uv sync --group devincludes it. - [ ] The plugin is added to the publishable-packages list in the PyPI publishing workflow created by #14663.
Build and runtime
- [ ]
kolibri-tools build prod --plugins kolibri_sentry_pluginproduces the JS bundle in the expected location under the migrated directory. - [ ] A wheel built from
python_packages/kolibri-sentry-plugin/installs into a fresh virtualenv alongside Kolibri. - [ ] After installation, Kolibri loads the plugin without errors and Sentry integration is observable (e.g. a deliberately raised exception reaches the configured Sentry DSN, verified manually).
Tests
- [ ] If any tests exist in the migrated plugin, they run under the Stage 2 per-member-package job (per #14663) and pass.
External repository
- [ ] After the migrated plugin successfully publishes to PyPI from the monorepo, the original
learningequality/kolibri-sentry-pluginrepository is archived.
References
- Source repository: https://github.com/learningequality/kolibri-sentry-plugin
- Existing precedent for "Python plugin with embedded JS workspace package":
kolibri/plugins/*(already covered bypnpm-workspace.yaml) - pnpm workspaces: https://pnpm.io/workspaces
- uv workspaces: https://docs.astral.sh/uv/concepts/projects/workspaces/
AI usage
Used Claude Code to draft this issue iteratively from a brief prompt. I drove scope and decisions throughout — confirming the single-directory layout for plugin code with frontend, deciding the pnpm-workspace.yaml change belongs in this issue rather than #14663 (because sync-extras didn't need it), and confirming static versioning, pre-commit conformance, and end-to-end wheel verification including manual Sentry integration check. Claude reviewed both source repos, surfaced the structural difference between sentry (with frontend) and sync-extras (Python-only), and edited drafts before each was accepted.
Hello @rtibbles, can i work on this issue?
Hi! 👋
Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.
Plan: Move learningequality/kolibri-sentry-plugin into this monorepo at python_packages/kolibri-sentry-plugin/, preserving git history, converting it to a uv/pnpm workspace member with a pyproject.toml, and verifying its frontend build and wheel install work end-to-end — mirroring the precedent set by kolibri-sync-extras-plugin (#14663) but extending it to a plugin with frontend code.
- [ ] Merge upstream history into
python_packages/kolibri-sentry-plugin/ - [ ] Replace
setup.cfg/setup.pywithpyproject.toml; drop standalone-only files - [ ] Register
python_packages/*as a pnpm workspace glob; adapt the plugin'spackage.json - [ ] Verify the frontend build and wheel packaging end-to-end
- [ ] Wire into the PyPI publishing workflow
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output