Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jade-guiton-dd
Copy link
Contributor

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.

…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.
@jade-guiton-dd jade-guiton-dd marked this pull request as ready for review December 17, 2024 16:24
@jade-guiton-dd jade-guiton-dd requested a review from a team as a code owner December 17, 2024 16:24
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.62%. Comparing base (50104db) to head (e81cec7).

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.
📢 Have feedback on the report? Share it here.

@songy23
Copy link
Member

songy23 commented Dec 17, 2024

Copy link
Member

@songy23 songy23 left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[release] builder integration test succeeds on main but fails on release prep
2 participants