From 181651d5b1b4ce96fccdbc1ee30e9616cba415db Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Wed, 20 Mar 2024 16:08:58 -0700 Subject: [PATCH] [cmd/mdatagen] add unsupported platforms to the README header --- .chloggen/add_unsupported_platforms.yaml | 25 +++++++++++++++++++ .../internal/samplereceiver/README.md | 22 ++++++++++++++++ .../generated_component_test.go | 1 + .../internal/samplereceiver/metadata.yaml | 1 + cmd/mdatagen/loader_test.go | 3 ++- cmd/mdatagen/templates/readme.md.tmpl | 3 +++ 6 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .chloggen/add_unsupported_platforms.yaml create mode 100644 cmd/mdatagen/internal/samplereceiver/README.md diff --git a/.chloggen/add_unsupported_platforms.yaml b/.chloggen/add_unsupported_platforms.yaml new file mode 100644 index 00000000000..0733c87522d --- /dev/null +++ b/.chloggen/add_unsupported_platforms.yaml @@ -0,0 +1,25 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: enhancement + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: mdatagen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Adds unsupported platforms to the README header + +# One or more tracking issues or pull requests related to the change +issues: [9794] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [] diff --git a/cmd/mdatagen/internal/samplereceiver/README.md b/cmd/mdatagen/internal/samplereceiver/README.md new file mode 100644 index 00000000000..8444ce2e8ec --- /dev/null +++ b/cmd/mdatagen/internal/samplereceiver/README.md @@ -0,0 +1,22 @@ +# Sample Receiver +This receiver is used for testing purposes to check the output of mdatagen. + +| Status | | +| ------------- |-----------| +| Stability | [development]: logs | +| | [beta]: traces | +| | [stable]: metrics | +| Unsupported Platforms | freebsd, illumos | +| Distributions | [] | +| Warnings | [Any additional information that should be brought to the consumer's attention](#warnings) | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Fsample%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Fsample) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Fsample%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Fsample) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dmitryax](https://www.github.com/dmitryax) | + +[development]: https://github.com/open-telemetry/opentelemetry-collector#development +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta +[stable]: https://github.com/open-telemetry/opentelemetry-collector#stable + + +## Warnings + +This is where warnings are described. diff --git a/cmd/mdatagen/internal/samplereceiver/generated_component_test.go b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go index 8eb4377792f..18db92800e6 100644 --- a/cmd/mdatagen/internal/samplereceiver/generated_component_test.go +++ b/cmd/mdatagen/internal/samplereceiver/generated_component_test.go @@ -1,4 +1,5 @@ // Code generated by mdatagen. DO NOT EDIT. +//go:build !freebsd && !illumos package samplereceiver diff --git a/cmd/mdatagen/internal/samplereceiver/metadata.yaml b/cmd/mdatagen/internal/samplereceiver/metadata.yaml index 802010ebc3f..06d544b18af 100644 --- a/cmd/mdatagen/internal/samplereceiver/metadata.yaml +++ b/cmd/mdatagen/internal/samplereceiver/metadata.yaml @@ -12,6 +12,7 @@ status: beta: [traces] stable: [metrics] distributions: [] + unsupported_platforms: [freebsd, illumos] codeowners: active: [dmitryax] warnings: diff --git a/cmd/mdatagen/loader_test.go b/cmd/mdatagen/loader_test.go index 98da3801ae4..cf3d59e07ce 100644 --- a/cmd/mdatagen/loader_test.go +++ b/cmd/mdatagen/loader_test.go @@ -35,7 +35,8 @@ func TestLoadMetadata(t *testing.T) { Codeowners: &Codeowners{ Active: []string{"dmitryax"}, }, - Warnings: []string{"Any additional information that should be brought to the consumer's attention"}, + Warnings: []string{"Any additional information that should be brought to the consumer's attention"}, + UnsupportedPlatforms: []string{"freebsd", "illumos"}, }, ResourceAttributes: map[attributeName]attribute{ "string.resource.attr": { diff --git a/cmd/mdatagen/templates/readme.md.tmpl b/cmd/mdatagen/templates/readme.md.tmpl index 268ff5888e5..3ead446b982 100644 --- a/cmd/mdatagen/templates/readme.md.tmpl +++ b/cmd/mdatagen/templates/readme.md.tmpl @@ -11,6 +11,9 @@ {{- $idx = inc $idx }} {{- end }} {{- end}} +{{- if .Status.UnsupportedPlatforms }} +| Unsupported Platforms | {{ stringsJoin .Status.UnsupportedPlatforms ", " }} | +{{- end }} {{- if and (ne $class "cmd") (ne $class "pkg") }} | Distributions | [{{ stringsJoin .Status.SortedDistributions "], [" }}] | {{- end }}