kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Migrate kolibri-opensearch-plugin into the Python monorepo

Open rtibbles opened this issue 5 months ago • 2 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview

Migrate kolibri-opensearch-plugin from its standalone repo into python_packages/ as a workspace member. Python-only — no frontend — so it follows the sync-extras pattern.

Per-plugin migration under #13720, following #14663 (setup), #14666 (sentry), sync-extras, oidc-client (#14948), and oidc-provider (#14949).

Complexity: Medium Target branch: develop

Context

kolibri-opensearch-plugin exposes an OpenSearch description document so Kolibri content is searchable from browsers/other clients (the OpenSearch description protocol, not Elasticsearch). Its standalone repo contains:

  • Python module (kolibri_opensearch_plugin/): kolibri_plugin.py, root_urls.py, views.py.
  • External Python dep discrepancy: requirements.txt pins feedparser==6.0.10, setup.py declares feedgenerator — only one is the real runtime dep. Plus kolibri>=0.14.
  • setup.cfg/setup.py, Makefile, LICENSE, AUTHORS.rst, CONTRIBUTING.rst, .flake8, requirements.txt, README.md.

The Change

  • Move the plugin into python_packages/kolibri-opensearch-plugin/ and register it as a uv workspace member, per #14663 conventions.
  • Preserve git history via git filter-repo --to-subdirectory-filter + git merge --allow-unrelated-histories (procedure from #14663).
  • Resolve the feedparser/feedgenerator discrepancy by checking which kolibri_opensearch_plugin/views.py actually imports; the pyproject.toml declares only that.

Out of Scope

  • Migrating other external plugins — separate per-plugin tasks under #13720.
  • Publishing to PyPI — the wiring lands here, the release action is a separate step.
  • Archiving the source repo.
  • Behavioural changes to the OpenSearch plugin — like-for-like migration (a dependency bump is allowed where needed for the migration to work).

Acceptance Criteria

Code migration

  • [ ] Plugin code at python_packages/kolibri-opensearch-plugin/ (Python module).
  • [ ] pyproject.toml replaces setup.cfg/setup.py.
  • [ ] pyproject.toml follows #14663 conventions and declares a static version.
  • [ ] pyproject.toml declares the reconciled runtime dependency (feedparser or feedgenerator, per views.py).
  • [ ] Standalone-only / root-duplicative files (Makefile, LICENSE, AUTHORS.rst, CONTRIBUTING.rst, .flake8, setup.cfg, setup.py, requirements.txt) absent.
  • [ ] Plugin-specific README kept.
  • [ ] Migrated code passes monorepo pre-commit without per-file ignores.
  • [ ] History preserved via git filter-repo --to-subdirectory-filter.
  • [ ] git blame on migrated files traces to original commits.

Workspace integration

  • [ ] Appears as a uv workspace member; uv sync --group dev includes it.
  • [ ] Import name added to known-first-party in root pyproject.toml's ruff isort config.

Publishing / CI

  • [ ] pypi_packages_publish.yml lists kolibri-opensearch-plugin (paths filter + workflow_dispatch options).
  • [ ] If the plugin has tests, a Stage 2 per-member-package job (modelled on sync_extras_plugin_tests) runs them and is in stage2_required_checks's needs:.

Runtime

  • [ ] A wheel built from the migrated directory installs into a fresh virtualenv alongside Kolibri.
  • [ ] After installation, Kolibri loads the plugin.
  • [ ] The OpenSearch description document is served.

References

  • Source repository: https://github.com/learningequality/kolibri-opensearch-plugin
  • Prior migrations: #14663 (setup), #14666 (sentry), #14948 (oidc-client), #14949 (oidc-provider), sync-extras (Python-only)
  • uv workspaces: https://docs.astral.sh/uv/concepts/projects/workspaces/

AI usage

Used Claude Code to draft this issue iteratively. I drove scope and decisions. Claude reviewed the source repo and surfaced the runtime-dependency discrepancy between requirements.txt (feedparser==6.0.10) and setup.py (feedgenerator) that the reconcile criterion resolves against views.py.

rtibbles avatar Jul 03 '26 07:07 rtibbles

Plan: Move kolibri-opensearch-plugin (source: https://github.com/learningequality/kolibri-opensearch-plugin) into python_packages/kolibri-opensearch-plugin/ as a uv workspace member, preserving its git history, following the #13720 per-plugin migration pattern established by #14663 (setup), #14666 (sentry), and #14949 (oidc-provider).

  • [ ] Update the working branch onto latest develop
  • [ ] Import kolibri-opensearch-plugin's history into python_packages/
  • [ ] Remove standalone-repo-only files
  • [ ] Package for the uv workspace
  • [ ] Register kolibri-opensearch-plugin for PyPI publishing
  • [ ] Build, install, and verify the plugin loads and serves

@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

rtibblesbot avatar Jul 04 '26 01:07 rtibblesbot

The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.

rtibblesbot avatar Jul 04 '26 03:07 rtibblesbot