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

[CI] Contrib tests should also test updated mdatagen #11167

Closed
mx-psi opened this issue Sep 13, 2024 · 4 comments · Fixed by #11223 or #11670
Closed

[CI] Contrib tests should also test updated mdatagen #11167

mx-psi opened this issue Sep 13, 2024 · 4 comments · Fixed by #11223 or #11670
Assignees
Labels
ci-cd CI, CD, testing, build issues cmd/mdatagen priority:p1 High release:retro Issues discussed in a release retrospective

Comments

@mx-psi
Copy link
Member

mx-psi commented Sep 13, 2024

When we run make update-otel we update the mdatagen version as well. To avoid issues in contrib, we have the contrib tests but they are not testing this.

I believe in order to do this it would be as simple as adding a -replace option on check-contrib here https://github.com/open-telemetry/opentelemetry-collector/blob/5fc39ba6334f396c3b5497bf6d29db12823cb50c/Makefile#L260C1-L260C14 to also replace the version of mdatagen

@mx-psi mx-psi added good first issue Good for newcomers priority:p2 Medium ci-cd CI, CD, testing, build issues cmd/mdatagen labels Sep 13, 2024
@jade-guiton-dd
Copy link
Contributor

For fully testing the implications of updating mdatagen, I think it will also be necessary to forcefully rebuild .tools/mdatagen and run make generate in contrib. Adding a matching -dropreplace in the restore-contrib target will also be necessary.

@PrateekKumar1709
Copy link
Contributor

PrateekKumar1709 commented Sep 17, 2024

Hi @mx-psi, I would like to work on this issue. Can you please assign this to me?

jackgopack4 pushed a commit to jackgopack4/opentelemetry-collector that referenced this issue Oct 8, 2024
…1223)

#### Description
This PR addresses the issue of contrib tests not testing the updated
mdatagen version. It modifies the `check-contrib` and `restore-contrib`
targets in the Makefile to ensure that the contrib tests use the local
version of the `mdatagen` package.

#### Link to tracking issue
Fixes open-telemetry#11167 

#### Testing
All existing tests pass with `make test`

Signed-off-by: Prateek Kumar <85689959+PrateekKumar1709@users.noreply.github.com>
@mx-psi mx-psi reopened this Nov 6, 2024
@mx-psi mx-psi added release:retro Issues discussed in a release retrospective and removed good first issue Good for newcomers labels Nov 6, 2024
@mx-psi
Copy link
Member Author

mx-psi commented Nov 6, 2024

#11519 added an additional check on mdatagen:

errs = errors.Join(errs, errors.New("status must be empty for subcomponents"))
which did not make CI fail. Reopening this.

@jade-guiton-dd
Copy link
Contributor

jade-guiton-dd commented Nov 13, 2024

I'll take a look at this.

mx-psi pushed a commit that referenced this issue Nov 21, 2024
#### Description

There have been issues where changes in `mdatagen` are not properly
tested in CI and end up breaking collector-contrib (cf. #11167). This is
because `make check-contrib` does not rebuild or rerun `mdatagen` before
running contrib tests. This PR fixes that.

I added a flag to disable this when running manually, as it adds
significant time (~3 min!) to the run and is only really useful when
`mdatagen` has been modified.

I had to change the `make gotidy` to `make for-all CMD="go mod tidy"`
because we don't have a way to run `generate` on a specific module group
(and doing so may cause false-positives/negatives if a module group
depends on the generated files of another).

#### Link to tracking issue
Fixes #11167
@github-project-automation github-project-automation bot moved this from Waiting for reviews to Done in Collector: v1 Nov 21, 2024
djaglowski pushed a commit to djaglowski/opentelemetry-collector that referenced this issue Nov 21, 2024
…y#11670)

#### Description

There have been issues where changes in `mdatagen` are not properly
tested in CI and end up breaking collector-contrib (cf. open-telemetry#11167). This is
because `make check-contrib` does not rebuild or rerun `mdatagen` before
running contrib tests. This PR fixes that.

I added a flag to disable this when running manually, as it adds
significant time (~3 min!) to the run and is only really useful when
`mdatagen` has been modified.

I had to change the `make gotidy` to `make for-all CMD="go mod tidy"`
because we don't have a way to run `generate` on a specific module group
(and doing so may cause false-positives/negatives if a module group
depends on the generated files of another).

#### Link to tracking issue
Fixes open-telemetry#11167
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Dec 19, 2024
…1223)

#### Description
This PR addresses the issue of contrib tests not testing the updated
mdatagen version. It modifies the `check-contrib` and `restore-contrib`
targets in the Makefile to ensure that the contrib tests use the local
version of the `mdatagen` package.

#### Link to tracking issue
Fixes open-telemetry#11167 

#### Testing
All existing tests pass with `make test`

Signed-off-by: Prateek Kumar <85689959+PrateekKumar1709@users.noreply.github.com>
HongChenTW pushed a commit to HongChenTW/opentelemetry-collector that referenced this issue Dec 19, 2024
…y#11670)

#### Description

There have been issues where changes in `mdatagen` are not properly
tested in CI and end up breaking collector-contrib (cf. open-telemetry#11167). This is
because `make check-contrib` does not rebuild or rerun `mdatagen` before
running contrib tests. This PR fixes that.

I added a flag to disable this when running manually, as it adds
significant time (~3 min!) to the run and is only really useful when
`mdatagen` has been modified.

I had to change the `make gotidy` to `make for-all CMD="go mod tidy"`
because we don't have a way to run `generate` on a specific module group
(and doing so may cause false-positives/negatives if a module group
depends on the generated files of another).

#### Link to tracking issue
Fixes open-telemetry#11167
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues cmd/mdatagen priority:p1 High release:retro Issues discussed in a release retrospective
Projects
Archived in project
3 participants