`cre workflow build` ignores --target and compiles a random target's workflow-path
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 55/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Go
- Star
- 25
- Fork
- 31
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của smartcontractkit/cre-cli
-
Hello World Go does not installĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
smartcontractkit/cre-cli#430 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`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)Có thể đã có người làm @Tyagiquamar đã nhận 80 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
smartcontractkit/cre-cli#582 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
smartcontractkit/cre-cli#569 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
smartcontractkit/cre-cli#507 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
smartcontractkit/cre-cli#393 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của smartcontractkit/cre-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] vela config-template apply drops the template's metadata.descriptionCó thể đã có người làm @backendArchitect đã nhận hôm nay. Đang mởarea/cli area/config good first issue type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
kubevela/kubevela#7756 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày