Skip to content

Commit d046cb9

Browse files
braydonkjohnleslie
authored andcommitted
[chore] Makefile: add gencodeowners (open-telemetry#40073)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This PR adds a target to the Makefile to generate the CODEOWNERS file locally without a GitHub PAT. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#40072 <!--Describe what testing was performed and which tests were added.--> #### Testing Added myself to a random receiver as a code owner and ran `make gencodeowners`. It generated the `CODEOWNERS` file correctly without requiring me to have a GitHub PAT (I do not have one set up). <!--Describe the documentation added.--> #### Documentation Added reference in `CONTRIBUTING.md` and in the `check-codeowners` GitHub Action error message. <!--Please delete paragraphs that you did not use before submitting.-->
1 parent dfe1600 commit d046cb9

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/check-codeowners.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ jobs:
5959
run: |
6060
cd pr
6161
GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} ../.tools/githubgen codeowners
62-
git diff -s --exit-code || (echo 'Generated code is out of date, please apply this diff and commit the changes in this PR.' && git diff && exit 1)
62+
git diff -s --exit-code || (echo 'Generated code is out of date, please run "make gencodeowners" or apply this diff and commit the changes in this PR.' && git diff && exit 1)

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,8 @@ status:
193193
// Package fooreceiver bars.
194194
package fooreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fooreceiver"
195195
```
196-
- 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/blob/main/cmd/mdatagen/README.md#using-the-metadata-generator) to generate the associated code/documentation.
196+
- Type `make generate`. This will trigger the [metadata generator](https://github.com/open-telemetry/opentelemetry-collector/blob/main/cmd/mdatagen/README.md#using-the-metadata-generator) to generate the associated code/documentation.
197+
- Type `make gencodeowners`. This will trigger the regeneration of the `.github/CODEOWNERS` file.
197198
198199
When submitting a component to the community, consider breaking it down into separate PRs as follows:
199200

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ gencodecov: $(CODECOVGEN)
387387
update-codeowners: generate gengithub
388388
$(MAKE) genlabels
389389

390+
.PHONY: gencodeowners
391+
gencodeowners: install-tools
392+
$(GITHUBGEN) -skipgithub
393+
390394
FILENAME?=$(shell git branch --show-current)
391395
.PHONY: chlog-new
392396
chlog-new: $(CHLOGGEN)

0 commit comments

Comments
 (0)