fix(go): report failure when build produces unrecognized error output#3023
Open
Abhi-DevHub wants to merge 1 commit into
Open
fix(go): report failure when build produces unrecognized error output#3023Abhi-DevHub wants to merge 1 commit into
Abhi-DevHub wants to merge 1 commit into
Conversation
filter_go_build_with_exit() determined success purely by scanning for known error patterns. When go build failed with an error that didn't match any pattern (e.g. 'stat ...: directory not found'), unrecognized output lines fell through silently and the filter returned 'Success' despite the presence of non-download, non-progress output text. A successful go build produces no output or only download/progress lines. Any other unrecognized output is now treated as a failure - the raw output is preserved through format_go_build_failure so the actual error remains visible. Fixes rtk-ai#1599 Signed-off-by: Abhi-DevHub <abhishekkumar@duck.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
\ilter_go_build_with_exit()\ now reports failure with raw output preserved when \go build\ produces unrecognized non-empty output that doesn't match any known error or progress pattern. Previously, unrecognized lines fell through silently and the filter reported success despite the presence of non-download, non-progress output text.
Problem
\ilter_go_build()\ determined success purely by scanning for known error patterns. When \go build\ failed with an error that didn't match any pattern (e.g. \stat ...: directory not found\ for an invalid package path), the filter swallowed the error and reported success.
A successful \go build\ produces no output (or only \go: downloading ...\ progress lines). Any other unrecognized output indicates an error the filter doesn't understand — it should be passed through, not hidden.
Changes
Test plan
Fixes #1599