base-output-filename: duplicate names silently overwrite outputs; dotted names are truncated
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 68/100
Línea de trabajo
Start in ogc/bblocks/validate.py, tracing the output_base_filenames collision guard, sanitize_filename, and with_suffix usage; then read the base-output-filename definition in examples.schema.yaml. Check how outputs from examples, snippets, tests/, and extra test resources are named. Done means the chosen duplicate and dotted-name behavior is implemented consistently, covered by tests, and described in the schema.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
While documenting base-output-filename for the authoring skills, I traced how it is used in ogc/bblocks/validate.py and found some gaps. The field is defined per example in examples.schema.yaml. The default when it is unset is example_<n>_<m>.<ext>, and the value drives the snippet copy, .jsonld, .ttl, .validation_*.txt and transform outputs.
1. Duplicate names silently overwrite each other
The collision guard in validate.py (while output_fn.stem in output_base_filenames: ... with_stem(f"{stem}-{i}")) only protects against clashes with files from tests/ and extra test resources, because output_base_filenames is populated only from those. Example outputs are never added to it, so:
- Two examples with the same
base-output-filenameoverwrite each other's outputs, with no warning and no error. - Snippets in the same example share the example's base name. Snippets with different languages differ only by extension, so their
.jsonld,.ttland.validation_*.txtoutputs collide. Snippets with the same language overwrite each other completely.
The same happens if the name is copy-pasted between examples, which is easy to do when adding a new one.
2. Dotted names lose their last segment
The value goes through sanitize_filename(...) and then .with_suffix(f'.{extension}'). with_suffix replaces the last suffix, so my.feature becomes my.<ext>. The schema text ("Extension, if any, will be discarded") is intentional for my-feature.json, but it can't distinguish that from a dotted name that isn't an extension (versions, v1.2-example, etc.).
Possible fixes
- Track example outputs in
output_base_filenamestoo, so the existing-1,-2disambiguation applies to them, or fail/warn on a duplicatebase-output-filename. - Disambiguate snippets within one example (for example by appending the snippet index when the example has more than one snippet).
- Append the extension instead of using
with_suffix, and strip only known extensions. Or document that dots are not allowed. - Whichever behavior is chosen, mention it in the schema
descriptionforbase-output-filename.
Found against local checkout at commit 6411aed. The line numbers may differ upstream.
- Lenguaje dominante
- Python
- Estrellas
- 1
- Forks
- 6
- Merge medio
- 23 h 43 min
- PR fusionados (30 d)
- 7
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de opengeospatial/bblocks-postprocess
-
Improve build strategyAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
opengeospatial/bblocks-postprocess#102 · 12 comentarios ·
-
if no bblocks highlighted, assume all are.Posiblemente ocupada @avillar la tomó hace 14 días. Abierto
opengeospatial/bblocks-postprocess#96 · 3 comentarios · 1 asignado ·
-
Annotate output is not reproducible: properties[] order varies between runs on identical sourcesPosiblemente ocupada @avillar la tomó hace 26 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 56/100
opengeospatial/bblocks-postprocess#91 · 1 comentario · 1 asignado ·
-
JSON schema library version review.Quizá libre de nuevo @avillar la tomó hace 32 días y no hay ningún pull request abierto. Abierto
opengeospatial/bblocks-postprocess#89 · 3 comentarios · 1 asignado ·
-
Test failures cannot distinguish advisory SHACL results (sh:Warning / sh:Info) from sh:ViolationAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
opengeospatial/bblocks-postprocess#88 · 2 comentarios · 1 asignado ·
Todos los issues de opengeospatial/bblocks-postprocess
Issues similares
-
cost:cheap practicality:seen-in-the-wild severity:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Los mantenedores suelen responder en 1 día
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
randomparity/kdive#3495 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/markitdown#2820 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días