Skip to content

feat(mdatagen): enforce feature name naming and reference links#15310

Merged
codeboten merged 5 commits into
open-telemetry:mainfrom
TylerHelmuth:find-metadata-feature-gates
May 20, 2026
Merged

feat(mdatagen): enforce feature name naming and reference links#15310
codeboten merged 5 commits into
open-telemetry:mainfrom
TylerHelmuth:find-metadata-feature-gates

Conversation

@TylerHelmuth

Copy link
Copy Markdown
Member

Description

This PR adds to enforcements to mdatagen's feature gate feature.

  1. All feature gates defined in a metadata.yaml mush be prefixed with <kind>.>id>, such as processor.transform.
  2. All reference URLs must be to a github issue.

Issue

Testing

updated tests

@TylerHelmuth
TylerHelmuth requested review from a team and dmitryax as code owners May 15, 2026 20:31
@TylerHelmuth
TylerHelmuth requested a review from mx-psi May 15, 2026 20:31
Comment thread .chloggen/mdatagen-feature-gate-reference-url-issue.yaml Outdated
@codecov

codecov Bot commented May 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.24%. Comparing base (58cb3e5) to head (bf04f3e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15310   +/-   ##
=======================================
  Coverage   91.23%   91.24%           
=======================================
  Files         706      706           
  Lines       46165    46171    +6     
=======================================
+ Hits        42118    42127    +9     
+ Misses       2836     2834    -2     
+ Partials     1211     1210    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TylerHelmuth

Copy link
Copy Markdown
Member Author

As expected some existing feature gates now fail. We'd need to deal with those before merging.

@mx-psi mx-psi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but I think we should have some sort of allowlist feature/escape hatch for now so we don't have to rename existing feature gates

@TylerHelmuth

Copy link
Copy Markdown
Member Author

Added a new skip_strict_validation option. The Core feature gates should pass now, but Contrib wont. If we choose to merge this I'll bump Contrib's core deps and add the skip to all the failing gates.

@codeboten
codeboten enabled auto-merge May 20, 2026 22:27
@codeboten
codeboten added this pull request to the merge queue May 20, 2026
Merged via the queue into open-telemetry:main with commit 46aa7c5 May 20, 2026
54 of 55 checks passed
@TylerHelmuth
TylerHelmuth deleted the find-metadata-feature-gates branch May 21, 2026 15:21
jkoronaAtCisco pushed a commit to jkoronaAtCisco/opentelemetry-collector that referenced this pull request May 21, 2026
…#15341)

#### Description

At the moment `go get go.opentelemetry.io/collector/cmd/mdatagen@main`
result in an unbuildable `mdatagen`.

This happens because mdatagen's go.mod on main references
`go.opentelemetry.io/collector/internal/schemagen v0.152.1`. `mdatagen`
was
[updated](https://github.com/open-telemetry/opentelemetry-collector/pull/15304/changes#diff-42498599bf5b805dde7cc8403116834d346c7cbb62150935aeda205a61886661R60)
to depend on a new field from `internal/schemagen` (`InternalOnly`) on
main and this new field is not in
`go.opentelemetry.io/collector/internal/schemagen v0.152.1`. When
building externally (without the replace statements) the dependency is
resolved to `v0.152.1` and the compile fails because `v0.152.1` does not
have the new field.

My fix is to bump `mdatagen`'s dependency to a psuedo version of the tip
of main. All of this will get cleaned up with the `v0.153.0` release,
but I'd like to do this now so I can bump Contrib's core deps to the tip
of main so I can handle the breaking change from
open-telemetry#15310
before the release.

#### Testing

I ran a quick test locally using this commit's psuedo version and
confirmed I was able to install mdatagen now
TylerHelmuth added a commit to TylerHelmuth/opentelemetry-collector-contrib that referenced this pull request May 21, 2026
open-telemetry/opentelemetry-collector#15310 added two enforcements
to mdatagen: feature-gate IDs must be prefixed with `<class>.<type>.`
and reference URLs must point at GitHub issues. Many existing gates
predate these rules. Set `skip_strict_validation: true` on each
grandfathered gate so `make generate` succeeds. New gates should leave
the field unset.

Signed-off-by: Tyler Helmuth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants