Typed value for the peer view of a transfer session
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 72/100
調査の方向性
First check the dependency in #364, then read the planned new module morango/sync/peer.py alongside morango/constants/transfer_stages.py, morango/constants/transfer_statuses.py, and TransferSessionSerializer in morango/api/serializers.py. Add unit tests for both constructors, validation, immutability, equality, Python 3.6 compatibility, and empty counts; done means all listed acceptance criteria pass.
索引モデルが issue の本文から書いたものです。
説明
Overview
This task (milestone M3) adds PeerTransferSession, an immutable value that describes a transfer session as the peer sees it. The Peer protocol in #370 and #371 returns this value.
Background & Motivation
Today the network operations read raw JSON dictionaries from server responses. The disk connection has no JSON, so operations need a value that does not depend on the transport. A typed value also makes invalid stage and status values fail early, at the connection boundary.
Design: spec. Plan: implementation plan, Task 8.
Description & Expected Outcomes
The value has these fields: id, filter, push, records_total, records_transferred, transfer_stage, transfer_stage_status, server_fsic, and client_fsic. Nobody can change a value after it exists. Two values with the same fields are equal.
A network connection builds the value from server JSON. A disk connection builds it from a TransferSession row. The value rejects an unknown stage or status. An empty record count becomes 0.
Deliverables & Contracts
The task delivers:
PeerTransferSessionin the new modulemorango/sync/peer.py.PeerTransferSession.from_api_json(data)andPeerTransferSession.from_model(transfer_session).
Acceptance Criteria
-
from_api_jsonandfrom_modelgive equal values for the same transfer session state. - An unknown
transfer_stageortransfer_stage_statusraisesValueError. - A
records_totalofNonebecomes 0. - An attempt to set an attribute raises
AttributeError. - The class works on Python 3.6.
Technical Pointers & Architecture
- Target Components: New module
morango/sync/peer.py. - Related Patterns:
morango/constants/transfer_stages.pyandmorango/constants/transfer_statuses.pygive the valid values. The server JSON shape comes fromTransferSessionSerializerinmorango/api/serializers.py. - Data Model & Schema Considerations: No schema change. The value is not stored.
- Resilience & Failure Modes: Invalid peer data fails at construction with
ValueError.
Notes & Tradeoffs
- Dependencies: Blocked by: #364 (Tests that pin today's legacy network sync behavior). Blocks: #370, #371.
- Testing Requirements: Unit tests only.
- Tradeoffs & Alternatives Considered: Python 3.6 has no
dataclasses, so the class uses__slots__and read-only properties.
Metadata
- Complexity: Low
- 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分
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
learningequality/morango のほかの issue
-
Document disk export and deprecations in the changelog再び着手できるかも @ArpitaSamanta10 が 14 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン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 日以内に返信