#### 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](https://github.com/open-telemetry/opentelemetry-collector/actions/runs/12358329683/job/34488569900?pr=11904),
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](6a47030ba2/cmd/builder/test/test.sh (L118)))
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.
---------
Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
#### Description
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).
#### Note
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](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/21972#issuecomment-1549173972),
I decided to leave this as a future discussion.
#### Link to tracking issue
Fixes#11607
#### Testing
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.
* [chore] use license shortform
To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052
Signed-off-by: Alex Boten <aboten@lightstep.com>
* make goporto
Signed-off-by: Alex Boten <aboten@lightstep.com>
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>
Cleaning up the license files, and updating `checklicense` to verify the contents of the license as per the `opentelemetry-go-build-tools` repo.
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>
Drop the integration tests for the builtin builder configuration.
We assume that it is a working config because it is generated from
with the source tree and should be covered by collector tests. Add a
unit test to ensure some basic sanity for the builtin configuration.
This fixes#6076.
Signed-off-by: James Peach <jpeach@cloudflare.com>
Signed-off-by: James Peach <jpeach@cloudflare.com>
Embed the build configuration that is used to build otelcorecol into ocb
so that end users can easily generate a useful collector. This makes the
`--config` flag optional again.
Signed-off-by: James Peach <jpeach@cloudflare.com>
Signed-off-by: James Peach <jpeach@cloudflare.com>