Commit Graph

14 Commits

Author SHA1 Message Date
Jade Guiton ff4c0a1755
[chore] Unrevert automatic `replace` generation in builder-integration-test (#11940)
#### 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>
2025-01-06 21:42:18 +00:00
Yang Song 96a3ad1cc0
[chore] put back replace and add new packages in builder yaml (#11909)
This reverts commit
5272797f7b
because it breaks releases, see
https://github.com/open-telemetry/opentelemetry-collector/actions/runs/12358329683/job/34488569900?pr=11904

and adds replace of the new x[consumer|experter|...] packages to the
builder yaml
2024-12-16 20:42:46 +00:00
Jade Guiton 5272797f7b
Generate `replaces` automatically in builder-integration-test (#11793)
#### 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.
2024-12-05 12:30:34 +01:00
Bogdan Drutu cd6bfbb121
Remove reprecated flags from Builder (#11576)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-31 12:16:08 -07:00
Alex Boten 4d38f10036
[chore] install tool envsubst (#7860)
This is needed to run the builder tests.

Signed-off-by: Alex Boten <aboten@lightstep.com>
2023-06-09 10:59:21 -07:00
Alex Boten 80d704deb4
[chore] use license shortform (#7694)
* [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>
2023-05-18 13:11:17 -07:00
Alex Boten 8b27d6b467
[chore] add license-check (#7589)
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>
2023-05-03 08:53:47 -07:00
PiotrLewandowski323 272ebe6385
Add shellcheck GitHub Actions workflow (#6870)
Adding shellcheck GitHub Actions workflow.
Fixing issues detected by shellcheck.

Signed-off-by: PiotrLewandowski323 <lewandowski323@gmail.com>
2023-01-31 14:40:53 -08:00
Daniel Jaglowski b3b6cdedb0
Run builder tests with local collector module (#6612) 2022-11-24 07:32:18 -08:00
James Peach a9f7aab1ec
Drop builtin builder configuration integration tests. (#6157)
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>
2022-09-27 10:08:02 -07:00
James Peach 9f14f5e13c
Add a default build configuration to ocb. (#5752)
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>
2022-09-13 09:15:59 -07:00
Bogdan Drutu 4998703dad
[Builder]: Remove test that depends on the contrib (#4787)
The latest is tested by the cmd/otelcorecol which uses the builder to generate the files.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2022-02-26 07:33:58 -08:00
Bogdan Drutu 2d4b2394a6
builder: Remove deprecated include-core flag (#4616)
* builder: Remove deprecated include-core flag

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Further cleanup of include core

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* make genpdata

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Fix indentation in components.go.tmpl

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2022-01-03 09:41:12 -08:00
Juraci Paixão Kröhling e168df5684
Move builder to cmd/builder (#4307)
* Move builder to cmd/builder

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Fix path to Makefile.Common

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>

* Fix versions.yaml entry for the builder

Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
2021-10-29 08:52:08 -07:00