Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Remove the deferred FK validation API and unused backend bulk helpers

オープン
#396 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

@bjester がすでに取り組んでいます。

2026年10月19日 から。

評価

この issue はまだ評価されていません。

説明

TAG: tech update / debt

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

Overview

Remove the deferred FK validation API and the backend bulk-write helpers that no Morango code calls after the streaming deserialization migration.

Background & Motivation

#392 replaced legacy deserialization with the streaming pipeline in morango/sync/stream/deserialize.py. The removed legacy code was the only caller of the following. Each one now has no caller in Morango outside its own definition and tests:

Item Location Remaining users in Morango
SyncableModel.deferred_clean_fields morango/models/core.py test_deferred_clean_fields in tests/testapp/tests/models/test_core.py
ForeignKeyReference morango/models/core.py deferred_clean_fields only
TemporaryTable morango/sync/backends/utils.py none
_bulk_full_record_upsert morango/sync/backends/base.py, postgres.py, sqlite.py none
_bulk_update morango/sync/backends/base.py, postgres.py, sqlite.py none

The design spec for #392 kept them on purpose, to keep the SyncableModel API stable in that PR. A search of learningequality/kolibri (develop) finds no use of any of them. The one _bulk_update match, in kolibri/core/attendance/test/test_api.py, is unrelated to these backend helpers.

User Story / Use Case

As a Morango maintainer,
I want the code that the deserialization path no longer uses to be gone,
So that readers do not mistake it for a live code path, and we do not maintain it for each database backend.

Description & Expected Outcomes
  • The five items above no longer exist, and neither do the tests that only exercise them.
  • Imports that only these items used are removed.
  • The 0.9.0 section of CHANGELOG.md lists each removed public name, like the other removals in that release.

If you find a caller that we missed, keep that item and record the reason in the PR.

Value Add & Impact
  • Less dead code in the sync backends. The backends hold SQL for each database, which makes unused code there costly to read and to change.
  • deferred_clean_fields no longer suggests a supported way to validate FKs that nothing in Morango uses.

Deliverables & Contracts

  • Remove SyncableModel.deferred_clean_fields and ForeignKeyReference.
  • Remove TemporaryTable.
  • Remove _bulk_full_record_upsert and _bulk_update from the base, PostgreSQL and SQLite backends.
  • Add the removals to the 0.9.0 changelog.
Acceptance Criteria
  • A search of morango/ and tests/ finds none of the five names.
  • CHANGELOG.md lists the removals under 0.9.0.
  • make test passes on SQLite and PostgreSQL.
  • prek run --all-files passes.

Technical Pointers & Architecture

  • Target Components / Context: morango/models/core.py, morango/sync/backends/.
  • Related Patterns: #392 removed the legacy deserialization path in the same way, with changelog entries under 0.9.0.
  • Data Model & Schema Considerations: None. No model fields or migrations change.
  • Resilience & Failure Modes: None at runtime, since nothing calls this code.

Notes & Tradeoffs

  • Dependencies: Blocked by #392. Do this before 0.9.0 ships, so that all the removals land in one release.
  • Related: #394. morango/sync/backends/postgres.py and sqlite.py are excluded from ruff, so the hooks will not flag imports that become unused there. Check those files by hand.
  • Testing Requirements: Run the full suite on both databases, because the backend helpers differ for each database.
  • Tradeoffs & Alternatives Considered: Keeping the items for external callers was considered. No Kolibri use exists, and 0.9.0 already removes other private deserialization APIs.

Metadata

Complexity: Low
Target Branch: release-v0.9.x
Labels: TAG: tech update / debt

AI Usage

Drafted with Claude Code from review feedback on #392. Claude searched Morango for the remaining callers of each item, and searched Kolibri on GitHub for external use. I chose to track this as a separate issue instead of expanding #392.

主要言語
Python
スター
15
フォーク
23
平均マージ
2日 8時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

learningequality/morango のほかの issue

learningequality/morango の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。