`cre workflow build` ignores --target and compiles a random target's workflow-path
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 55/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Go
- Étoiles
- 25
- Forks
- 31
- Merge moyen
- 3 j 6 h
- PR mergées (30 j)
- 7
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de smartcontractkit/cre-cli
-
Hello World Go does not installOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
smartcontractkit/cre-cli#430 ·
Les mainteneurs répondent en général sous 1 jour
-
`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)Peut-être pris @Tyagiquamar l’a pris il y a 80 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
smartcontractkit/cre-cli#582 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
smartcontractkit/cre-cli#569 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 15/100
smartcontractkit/cre-cli#507 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
smartcontractkit/cre-cli#393 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de smartcontractkit/cre-cli
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
google/osv-scanner#3341 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 69/100
Les mainteneurs répondent en général sous 2 jours
-
[Bug] vela config-template apply drops the template's metadata.descriptionPeut-être pris @backendArchitect l’a pris aujourd’hui. Ouvertearea/cli area/config good first issue type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
kubevela/kubevela#7756 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours