`cre workflow build` ignores --target and compiles a random target's workflow-path
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
Start with internal/settings/workflow_settings.go and trace how cre workflow build obtains its workflow path versus how hash and deploy resolve the selected target. Use the two-target YAML example in the issue to reproduce the mismatch; done means build --target creator-settings consistently builds create-workflow.ts or rejects --target with documented behavior.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens
cre workflow build ignores --target. When workflow.yaml has more than one target with different workflow-paths, the command compiles a randomly chosen target's workflow, and the choice can change from one run to the next.
cre workflow hash --target and cre workflow deploy --target are not affected: they compile the target's own workflow-path every time.
Why
build gets its source path from settings.GetWorkflowPathFromFile, which calls workflowPathFromRaw (internal/settings/workflow_settings.go). That function ranges over the parsed YAML map and returns the first workflow-path it finds. Go map iteration order is randomised, and the --target value is never consulted.
Reproduce
A workflow.yaml with two targets:
resolver-settings:
user-workflow:
workflow-name: "resolver"
workflow-artifacts:
workflow-path: "./workflow.ts"
config-path: "./config.json"
creator-settings:
user-workflow:
workflow-name: "creator"
workflow-artifacts:
workflow-path: "./create-workflow.ts"
config-path: "./config.json"
for i in 1 2 3 4 5 6; do
cre workflow build . --target creator-settings -o out.wasm >/dev/null && wc -c < out.wasm
done
Expected: six identical sizes, the build of create-workflow.ts.
Actual: the size alternates between the two workflows. With our two-entry project, six runs gave 6038515 (workflow.ts) twice and 5944943 (create-workflow.ts) four times, on both v1.31.0 and v1.39.0 (darwin/arm64).
Impact
We used cre workflow build --target to compute an expected workflow ID before deploying, to skip re-deploying shards that hadn't changed. Because the wrong workflow was sometimes compiled, the check produced false "changed" results and we deleted and re-registered unchanged workflows. We have switched to cre workflow hash --target, which compiles the right file.
Suggested fix
Have build resolve workflow-path from the --target settings, as hash and deploy do. Alternatively, reject --target on build and document that it uses the folder's single workflow. At minimum, iterate keys in a deterministic order so the result is stable.
- Lenguaje dominante
- Go
- Estrellas
- 25
- Forks
- 31
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 7
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 smartcontractkit/cre-cli
-
Hello World Go does not installAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
smartcontractkit/cre-cli#430 ·
Los mantenedores suelen responder en 1 día
-
`cre update` installs a glibc-2.38 binary on glibc-2.36 hosts and bricks the CLI (an `_ldd2-35` asset exists but is never selected)Posiblemente ocupada @Tyagiquamar la tomó hace 80 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
smartcontractkit/cre-cli#582 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
smartcontractkit/cre-cli#569 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
smartcontractkit/cre-cli#507 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
smartcontractkit/cre-cli#393 ·
Los mantenedores suelen responder en 1 día
Todos los issues de smartcontractkit/cre-cli
Issues similares
-
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 72/100
google/osv-scanner#3341 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
Los mantenedores suelen responder en 2 días
-
[Bug] vela config-template apply drops the template's metadata.descriptionPosiblemente ocupada @backendArchitect la tomó hoy. Abiertoarea/cli area/config good first issue type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
kubevela/kubevela#7756 · 1 comentario ·
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