-
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
WIP [builder] Support for --skip-new-go-module
proof of concept
#9253
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #9253 +/- ##
==========================================
- Coverage 90.80% 90.34% -0.47%
==========================================
Files 341 341
Lines 18330 18446 +116
==========================================
+ Hits 16645 16665 +20
- Misses 1350 1441 +91
- Partials 335 340 +5 ☔ View full report in Codecov by Sentry. |
As discussed in today's Collector SIG call this is a proof that a solution to #9252 is a relatively simple change. I've added one more commit, implementing and documenting a "strict versioning" mode, which applies additional checks following the When strict versioning is configured,
Each of these errors could have happened in esoteric and contrived cases without the new At this point, this PR is exactly where I want it to be for my internal build workflow, which uses a monorepo and builds collectors using internal components. I surely hope this work will be accepted. I would like to hear that there is sponsorship for this idea before I add tests of all the new code. Approvers, please take a look, thanks -- if you express support, I'll add tests, thanks. |
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 @jmacd, I think this use-case makes sense to support. I'll be glad to review the PR once the tests are added 👍🏻
Have discussed @kristinapathak taking on this work, will close for now. |
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. --------- Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
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 filegenerate.go
has this line: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. The optional--strict-versioning
checks that the build configuration matches that resulting from the enclosing Go module.Link to tracking Issue: #9252
Testing: WIP: No.
Documentation: Yes.