Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add the Simulation Entrypoint's own Postgres schema, persistence library and migration chain

Đang mở
#844 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@anth-volk đang làm issue này rồi.

Từ ngày 19/10/2026.

  • #847 của @anth-volk — đang mở

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
15/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
github-actions, google-cloud, postgresql, python
Lĩnh vực
backend, databases, devops

Hướng nghiên cứu

Start by reading the repository rule sim.stage12.no-migration-chain and the existing migration and deploy workflows. The issue names libs/policyengine-simulation-persistence, migrations/, and GET /ready as the main entry points; map their existing conventions before changing them. Done means the migration chain passes upgrade, check, downgrade, and upgrade on fresh PostgreSQL, deploy applies it before the candidate, and the existing pass-through routes and Stage 12 comparison still behave as before.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Context

Step 1 of the API v2 migration (item 1A-2) gives the Simulation Entrypoint its own durable state in the v2 Postgres database. Today the repository rule sim.stage12.no-migration-chain forbids any Alembic chain here: the only tables the simulation services touch are the temporary Stage 12 comparison tables, which the Public API owns and migrates.

Scope

  • Replace sim.stage12.no-migration-chain with ownership rules for the Simulation Entrypoint's own schema:
    • one Alembic chain at migrations/, schema simulation, version table simulation.alembic_version;
    • the Modal executor and gateway never depend on the persistence library;
    • no Modal secret or deployment receives a simulation database URL (the Stage 12 secret stays the only database credential in Modal until Stage 12 is removed).
  • Add libs/policyengine-simulation-persistence with an initial revision, and a CI job that runs the chain's upgrade, alembic check, downgrade and upgrade on a fresh PostgreSQL.
  • Add a deploy job that applies the migrations before the Simulation Entrypoint candidate deploys, using a migrator URL that only that job receives.
  • Give the Simulation Entrypoint SIMULATION_DATABASE_URL (runtime role) from Secret Manager, and report the database's migration revision in GET /ready.

The old-gateway pass-through routes and the Stage 12 comparison must behave exactly as before; nothing in production reads or writes the new schema yet.

Operator prerequisites (both environments, before merge)

Merging to main deploys staging and then production, and the deploy requires these:

  • Create the simulation_migrator and simulation_runtime database roles in the staging and production v2 databases. simulation_migrator must be able to create the simulation schema (or the schema must be created in advance and owned by it).
  • Store the migrator URL as the SIMULATION_MIGRATION_DATABASE_URL secret in this repository's beta and prod GitHub environments.
  • Store the runtime URL in Secret Manager in the Simulation Entrypoint's Google Cloud project, readable only by sim-entry-beta-runtime and sim-entry-prod-runtime (and listable by the deploy service account), and set its name as the SIMULATION_DATABASE_URL_SECRET_NAME variable in beta and prod.
Ngôn ngữ chính
Python
Star
1
Fork
1
Merge trung bình
1 ngày 16 giờ
Pull request đã merge (30 ngày)
53

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PolicyEngine/policyengine-sim-api

Tất cả issue của PolicyEngine/policyengine-sim-api

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.