-
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] Unrevert automatic replace
generation in builder-integration-test
#11940
base: main
Are you sure you want to change the base?
[chore] Unrevert automatic replace
generation in builder-integration-test
#11940
Conversation
…elemetry#11793) This PR removes the manually maintained `replace` statements in `cmd/builder/test/core.builder.yaml` and generates them automatically in `cmd/builder/test/test.sh`. This ensures that the builder integration test properly uses the local version of core collector modules, even if a `replace` statement is forgotten. This is especially important in release PRs where dependencies have not-yet-valid version numbers (see tracking issue for context). I believe a better implementation of this long-term may be to commit a `go.work` file to the repository as the single source of truth for `replace`s, and let the `go` commands run by `ocb` take it into account automatically. (This would also avoid needing to maintain the `replace`s in every `go.mod`, which can be annoying when `make crosslink` is not sufficient.) But as there were [objections the last time this was discussed](open-telemetry/opentelemetry-collector-contrib#21972 (comment)), I decided to leave this as a future discussion. Fixes open-telemetry#11607 We can simulate a Release PR by setting the `exporter` import in `debugexporter` to an invalid version like `0.999.0`. With the new script, this causes no problems, showing that the build uses the local version without fetching from the proxy. Filtering the `exporter` module from the replace statements by adding this to the script: ```bash core_mods=$(echo "$core_mods" | grep -v "/exporter$") ``` makes `ocb` output the expected `unknown revision` error.
466d7f2
to
e80493a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11940 +/- ##
=======================================
Coverage 91.62% 91.62%
=======================================
Files 447 447
Lines 23731 23731
=======================================
Hits 21743 21743
Misses 1613 1613
Partials 375 375 ☔ View full report in Codecov by Sentry. |
In case it helps: the failed CI during the release is https://github.com/open-telemetry/opentelemetry-collector/actions/runs/12358329683/job/34488569900?pr=11904 |
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.
please rebase
cc @dmitryax release manager for the next release
Description
PR #11793, which added code to automatically generate
replace
clauses in builder-integration-test in order to avoid issues in release PRs, caused issues in a release PR, and was reverted in #11909.The issue ended up being that the
replace
clause for the root collector module (go.opentelemetry.io/collector
) was missing, because (cf. previous source code) I was generating a list of module paths relative to the root, with an empty string for the root module, which bash helpfully ignored during the for loop below.This PR unreverts #11793, with a fix for the above issue. (We make sure to only strip the initial dot of the folder path inside the for loop.)
Link to tracking issue
Fixes #11607, hopefully correctly this time.
Testing
I replicated the release PR in which the issues arose with a .1 patch version number, replicated the failure that was observed, and checked that the new script has the expected behavior.