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

未关闭
#943 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #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 小时
30 天内合并 PR
71

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

PolicyEngine/policyengine-sim-api 的其他 Issue

查看 PolicyEngine/policyengine-sim-api 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。