[chore] Add linting rule to avoid manual creation of feature gates#47506
Merged
Conversation
codeboten
approved these changes
Apr 9, 2026
mx-psi
pushed a commit
that referenced
this pull request
Apr 13, 2026
… to metadata.yaml and remove linting rule (#47542) #### Description * Migrates last feature gate (``) for `processor/transformprocessor` to metadata.yaml * Updates factory test to use new metadata feature gate ID * Enables forbidigo linting rule for `processor/transformprocessor` (rule forbids manual creation of feature gates) #### Link to tracking issue Part of #46116 Follow-up for #47371 and #47506 #### Testing `make lint` and `make test` pass.
AndrewCharlesHay
pushed a commit
to AndrewCharlesHay/opentelemetry-collector-contrib
that referenced
this pull request
Apr 23, 2026
…pen-telemetry#47506) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Prevent new components from manually registering feature gates, instead requiring them to use `metadata.yaml`. This adds an exclusion list that should be reduced over time. See CI of the first commit, f663152, as proof that the linter does flag usages of this ([1](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574209), [2](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574176), [3](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574178), [4](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574145), [5](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574246), [6](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574584), [7](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574242), [8](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574192), [9](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574235), [10](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/24202405946/job/70649574230)). Compare exclusion list with the output of this command: <details> <summary> Output of <code>rg 'MustRegister' --glob '!generated_*.go' -tgo -l | cut -d / -f1-2 | sort | uniq</code> </summary> ``` connector/datadogconnector connector/servicegraphconnector connector/spanmetricsconnector exporter/awsemfexporter exporter/awsxrayexporter exporter/clickhouseexporter exporter/datadogexporter exporter/googlecloudexporter exporter/prometheusremotewriteexporter exporter/signalfxexporter extension/encoding extension/healthcheckextension extension/jaegerremotesampling extension/opampextension internal/filter pkg/datadog pkg/ottl pkg/translator processor/filterprocessor processor/metricsgenerationprocessor processor/tailsamplingprocessor processor/transformprocessor receiver/awscontainerinsightreceiver receiver/cloudfoundryreceiver receiver/datadogreceiver receiver/hostmetricsreceiver receiver/jaegerreceiver receiver/prometheusreceiver receiver/vcenterreceiver testbed/datasenders ``` </details> <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Updates open-telemetry#46116
AndrewCharlesHay
pushed a commit
to AndrewCharlesHay/opentelemetry-collector-contrib
that referenced
this pull request
Apr 23, 2026
… to metadata.yaml and remove linting rule (open-telemetry#47542) #### Description * Migrates last feature gate (``) for `processor/transformprocessor` to metadata.yaml * Updates factory test to use new metadata feature gate ID * Enables forbidigo linting rule for `processor/transformprocessor` (rule forbids manual creation of feature gates) #### Link to tracking issue Part of open-telemetry#46116 Follow-up for open-telemetry#47371 and open-telemetry#47506 #### Testing `make lint` and `make test` pass.
gracewehner
pushed a commit
to gracewehner/opentelemetry-collector-contrib
that referenced
this pull request
Apr 29, 2026
… to metadata.yaml and remove linting rule (open-telemetry#47542) #### Description * Migrates last feature gate (``) for `processor/transformprocessor` to metadata.yaml * Updates factory test to use new metadata feature gate ID * Enables forbidigo linting rule for `processor/transformprocessor` (rule forbids manual creation of feature gates) #### Link to tracking issue Part of open-telemetry#46116 Follow-up for open-telemetry#47371 and open-telemetry#47506 #### Testing `make lint` and `make test` pass.
mx-psi
pushed a commit
that referenced
this pull request
May 19, 2026
) #### Description Migrate the `exporter.signalfx.consumeEntityEvents` feature gate to be declared in `metadata.yaml` and code-generated via `mdatagen`, matching the convention enforced by the `forbidigo` linter introduced in #47506. This continues the work tracked in #46116, following the same pattern as recent migrations (#48066, #48240, #48281, #47893). No behavior change for users: the feature gate ID, stage, description, and `from_version` are preserved exactly. A `reference_url` was added pointing to the PR that introduced the gate (#45595), which is required by mdatagen. #### Link to tracking issue Updates #46116 #### Testing From `exporter/signalfxexporter`: - `make mdatagen` — clean re-generation, no diff after `make fmt && make gci`. - `go build ./...` — passes. - `go test ./... -count=1` — passes. - `golangci-lint run --config=<repo>/.golangci.yml ./...` (v2.7) — clean. #### Documentation `documentation.md` is now generated from `metadata.yaml` and lists the feature gate. Signed-off-by: iahsanGill <mgill.bese22seecs@seecs.edu.pk>
ben-trans
pushed a commit
to ben-trans/opentelemetry-collector-contrib
that referenced
this pull request
May 25, 2026
…n-telemetry#48466) #### Description Migrate the `exporter.signalfx.consumeEntityEvents` feature gate to be declared in `metadata.yaml` and code-generated via `mdatagen`, matching the convention enforced by the `forbidigo` linter introduced in open-telemetry#47506. This continues the work tracked in open-telemetry#46116, following the same pattern as recent migrations (open-telemetry#48066, open-telemetry#48240, open-telemetry#48281, open-telemetry#47893). No behavior change for users: the feature gate ID, stage, description, and `from_version` are preserved exactly. A `reference_url` was added pointing to the PR that introduced the gate (open-telemetry#45595), which is required by mdatagen. #### Link to tracking issue Updates open-telemetry#46116 #### Testing From `exporter/signalfxexporter`: - `make mdatagen` — clean re-generation, no diff after `make fmt && make gci`. - `go build ./...` — passes. - `go test ./... -count=1` — passes. - `golangci-lint run --config=<repo>/.golangci.yml ./...` (v2.7) — clean. #### Documentation `documentation.md` is now generated from `metadata.yaml` and lists the feature gate. Signed-off-by: iahsanGill <mgill.bese22seecs@seecs.edu.pk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Prevent new components from manually registering feature gates, instead requiring them to use
metadata.yaml.This adds an exclusion list that should be reduced over time. See CI of the first commit, f663152, as proof that the linter does flag usages of this (1, 2, 3, 4, 5, 6, 7, 8, 9, 10).
Compare exclusion list with the output of this command:
Output of
rg 'MustRegister' --glob '!generated_*.go' -tgo -l | cut -d / -f1-2 | sort | uniqLink to tracking issue
Updates #46116