Keep old network operation names and allow connection-specific overrides
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 重構
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- python
研究方向
First review the prerequisite shared peer operations from #374, then read morango/sync/operations.py and morango/constants/settings.py:8-47. Trace SessionMiddlewareOperations.call in morango/registry.py and run the characterization suite plus tox -e postgres. Done means the eight deprecated network-only classes warn correctly, connection-specific overrides fall back after MorangoSkipOperation, default settings emit no warnings, and the suites pass unchanged.
由索引模型根據 Issue 內容生成。
描述
Overview
The old Network<Stage>Operation names stay available as deprecated, network-only classes, and the default settings use the new Peer* operations. This work is part of milestone M4.
Background & Motivation
Hosts such as Kolibri list operations by name in their settings, and some hosts make subclasses of them. After #374, the shared logic has new names. The old names must keep their current behavior, so that host code does not change behavior without a decision.
A clear order for the operations in each stage also lets a host change the behavior for one connection type only.
Design: spec. Plan: implementation plan, Task 14.
User Story
As a Kolibri developer,
I want the old operation names to keep working with a clear warning,
So that I can move to the new names on my own schedule.
Description & Expected Outcomes
Each old name stays as a subclass of the matching Peer* operation. These subclasses handle network connections only. Each one gives a DeprecationWarning when it is created, and its docstring names the replacement.
The default settings list the operations of each stage in this order:
- Local operations.
- Operations for one connection type, which includes the
LegacyNetwork*operations. - The shared
Peer*operation, as the last fallback.
An operation for one connection type can handle a stage, or it can decline with MorangoSkipOperation. If it declines, the shared operation handles the stage.
Deliverables & Contracts
The change delivers these capabilities:
- Eight deprecated classes:
Network{Initialize,Serialize,Queue,PushTransfer,PullTransfer,Dequeue,Deserialize,Cleanup}Operation. - Each deprecated class handles
NetworkSessionContextand does not handleDiskSessionContext. - The default settings give no deprecation warnings.
Acceptance Criteria
- Creating each
Network<Stage>Operationgives aDeprecationWarning. - Each deprecated class handles a
NetworkSessionContextand returnsFalsefor aDiskSessionContext. - Middleware built from the default settings gives no
DeprecationWarning. - A test operation for disk only, listed before
PeerInitializeOperation, handles a disk context and does not handle a network context. - If that test operation raises
MorangoSkipOperation,PeerInitializeOperationhandles the stage. - The characterization suite passes without edits on SQLite and with
tox -e postgres.
Technical Pointers & Architecture
- Target Components / Context:
morango/sync/operations.py,morango/constants/settings.py:8-47. - Related Patterns: The middleware stops at the first operation that handles a stage (
SessionMiddlewareOperations.__call__inmorango/registry.py). - Data Model & Schema Considerations: None.
- Resilience & Failure Modes: If a host lists only the old names, a disk sync fails with the registry error "no applicable middleware". The failure is loud, not silent.
Notes & Tradeoffs
- Dependencies: Blocked by: #374 (shared peer operations). Blocks: #376, #386.
- Testing Requirements: This is a refactor task. The characterization suite from #363 and #364 must pass without edits.
- Tradeoffs & Alternatives Considered: Plain aliases to the
Peer*classes are simpler. But host subclasses of an alias then start to run for disk without a decision. The spec rejects this. - Compatibility & Migrations: Kolibri must list the
Peer*operations in its settings before it can use disk export. The release that removes the old names is an open question in the spec.
Metadata
- Complexity: Medium
- Target Branch: release-v0.9.x
AI Usage
Drafted with Claude (Claude Code) from the approved design spec and implementation plan. The author reviewed the requirements, and the code references were checked against the release-v0.9.x codebase.
- 主要語言
- Python
- 星號
- 15
- 分支
- 27
- 平均合併
- 6 天 44 分鐘
- 30 天內合併 PR
- 13
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
learningequality/morango 的其他 Issue
-
Document disk export and deprecations in the changelog可能重新可做 @ArpitaSamanta10 於 14 天前認領,目前沒有進行中的 PR。 未關閉DEV: dev-ops DEV: distributions DOCS: developer
難度 1/5 1-3 小時 新手友好度 78/100
learningequality/morango#387 · 2 則留言 ·
維護者通常 1 天內回覆
-
DEV: backend DEV: dev-ops TAG: unit tests
難度 2/5 1-3 小時 新手友好度 70/100
learningequality/morango#385 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 54/100
learningequality/morango#425 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 1/100
learningequality/morango#424 ·
維護者通常 1 天內回覆
-
DEV: backend P2 - normal
難度 4/5 3-5 天 新手友好度 35/100
learningequality/morango#416 · 2 則留言 ·
維護者通常 1 天內回覆
查看 learningequality/morango 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
trezor/trezor-user-env#421 ·
-
難度 2/5 1-3 小時 新手友好度 84/100
-
難度 1/5 1-3 小時 新手友好度 91/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 82/100
tangentcode/tangentswarm#167 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆