open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.51k stars 1.48k forks source link

[chore] Generate `replace` directives automatically in `check-contrib` #11683

Closed jade-guiton-dd closed 1 week ago

jade-guiton-dd commented 1 week ago

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.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.64%. Comparing base (1d87709) to head (1ce1ece). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #11683 +/- ## ======================================= Coverage 91.64% 91.64% ======================================= Files 442 442 Lines 23746 23746 ======================================= Hits 21761 21761 Misses 1616 1616 Partials 369 369 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mx-psi commented 1 week ago

You can double check e.g. here: https://github.com/open-telemetry/opentelemetry-collector/actions/runs/11858185454/job/33048223148?pr=11683 that the generated replaces look reasonable