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

Abierto
#943 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

  • #944 de @anth-volk — cerrado sin fusionar

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend, cli, database

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1
Forks
1
Merge medio
1 d 12 h
PR fusionados (30 d)
71

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de PolicyEngine/policyengine-sim-api

Todos los issues de PolicyEngine/policyengine-sim-api

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.