Skip to content

fix(mit-ol): install forum from our branch, drop the edx-django-utils fork - #208

Merged
blarghmatey merged 2 commits into
mainfrom
tmacey/forum-typesense-override
Sep 1, 2026
Merged

fix(mit-ol): install forum from our branch, drop the edx-django-utils fork#208
blarghmatey merged 2 commits into
mainfrom
tmacey/forum-typesense-override

Conversation

@blarghmatey

@blarghmatey blarghmatey commented Sep 1, 2026

Copy link
Copy Markdown
Member

What this does

Two override changes to deployments/mit-ol/build_manifest.yaml, in opposite directions.

Install forum from our branch (master cells only)

openedx/forum's Typesense search backend is non-functional on every search, not just some. Two defects, both present since the backend shipped in openedx/forum#225:

  • per_page is set to FORUM_MAX_DEEP_SEARCH_COMMENT_COUNT (1000); Typesense rejects anything above 250 with HTTP 422. Fires on every search, filtered or not.
  • The topic filter uses commentable_ids, but the collection schema declares commentable_id — HTTP 400 on any topic-scoped search.

Fix is openedx/forum#289 (all checks green, awaiting review, nudged). Until it merges and releases, six of the seven cells install forum from mitodl/forum@tmacey/fix-typesense-search-params.

This changes nothing at runtime today. typesense:forum_search_enabled is false or unset in all twelve environments, so forum search is on Elasticsearch regardless. What it does is make flipping that toggle possible — and forum search is the only index in the Elasticsearch estate with nonzero query counts, so it is what unblocks retiring those domains.

Applied to the three master cells and the three verawood cells. ulmo is the only exclusion, and for a hard reason: forum master declares requires-python >=3.12 and the ulmo cell builds on 3.11, so it cannot install there. It stays on openedx-forum==0.4.1.

Why verawood is safe

The 0.4.2 → master delta is ten commits. Normalising away the src/ layout move, only three modules are genuinely removed:

  • backends/mongodb/*
  • management/commands/forum_create_mongodb_indexes.py
  • toggles.py

None of it reaches us:

  • All twelve environments already set forum_v2.enable_mysql_backend to --everyone, so nothing is on the Mongo data backend.
  • openedx-platform imports neither forum.backends.mongodb nor forum.toggles (0 code-search hits on either).
  • Nothing in ol-infrastructure or lehrer invokes the removed management command.
  • toggles.py only ever defined the enable_mysql_backend waffle flag itself, redundant now that MySQL is the sole backend. Worth noting as a follow-up: our set_waffle_flags entries for forum_v2.enable_mysql_backend become dead config after this.

Everything else is packaging (uv, src/ layout, semantic-release) and typing.cast() wrappers around request.data in the views — no-ops at runtime. Forum master's only other constraint is Django>=4.2, which verawood satisfies.

Drop the edx-django-utils fork

openedx/edx-django-utils#549 merged and shipped in v8.0.2 — the release tag is identical to the merge commit — so the blarghmatey/edx-django-utils@otel-create-span branch is no longer needed.

The three master cells simply drop the override: edx-platform master already pins edx-django-utils==8.0.2.

The four verawood/ulmo cells cannot. Those branches pin 8.0.1, which predates the fix, so they take an explicit edx-django-utils==8.0.2 override instead. Deleting the override outright would have quietly regressed OpenTelemetryBackend.create_span() on four of the seven cells.

Testing

  • pre-commit run --files deployments/mit-ol/build_manifest.yaml passes (yamllint, Format YAML, check yaml, detect-secrets).
  • Manifest validates against build_manifest.schema.json; still 7 cells, each with the expected overrides.
  • Install target verified end to end: installed the branch into a clean Python 3.12 venv. It builds, reports version 0.4.5, declares name = "openedx-forum" matching the #egg= fragment, and the installed forum/search/typesense.py carries TYPESENSE_MAX_PER_PAGE = 250 and the singular commentable_id filter — i.e. the fix is really in the artifact.

Follow-up

Both overrides are temporary and carry a "remove once X merges" comment. The forum one comes out when openedx/forum#289 merges and releases; at that point those cells go back to whatever edx-platform pins on their branch.

… fork

Two override changes, in opposite directions.

Forum: the Typesense search backend is non-functional on every search, not
just some -- per_page is set above Typesense's hard cap of 250, and the topic
filter names a field the collection schema does not declare. Both have been
there since the backend shipped. Fix is openedx/forum#289, which is green and
awaiting review; until it merges and releases, the master cells install forum
from the branch. Scoped to master only: our branch is based on forum master,
so pointing verawood or ulmo at it would jump them across release boundaries
for no benefit -- both still have forum search on Elasticsearch.

This changes nothing at runtime today, since typesense:forum_search_enabled is
false everywhere. It is what makes flipping that toggle possible.

edx-django-utils: openedx/edx-django-utils#549 merged and shipped in 8.0.2, so
the fork branch is no longer needed. edx-platform master already pins 8.0.2 and
the three master cells simply drop the override. The verawood and ulmo cells
cannot: those branches pin 8.0.1, which predates the fix, so they take an
explicit 8.0.2 pin instead. Deleting the override outright would have quietly
regressed OpenTelemetryBackend.create_span() on four of the seven cells.
Copilot AI balanced review requested due to automatic review settings September 1, 2026 15:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates deployment dependency overrides to use upstream fixes appropriately.

Changes:

  • Installs the Typesense forum fix branch for master cells.
  • Removes the obsolete edx-django-utils fork.
  • Pins edx-django-utils 8.0.2 for older release cells.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

I had scoped this to the master cells out of caution rather than evidence.
Having actually diffed 0.4.2 against forum master, verawood can take it too.

The delta is ten commits, and only three modules are genuinely removed once
the src/ layout move is normalised away: backends/mongodb/*,
forum_create_mongodb_indexes, and toggles.py.

None of that reaches us. All twelve environments already run
forum_v2.enable_mysql_backend for everyone, so nobody is on the Mongo data
backend. Nothing in openedx-platform imports forum.backends.mongodb or
forum.toggles, and nothing in ol-infrastructure or lehrer invokes the removed
management command. toggles.py only ever defined the enable_mysql_backend
waffle flag itself, which is redundant now that MySQL is the sole backend --
worth noting that our set_waffle_flags entries for it become dead config.

The rest is packaging (uv, src layout, semantic-release) and typing.cast()
wrappers around request.data in the views, which are no-ops at runtime.

ulmo stays on 0.4.1, now for a concrete reason rather than caution: forum
master declares requires-python >=3.12 and the ulmo cell builds on 3.11, so
it cannot install. verawood builds on 3.12, and forum master's only other
constraint is Django>=4.2.

Verified by installing the branch into a clean 3.12 venv: builds, reports
0.4.5, and the installed forum/search/typesense.py carries
TYPESENSE_MAX_PER_PAGE = 250 and the singular commentable_id filter.
@blarghmatey
blarghmatey merged commit 4125932 into main Sep 1, 2026
23 checks passed
@blarghmatey
blarghmatey deleted the tmacey/forum-typesense-override branch September 1, 2026 15:41
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