vote-tally: date_order_mismatches compares ISO dates as text, so UTC offsets are misread

オープン 初心者向け
#2,240 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

2026年11月23日 から。

  • #2241 @leninworld による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
tooling

調査の方向性

tools/release-management/src/release_management/vote_tally/tally.py の tally() 内、str(after) < str(before) の比較から始め、parse_roster と投票の dict が date の値を文字列としてどう渡しているかを読む。issue に示された再現スクリプトを uv run --project tools/release-management python repro.py で実行し、比較する前に両方の日付をタイムゾーン対応のインスタント(例: datetime.fromisoformat)にパースする。同じ修正を plugins/magpie-security-tools/tools/release-management/ 以下のコピーにも適用し、両方が同期したままになるようにする。完了とは、最初のサンプルが date_order_mismatches に載り、2 番目は載らないことである。

索引モデルが issue の本文から書いたものです。

説明

What's broken

vote-tally tally decides whether a changed vote's date "runs backwards" against thread order by comparing the two ISO-8601 date strings as text. When the dates carry different UTC offsets, date_order_mismatches misses a real backwards date and flags a date that is in order.

Which layer

tools/release-management/src/release_management/vote_tally/tally.py, in tally(): if before and after and str(after) < str(before): (plus the plugin copy under plugins/magpie-security-tools/tools/release-management/).

How to reproduce
from release_management.vote_tally.tally import parse_roster, tally

roster = parse_roster("| Apache ID | Primary email |\n|---|---|\n| alice | [email protected] |")

def mismatches(first, second):
    votes = [
        {"from": "[email protected]", "date": first, "value": "-1"},
        {"from": "[email protected]", "date": second, "value": "+1"},
    ]
    return tally(votes, roster, {}, False, "dev-list-vote")["date_order_mismatches"]

print(mismatches("2026-06-11T09:00:00Z", "2026-06-11T10:30:00+02:00"))  # 08:30Z, earlier: prints []
print(mismatches("2026-06-11T09:00:00+02:00", "2026-06-11T08:00:00Z"))  # 07:00Z then 08:00Z, in order: flagged

Run with uv run --project tools/release-management python repro.py.

Expected vs actual

superseded-votes.md says: "A vote whose date runs backwards against thread order is listed in date_order_mismatches". The vote-tally SKILL.md passes date as <ISO-8601>, and vote replies come from senders in different time zones.

Expected: the two dates are compared as instants, so the first case is listed and the second is not.
Actual: the first case returns [], and the second lists a mismatch whose later vote is 1 hour after the earlier one.

The counted vote is not affected (thread order decides it); only the RM-facing date_order_mismatches report is wrong.

Surface area (optional)

Only this comparison. pr_review_votes also compares submittedAt as text, but GitHub always returns UTC Z timestamps there, so it is not affected.

主要言語
Python
スター
152
フォーク
133
平均マージ
12時間 39分
マージ済み PR(30日)
384

環境構築

はじめの一歩

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

apache/magpie のほかの issue

apache/magpie の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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