kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Migrate kolibri-oidc-provider-plugin into the Python monorepo

Open rtibbles opened this issue 5 months ago • 3 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-oidc-provider-plugin from its standalone repo into python_packages/ as a workspace member. Python-only — no frontend — so it follows the sync-extras pattern, not oidc-client's.

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

Complexity: Medium Target branch: develop

Context

kolibri-oidc-provider-plugin lets Kolibri act as an OpenID Connect provider (other apps authenticate against Kolibri). Its standalone repo contains:

  • Python module (kolibri_oidc_provider_plugin/): kolibri_plugin.py, options.py, root_urls.py, settings.py.
  • A management command: management/commands/oidccreateclient.py.
  • Django templates: templates/oidc_provider/{authorize,authorize_without_consent,error}.html.
  • External Python dep django-oidc-provider (requirements.txt pins ==0.7.0; setup.py leaves it unpinned) plus kolibri>=0.14.
  • setup.cfg/setup.py, Makefile, MANIFEST.in, LICENSE, AUTHORS.rst, CONTRIBUTING.rst, standalone CI, requirements.txt, and a provider-client.md doc.

The Change

  • Move the plugin into python_packages/kolibri-oidc-provider-plugin/ and register it as a uv workspace member, following the sync-extras pattern and #14663 conventions.
  • Preserve git history via git filter-repo --to-subdirectory-filter + git merge --allow-unrelated-histories (procedure from #14663).
  • Reconcile the django-oidc-provider version discrepancy (see Context); the pyproject.toml declares the version actually needed.

Out of Scope

  • Migrating other external plugins — separate per-plugin tasks under #13720.
  • Publishing to PyPI or archiving the source repo — publishing wiring lands here; the release action itself is a separate step.
  • Behavioural changes to the OIDC provider — like-for-like migration (bumping django-oidc-provider is allowed where needed for the migration to work).

Acceptance Criteria

Code migration

  • [ ] Plugin code at python_packages/kolibri-oidc-provider-plugin/ (Python module, management command, templates).
  • [ ] pyproject.toml replaces setup.cfg/setup.py, follows #14663 conventions, declares a static version and django-oidc-provider at the reconciled version.
  • [ ] Standalone-only / root-duplicative files (.github/, Makefile, MANIFEST.in, LICENSE, AUTHORS.rst, CONTRIBUTING.rst, setup.cfg, setup.py, requirements.txt) absent; plugin-specific README and provider-client.md 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-oidc-provider-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 OIDC authorize/consent flow renders.
  • [ ] oidccreateclient runs.

References

  • Source repository: https://github.com/learningequality/kolibri-oidc-provider-plugin
  • Prior migrations: #14663 (setup), #14666 (sentry), #14948 (oidc-client), 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, confirmed it is Python-only (so it follows the sync-extras pattern rather than oidc-client's frontend wiring), and surfaced the django-oidc-provider version discrepancy between requirements.txt (==0.7.0) and setup.py (unpinned) that the reconcile criterion addresses.

rtibbles avatar Jul 03 '26 06:07 rtibbles

Watching for resolution on behalf of learningequality/kolibri#14950.

rtibblesbot avatar Jul 03 '26 07:07 rtibblesbot

@rtibbles can i work on this issue as i see its has various parts Ik OIDC i implemented whole OIDC from scartch myself

Dhirenderchoudhary avatar Jul 03 '26 22:07 Dhirenderchoudhary

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.

learning-equality-bot avatar Jul 03 '26 22:07 learning-equality-bot