Treat loosening a Point or polygon field contract as a compatible change

Abierto
#2,646 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
56/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
postgresql, rust
Área
backend, database

Línea de trabajo

Start with the widening rules in contract.rs and the geometry change classification in package.rs, then read covers_are_metadata_only in migration_plan.rs. Compare the existing Point precision behavior with the polygon case in tests/postgres_spatial_migration.rs. Done means loosening maximumPositions, precision, or bbox regenerates the CHECK constraint and PostGIS projection without requiring a SQL step, backup, or rehearsal, while tightening still requires a reviewed migration.

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

Descripción

area:breg enhancement

Changing a crs84-point or crs84-polygon field's contract is always treated as a destructive field type change, even when the change only loosens it. Raising maximumPositions (say from 100 to 500), raising precision, or widening or removing bbox cannot invalidate any retained value, yet the author has to write a reviewed migration with at least one SQL step, bind a backup and run a rehearsal.

Where
  • package.rs reports any geometry contract change as FieldTypeChanged.
  • FieldTypeChanged is not metadata-only (covers_are_metadata_only in migration_plan.rs), so a migration descriptor with no steps is refused.
  • The widening rules in contract.rs cover other field kinds but not Point or polygon contracts.
  • The polygon migration test needs a no-op rewrite step to change a contract (tests/postgres_spatial_migration.rs).

Point precision changes already behave this way, so #2644 is consistent with existing behaviour; this issue covers both.

Proposal

Classify loosening of a Point or polygon contract (higher maximumPositions, higher precision, wider or removed bbox) as a compatible change: the compiler regenerates the CHECK constraint and the generated PostGIS projection, with no SQL step, backup or rehearsal required. Tightening keeps the reviewed migration path, which already refuses retained values that violate the candidate contract before activation.

Until then, products/breg/SPATIAL-QUERIES.md should say what a contract change costs.

Lenguaje dominante
Rust
Estrellas
2
Forks
0
Merge medio
9 h 48 min
PR fusionados (30 d)
151

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 registrystack/registry-stack

Todos los issues de registrystack/registry-stack

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.