← Back to issue list

fix(validator): use stdout for command output

View original Github issue

Metadata

Project
craft-parts
Number
#1691
Type
pull request
State
open
Author
gcomneno
Labels
Created
Updated
Closed

Current evaluation

Fixes Go plugin env validation by returning stdout instead of stderr from _execute(). Closes #1447. Has passing CI and regression tests; awaiting maintainer review.

Suggested action: needs review

Reason: This is a small, focused bug fix (+18/-2 lines) addressing issue #1447 where Go plugin validation fails when `go version` triggers a toolchain auto-download. The PR has passing CI (the s390x failure is a pre-existing issue on main), includes regression tests, and the author has addressed review feedback. However, no maintainer has reviewed it yet (0 reviewers, pending status), so it needs maintainer review before merging.

Impact: 45 Quick Win: 38.25 Staleness: 35 Complexity: 15 Confidence: 75

Issue body

## Summary Fix plugin environment validation when a dependency writes informational messages to stderr while its semantic version is written to stdout. This affects the Go plugin when Go automatically downloads a toolchain during `go version`. In that case Go can emit: `go: downloading go1.25.6 (linux/amd64)` to stderr, and the previous validator implementation incorrectly treated stderr as the command output. This PR makes `_execute()` return stdout as the command output. Closes #1447. ## Validation - TDD regression test initially failed with the previous implementation: `stdout-value` expected, `stderr-value` returned. - Regression test passes after the fix. - `tests/unit/plugins/test_validator.py`: 6 passed - `tests/unit/plugins/test_go_plugin.py`: 19 passed - Ruff check: passed - Ruff format check: passed - `git diff --check`: passed ## AI Disclosure AI assistance was used during analysis and implementation of this contribution. - Tool: ChatGPT - Scope: codebase analysis, debugging/reasoning, regression-test draft, implementation draft, and commit/PR wording - Human review: completed; the resulting code and tests were reviewed and validated locally by the contributor

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6
Impact: 45
Quick Win: 38.25
Staleness: 35
Complexity: 15
Confidence: 75
needs review Fixes Go plugin env validation by returning stdout instead of stderr from _execute(). Closes #1447. Has passing CI and regression tests; awaiting maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 85
needs review Fixes validator to capture command output from stdout instead of stderr, resolving Go plugin version detection issues. Currently awaiting maintainer review with minor unrelated CI noise.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 85
needs review Fixes validator to capture stdout instead of stderr for command output, resolving Go plugin toolchain download message interference. Currently pending maintainer review with one unresolved comment and CI mostly passing.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Fixes validator to capture stdout instead of stderr for command output, resolving issue #1447. Currently pending maintainer review with one unresolved comment. CI passes except for a pre-existing, unrelated Java plugin failure on s390x.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Fixes validator to capture stdout instead of stderr for command output, resolving Go plugin toolchain download message interference. Currently awaiting maintainer review with CI passing except for a pre-existing, unrelated s390x Java plugin crash.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 15
Confidence: 90
needs review Changes validator to capture command output from stdout instead of stderr, fixing Go toolchain download interference. Currently awaiting maintainer review with passing CI and no open comments.

Update history

Date Change
updated
updated
updated
updated
updated
updated
created

Related work

  • Related To: craft-parts#1447 (confidence 95%)

    This PR directly closes issue #1447, which describes the exact bug: Go plugin env validation fails when `go version` triggers toolchain auto-download because _execute returns stderr instead of stdout.

Related issues

No related issues found above the similarity threshold.