diff --git a/cmd/mdatagen/main_test.go b/cmd/mdatagen/main_test.go index ce56247a78f..bcb884ea19f 100644 --- a/cmd/mdatagen/main_test.go +++ b/cmd/mdatagen/main_test.go @@ -199,6 +199,23 @@ Some info about a component componentClass: "extension", distros: []string{"contrib"}, }, + { + name: "readme with status with codeowners and seeking new", + markdown: `# Some component + + + + +Some info about a component +`, + outputFile: "readme_with_status_codeowners_and_seeking_new.md", + componentClass: "receiver", + distros: []string{"contrib"}, + codeowners: &Codeowners{ + Active: []string{"foo"}, + SeekingNew: true, + }, + }, { name: "readme with status with codeowners and emeritus", markdown: `# Some component diff --git a/cmd/mdatagen/statusdata.go b/cmd/mdatagen/statusdata.go index ebe60dc4b78..d65a5c20f58 100644 --- a/cmd/mdatagen/statusdata.go +++ b/cmd/mdatagen/statusdata.go @@ -28,6 +28,8 @@ type Codeowners struct { Active []string `mapstructure:"active"` // Emeritus codeowners Emeritus []string `mapstructure:"emeritus"` + // Whether new codeowners are being sought + SeekingNew bool `mapstructure:"seeking_new"` } type Status struct { diff --git a/cmd/mdatagen/templates/readme.md.tmpl b/cmd/mdatagen/templates/readme.md.tmpl index 364d3ad484d..ad41f11dd42 100644 --- a/cmd/mdatagen/templates/readme.md.tmpl +++ b/cmd/mdatagen/templates/readme.md.tmpl @@ -23,7 +23,7 @@ {{- if .Status.Codeowners }} {{- $codeowners := userLinks .Status.Codeowners.Active }} {{- $emeritus := userLinks .Status.Codeowners.Emeritus }} -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | {{ stringsJoin $codeowners ", " }} | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | {{ stringsJoin $codeowners ", " }} {{ if .Status.Codeowners.SeekingNew }}\| Seeking more code owners! {{ end }}| {{- if $emeritus }} | Emeritus | {{ stringsJoin $emeritus ", " }} | {{- end }} diff --git a/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md b/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md new file mode 100644 index 00000000000..f396db459d4 --- /dev/null +++ b/cmd/mdatagen/testdata/readme_with_status_codeowners_and_seeking_new.md @@ -0,0 +1,15 @@ +# Some component + + +| Status | | +| ------------- |-----------| +| Stability | [beta]: metrics | +| Distributions | [contrib] | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Areceiver%2Ffoo%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Areceiver%2Ffoo) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Areceiver%2Ffoo%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Areceiver%2Ffoo) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@foo](https://www.github.com/foo) \| Seeking more code owners! | + +[beta]: https://github.com/open-telemetry/opentelemetry-collector#beta +[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib + + +Some info about a component