Add the one-time migration's provisioning command for migrated reports

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

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

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

  • #944 @anth-volk による — マージされずにクローズ

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
backend, cli, database

調査の方向性

Start from the Simulation Entrypoint's migration/provisioning entry points and the existing Public API migration command; the payload names no files, so locate where the simulation schema, runtime role and v1 report export are configured. The command must read the versioned export, create simulation.simulations rows keyed by legacy_simulation_id, then simulation.reports rows keyed by legacy_report_id with year/options and no run, write the v1-to-v2 report ID map, and define the export schema/model/docs. Done means a dry run works, a second run creates nothing new, and the Public API command can consume the map; add tests for idempotency and dry-run.

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

説明

During the one-time migration of saved v1 reports to the v2 back end, the Simulation Entrypoint's simulation schema needs a row in simulation.reports for every v1 report an account row refers to, with its baseline and reform rows in simulation.simulations. Nothing creates those rows today.

What: an operator command, not an HTTP route, that reads the Public API's export of v1 report definitions and creates each report's simulations (keyed by legacy_simulation_id) and then the report (keyed by legacy_report_id), with its year and options and no run. It writes a file mapping each v1 report ID to its v2 report ID, which the Public API's migration command applies to account rows. It can run again without creating anything new, has a dry run, and connects as the runtime role.

Why: migrated reports must exist in sim before the Public API can point account rows at them. The first time a migrated report is opened, the Public API calculates it on the current catalog version.

The Public API's export does not exist yet, so this work also defines the input file's format: a versioned schema with a model and documentation, which the export will produce. The command is temporary and is removed once the v1 paths are retired.

主要言語
Python
スター
1
フォーク
1
平均マージ
1日 12時間
マージ済み PR(30日)
71

環境構築

はじめの一歩

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

PolicyEngine/policyengine-sim-api のほかの issue

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

似ている issue

Python の issue をもっと見る

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

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