-
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
[chore] Make check-contrib
rebuild and reapply tools
#11670
[chore] Make check-contrib
rebuild and reapply tools
#11670
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11670 +/- ##
==========================================
+ Coverage 91.54% 91.63% +0.09%
==========================================
Files 442 442
Lines 23792 23776 -16
==========================================
+ Hits 21780 21787 +7
+ Misses 1641 1618 -23
Partials 371 371 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
773fdc2
to
300b9dc
Compare
check-contrib
rebuild and reapply toolscheck-contrib
rebuild and reapply tools
So this works (I think), but it increases the duration of the "check contribs" job from about 10 min to about 13 min. This increase is mostly for two reasons:
(Note: The failure in |
@jade-guiton-dd This sounds great and we can probably land this change independently. Would you mind splitting this into a separate PR? |
#11683) #### Description `make check-contrib` use `go mod edit` to allow running the `opentelemetry-collector-contrib` unit tests against the local version of the core libraries. It also removes the `replace` statements after tests have been run. At the moment, this is done with two long handwritten `go mod edit` commands. But this very easily gets out-of-date: for reference, we currently only `-replace` 70 modules out of the 73 in versions.yaml, and only `-dropreplace` 63 out of _those_. This PR changes the `Makefile` to programatically generate the commands, to avoid needing to keep them up to date. This was split off from PR #11670. You can check the output in the `contrib-tests` CI job output.
Merged #11683 :) |
#### Description This PR is in the context of [this PR on the core Collector modifying `make check-contrib` to use the latest version of `mdatagen`](open-telemetry/opentelemetry-collector#11670). The `make generate` commands currently starts by compiling build tools in the `.tools` folder, then it `go install`s mdatagen globally for use in `go:generate`. Unfortunately, `go install` does not take into account the version of `mdatagen` referenced in `internal/tools/go.mod`. This means it isn't possible to generate using the local version of `mdatagen` for testing, even with `replace` statements. This PR fixes this by prepending `.tools` to the `$PATH` before running the generate command, which makes `go:generate` use the version of `mdatagen` in that folder instead of a global one. (Originally, this PR also added a new `modgenerate` target in `Makefile.Common`, to allow running generate commands on a specific group of modules instead of all of them for efficiency reasons. After discussing it with @mx-psi, we decided to hold off on that change for a later PR, as it warrants further discussion.)
open-telemetry#11683) #### Description `make check-contrib` use `go mod edit` to allow running the `opentelemetry-collector-contrib` unit tests against the local version of the core libraries. It also removes the `replace` statements after tests have been run. At the moment, this is done with two long handwritten `go mod edit` commands. But this very easily gets out-of-date: for reference, we currently only `-replace` 70 modules out of the 73 in versions.yaml, and only `-dropreplace` 63 out of _those_. This PR changes the `Makefile` to programatically generate the commands, to avoid needing to keep them up to date. This was split off from PR open-telemetry#11670. You can check the output in the `contrib-tests` CI job output.
…y#11670) #### Description There have been issues where changes in `mdatagen` are not properly tested in CI and end up breaking collector-contrib (cf. open-telemetry#11167). This is because `make check-contrib` does not rebuild or rerun `mdatagen` before running contrib tests. This PR fixes that. I added a flag to disable this when running manually, as it adds significant time (~3 min!) to the run and is only really useful when `mdatagen` has been modified. I had to change the `make gotidy` to `make for-all CMD="go mod tidy"` because we don't have a way to run `generate` on a specific module group (and doing so may cause false-positives/negatives if a module group depends on the generated files of another). #### Link to tracking issue Fixes open-telemetry#11167
This is a partial revert of open-telemetry#11670 as it is currently blocking the release due to the need to run go mod tidy multiple times. I'm still investigating why tidy is needed multiple times, but for now I'm disabling the generate step, which was not run before and is currently blocking the release process Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
This is a partial revert of #11670 as it is currently blocking the release due to the need to run go mod tidy multiple times. I'm still investigating why tidy is needed multiple times, but for now I'm disabling the generate step, which was not run before and is currently blocking the release process Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description This PR is in the context of [this PR on the core Collector modifying `make check-contrib` to use the latest version of `mdatagen`](open-telemetry/opentelemetry-collector#11670). The `make generate` commands currently starts by compiling build tools in the `.tools` folder, then it `go install`s mdatagen globally for use in `go:generate`. Unfortunately, `go install` does not take into account the version of `mdatagen` referenced in `internal/tools/go.mod`. This means it isn't possible to generate using the local version of `mdatagen` for testing, even with `replace` statements. This PR fixes this by prepending `.tools` to the `$PATH` before running the generate command, which makes `go:generate` use the version of `mdatagen` in that folder instead of a global one. (Originally, this PR also added a new `modgenerate` target in `Makefile.Common`, to allow running generate commands on a specific group of modules instead of all of them for efficiency reasons. After discussing it with @mx-psi, we decided to hold off on that change for a later PR, as it warrants further discussion.)
open-telemetry#11683) #### Description `make check-contrib` use `go mod edit` to allow running the `opentelemetry-collector-contrib` unit tests against the local version of the core libraries. It also removes the `replace` statements after tests have been run. At the moment, this is done with two long handwritten `go mod edit` commands. But this very easily gets out-of-date: for reference, we currently only `-replace` 70 modules out of the 73 in versions.yaml, and only `-dropreplace` 63 out of _those_. This PR changes the `Makefile` to programatically generate the commands, to avoid needing to keep them up to date. This was split off from PR open-telemetry#11670. You can check the output in the `contrib-tests` CI job output.
…y#11670) #### Description There have been issues where changes in `mdatagen` are not properly tested in CI and end up breaking collector-contrib (cf. open-telemetry#11167). This is because `make check-contrib` does not rebuild or rerun `mdatagen` before running contrib tests. This PR fixes that. I added a flag to disable this when running manually, as it adds significant time (~3 min!) to the run and is only really useful when `mdatagen` has been modified. I had to change the `make gotidy` to `make for-all CMD="go mod tidy"` because we don't have a way to run `generate` on a specific module group (and doing so may cause false-positives/negatives if a module group depends on the generated files of another). #### Link to tracking issue Fixes open-telemetry#11167
This is a partial revert of open-telemetry#11670 as it is currently blocking the release due to the need to run go mod tidy multiple times. I'm still investigating why tidy is needed multiple times, but for now I'm disabling the generate step, which was not run before and is currently blocking the release process Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
#### Description This PR is in the context of [this PR on the core Collector modifying `make check-contrib` to use the latest version of `mdatagen`](open-telemetry/opentelemetry-collector#11670). The `make generate` commands currently starts by compiling build tools in the `.tools` folder, then it `go install`s mdatagen globally for use in `go:generate`. Unfortunately, `go install` does not take into account the version of `mdatagen` referenced in `internal/tools/go.mod`. This means it isn't possible to generate using the local version of `mdatagen` for testing, even with `replace` statements. This PR fixes this by prepending `.tools` to the `$PATH` before running the generate command, which makes `go:generate` use the version of `mdatagen` in that folder instead of a global one. (Originally, this PR also added a new `modgenerate` target in `Makefile.Common`, to allow running generate commands on a specific group of modules instead of all of them for efficiency reasons. After discussing it with @mx-psi, we decided to hold off on that change for a later PR, as it warrants further discussion.)
Description
There have been issues where changes in
mdatagen
are not properly tested in CI and end up breaking collector-contrib (cf. #11167). This is becausemake check-contrib
does not rebuild or rerunmdatagen
before running contrib tests. This PR fixes that.I added a flag to disable this when running manually, as it adds significant time (~3 min!) to the run and is only really useful when
mdatagen
has been modified.I had to change the
make gotidy
tomake for-all CMD="go mod tidy"
because we don't have a way to rungenerate
on a specific module group (and doing so may cause false-positives/negatives if a module group depends on the generated files of another).Link to tracking issue
Fixes #11167