Shared connection interface for network and disk syncs
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 重构
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
Resolve the dependency on #369, then read morango/sync/syncsession.py around Connection, NetworkSyncConnection, and TransferClient.init. Review the characterization suite from #363 and #364 and tests/testapp/tests/sync/test_context.py before changing the interface. Done means the acceptance criteria pass, including deprecated aliases and keywords, no Morango reads of server_info, and unchanged characterization tests.
由索引模型根据 Issue 内容生成。
描述
Overview
This task (milestone M3) turns the empty Connection class into an abstract interface. NetworkSyncConnection implements it, and TransferClient depends only on it. The task also renames the server names that both connection types use to peer names, with deprecated aliases.
Background & Motivation
TransferClient depends on the network connection in two ways. It creates a NetworkSessionContext directly, and it reads server_info. A disk connection needs its own session context, so the connection must create it.
The word "server" does not fit a disk peer. The design uses "peer" in shared code. Hosts such as Kolibri still use server_info and the server_cert keyword, so these names stay as deprecated aliases.
Design: spec. Plan: implementation plan, Task 9.
User Story
As a Kolibri developer,
I want one connection interface for network and disk syncs,
So that sync code works with either connection type without changes.
Description & Expected Outcomes
Connection groups its members by caller: peer identity, sync session lifecycle, certificates, and the Peer protocol. The Peer protocol methods are declared here. #371 implements them for the network.
NetworkSyncConnection gets peer_info, connection_kind, and create_session_context(). The old server_info property still works and emits DeprecationWarning. create_sync_session accepts peer_cert. The old server_cert keyword still works and emits DeprecationWarning.
TransferClient builds its session context from create_session_context(), and it reads capabilities from the connection.
Deliverables & Contracts
The task delivers:
Connectionas an abstract base class with the members in spec §3.2.NetworkSyncConnection.peer_info,connection_kind = "network", andcreate_session_context().create_sync_session(client_cert, peer_cert=None, chunk_size=None, server_cert=None).- A
TransferClientthat uses onlyConnectionmembers.
Acceptance Criteria
-
NetworkSyncConnectionis a subclass ofConnection. -
server_infoemitsDeprecationWarningand returns the same value aspeer_info. -
create_sync_sessionwith theserver_certkeyword emitsDeprecationWarningand behaves likepeer_cert. -
create_sync_sessionwith neither certificate raisesValueError. - The
TransferClientcontext holds aLocalSessionContextand the context fromcreate_session_context(). - Morango code has no reads of
server_info. - The characterization suite passes without edits.
Technical Pointers & Architecture
- Target Components:
morango/sync/syncsession.py:111(Connection),:125-517(NetworkSyncConnection),:609-626(TransferClient.__init__). - Related Patterns: The deprecated names follow the same pattern as the deprecated
Network*operations in #375. - Data Model & Schema Considerations: None. The model fields
server_fsic,server_certificate, andis_serverkeep their names. - Resilience & Failure Modes: None.
Notes & Tradeoffs
- Dependencies: Blocked by: #369 (Typed value for the peer view of a transfer session). Blocks: #371, #373, #383.
- Testing Requirements: This is a refactor. The characterization suite from #363 and #364 must pass without edits. Tests in
tests/testapp/tests/sync/test_context.pybuild mocks withserver_info. Do not change them. - Tradeoffs & Alternatives Considered: A split into two interfaces was rejected. The disk transfer methods need the archive and certificates of the connection, so a split spreads connection details across two objects.
- Compatibility & Migrations: Kolibri must move from
server_infotopeer_info, and fromserver_certtopeer_cert. The deprecated names stay until a later release.
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
维护者通常 1 天内回复
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"可能已有人在做 @cestercian 今天认领。 未关闭comp/cli P2 type/bug
难度 2/5 1-3 小时 新手友好度 75/100
NousResearch/hermes-agent#162259 · 1 条评论 ·
维护者通常 1 天内回复
-
bug enhancement
难度 1/5 1 小时以内 新手友好度 90/100
AOSSIE-Org/PictoPy#1802 · 2 条评论 ·
维护者通常 3 天内回复
-
community-request
难度 2/5 1-3 小时 新手友好度 78/100
NVIDIA-NeMo/Run#727 ·
维护者通常 1 天内回复
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
难度 2/5 1-3 小时 新手友好度 75/100
pytorch/pytorch#207247 · 1 条评论 ·
维护者通常 1 天内回复