From d3086c7daedf1d1317d77205e2bcaf2c8f90ade2 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Thu, 27 Jul 2023 18:17:32 -0700 Subject: [PATCH] [chore] update CONTRIBUTING to match codeowners generation step (#24556) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #23367 This is the last PR to move to a generated CODEOWNERS file managed via metadata. --------- Co-authored-by: Juraci Paixão Kröhling --- CONTRIBUTING.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1dd11ede50e3..3ac295c54950e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -143,10 +143,36 @@ and the rest of contributors. and in the respective testing harnesses. To align with the test goal of the project, components must be testable within the framework defined within the folder. If a component can not be properly tested within the existing framework, it must increase the non testable components number with a comment within the PR explaining as to why it can not be tested. -- Add the sponsor for your component and yourself to a new line for your component in the - [`.github/CODEOWNERS`](./.github/CODEOWNERS) file. +- Create a `metadata.yaml` file with at minimum the required fields defined in [metadata-schema.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/metadata-schema.yaml). +Here is a minimal representation: +``` +type: + +status: + class: + stability: + development: [] + codeowners: + active: [, ] +``` - Run `make generate-gh-issue-templates` to add your component to the dropdown list in the issue templates. -- Create a `metadata.yaml` file with at minimum the required fields defined in [metadata-schema.yaml](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/metadata-schema.yaml) and use the [metadata generator](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/README.md#using-the-metadata-generator) to generate the associated code/documentation. +- For README.md, you can start with the following: +``` +# +<!-- status autogenerated section --> +<!-- end autogenerated section --> +``` +- Create a `doc.go` file with a generate pragma. For a `fooreceiver`, the file will look like: +``` +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +//go:generate mdatagen metadata.yaml + +// Package fooreceiver bars. +package fooreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fooreceiver" +``` +- Type `make update-codeowners`. This will trigger the regeneration of the `.github/CODEOWNERS` file and the [metadata generator](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/cmd/mdatagen/README.md#using-the-metadata-generator) to generate the associated code/documentation. When submitting a component to the community, consider breaking it down into separate PRs as follows: