-
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] Support for --skip-new-go-module #10098
[builder] Support for --skip-new-go-module #10098
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10098 +/- ##
==========================================
+ Coverage 91.62% 91.80% +0.18%
==========================================
Files 406 406
Lines 19046 19080 +34
==========================================
+ Hits 17450 17516 +66
+ Misses 1237 1216 -21
+ Partials 359 348 -11 ☔ View full report in Codecov by Sentry. |
6b98f5f
to
3e69723
Compare
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
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.
Is there any chance to increase testing coverage here? Some error cases would be harder to reach, but there are other parts that should be doable
3b91ace
to
b901f03
Compare
@mx-psi, sorry for the delay. I hit this issue when adding back tests and then got pulled into other things:
I'll try to fix this and increase coverage more this week. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
b901f03
to
8841297
Compare
@kristinapathak feel free to ping me when tests are passing :) |
55cb39f
to
a3cbda6
Compare
@@ -144,7 +155,7 @@ func GetModules(cfg Config) error { | |||
} |
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.
go mod tidy
is run a few lines above and downloads the needed dependencies, so go mod download
isn't needed. No dependencies are updated after the tidy call.
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, this comment was useful!
9a37a4c
to
893f878
Compare
updatespec := "-require=" + mod + "@" + ver | ||
|
||
if _, err := runGoCommand(*c, "mod", "edit", updatespec); err != nil { | ||
return err |
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 couldn't figure out how to get go mod edit
to fail 😞 everything I tried caused other failures...
893f878
to
9eb3ee2
Compare
5de8cc9
to
ac8a09b
Compare
CI failures are due to #10661, will merge this PR after merging that one |
|
67ce270
to
db19615
Compare
@mx-psi, can this be merged? |
@kristinapathak Sorry, should have said something explicitly, CI is not passing so I can't merge (it's a required CI so I literally can't click the button 😄). This error is still happening #10098 (comment) |
db19615
to
74e3f33
Compare
Looks like CI is still having trouble |
bb1c117
to
ed588d4
Compare
@mx-psi, tests are back to passing 🙂 |
Looks like there is one last test that is timing out on Windows:
I am fine with increasing the timeout value. Could you go ahead and do that? |
Looks like bumping the timeout revealed an error:
|
🤔 Another error
|
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
15b11a2
to
e888fd3
Compare
e888fd3
to
56ec03b
Compare
0954dd4
to
ad68568
Compare
🎉 🎉 |
)" This reverts commit a0331ed.
A continuation of #9253 and #9631
Description: Adds a
--skip-new-go-module
flag to the OTC builder. This enables users working in an existing go module environment (say, a "monorepo") to update the module they have, vs forcing the use of a new module.With the new support inside an existing Go module, a collector main package can be generated using a go:generate directive. For example, in the directory where I want my collector built, the file generate.go has this line:
//go:generate builder --skip-new-go-module --skip-compilation --strict-versioning --config=./build-config.yaml
In the same directory, the build-config.yaml describes the collector to build. The builder generates the other files in the same directory. At this point, normal Go workflows can be used to update indirect dependencies.
Link to tracking Issue: #9252
Testing: Will add unit tests in the next few days.
Documentation: Yes.