Record why a v1 household failed to copy to v2

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

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
57/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python

調査の方向性

Start with _log_copy_operation in policyengine_api/services/household_mirroring.py and compare the household copy records with the policy copy records that use LegacyPolicyTranslationReason. Trace how translation failures and v2 household document rule failures are categorized, keeping personal data out of logged reasons. Done means failed records use the requested message and include the exception type and a fixed reason code for translation failures.

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

説明

The record logged when a v1 household fails to copy to v2 does not say why the copy failed, so the cause of the failures in #4194 can't be read from the logs.

What happens

_log_copy_operation in policyengine_api/services/household_mirroring.py writes one v1_household_mirror_operations record per copy:

  • The message is V1 household immediate copy completed for every outcome, including outcome error at severity ERROR.
  • A failure records only its broad failure_category (translation, integrity, database, configuration or unexpected). A translation failure records nothing about which part of the v1 household could not be translated. The exception's message can't be logged as it is: several messages hold the household's names, such as legacy person '<name>' belongs to multiple benunits records.

#4194 is an error group of these records on POST /<country_id>/household (3 of 6 production requests on 2026-11-05). Each record says only that a copy failed in some category.

Expected

  • A failed copy's record says V1 household immediate copy failed.
  • It records the exception's type (error_type) and, for a translation failure, a fixed reason code without personal data (failure_reason), as the policy copy records already do (LegacyPolicyTranslationReason). A translation whose result breaks a v2 household document rule, such as a person who belongs to no record of one entity collection, records that rule's reason.
主要言語
Python
スター
18
フォーク
33
平均マージ
2日 15時間
マージ済み PR(30日)
110

環境構築

はじめの一歩

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

PolicyEngine/policyengine-api のほかの issue

PolicyEngine/policyengine-api の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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