Record why a v1 household failed to copy to v2

Offen
#4,221 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
57/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
python

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.
Vorherrschende Sprache
Python
Sterne
18
Forks
33
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
110

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PolicyEngine/policyengine-api

Alle Issues in PolicyEngine/policyengine-api

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.