`cre workflow build` ignores --target and compiles a random target's workflow-path
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 25
- Fork
- 31
- Merge medio
- 3g 6h
- PR unite (30g)
- 7
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di smartcontractkit/cre-cli
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
smartcontractkit/cre-cli#430 ·
I maintainer di solito rispondono entro 1 giorno
-
`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)Forse già presa @Tyagiquamar l’ha presa 80 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
smartcontractkit/cre-cli#582 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
smartcontractkit/cre-cli#569 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
smartcontractkit/cre-cli#507 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
smartcontractkit/cre-cli#393 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di smartcontractkit/cre-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug] vela config-template apply drops the template's metadata.descriptionForse già presa @backendArchitect l’ha presa oggi. Apertaarea/cli area/config good first issue type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kubevela/kubevela#7756 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno