-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[builder] more information for missing gomod error #10475
[builder] more information for missing gomod error #10475
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10475 +/- ##
=======================================
Coverage 92.33% 92.33%
=======================================
Files 393 393
Lines 18647 18647
=======================================
Hits 17218 17218
Misses 1069 1069
Partials 360 360 ☔ View full report in Codecov by Sentry. |
@@ -79,21 +79,30 @@ func TestModuleFromCore(t *testing.T) { | |||
assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "otlpreceiver")) | |||
} | |||
|
|||
func TestInvalidModule(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a test with an invalid but existing go.mod file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can but that doesn't seem relevant to this PR? I'm wondering if this was confused for https://github.com/open-telemetry/opentelemetry-collector/pull/10098/files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the error said invalid gomod specification for module
, so what I am wondering is if we are introducing a case where we say the go.mod file does not exist but what happens is that it's invalid. I am fine not adding the test on this PR if we are certain this does not happen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only validation being done currently is if the GoMod value is empty: if mod.GoMod == ""
; here:
https://github.com/open-telemetry/opentelemetry-collector/pull/10475/files#diff-5aa5d2605e296c63681940c00cbc83eb2bb6b2e67ad2071f5c5c6435537d5561R240
There is no other validation of this config field. The field isn't a go.mod file, and it normally looks something like: go.opentelemetry.io/collector/confmap/provider/envprovider v0.103.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for clearing that up, that message sure was confusing to me 😄 we can merge this
f1a84b4
to
ea4a38a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me!
@@ -79,21 +79,30 @@ func TestModuleFromCore(t *testing.T) { | |||
assert.True(t, strings.HasPrefix(cfg.Extensions[0].Name, "otlpreceiver")) | |||
} | |||
|
|||
func TestInvalidModule(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for clearing that up, that message sure was confusing to me 😄 we can merge this
Description
improving an error message - a missing gomod field would be reported but without informing where in the config the field is missing.
Link to tracking issue
Fixes #10474
Testing
Unit tests pass, added some tests for missing cases, manually tested
new error looks like: