Skip to content

Commit

Permalink
[chore][githubgen] remove deprecated code (#37498)
Browse files Browse the repository at this point in the history
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
- This PR removes the githubgen code that was deprecated as part of
#37294
- To be merged once release 0.119.0 is out

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Part of
#37294

<!--Describe the documentation added.-->
#### Documentation
old readme was updated, the rest of the change is transparent since it's
all hidden behind make commands

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Moritz Wiesinger <[email protected]>
  • Loading branch information
mowies authored Feb 25, 2025
1 parent e289237 commit 78602dc
Show file tree
Hide file tree
Showing 20 changed files with 3 additions and 689 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

# Start components list

cmd/githubgen/ @open-telemetry/collector-contrib-approvers @atoulme
cmd/opampsupervisor/ @open-telemetry/collector-contrib-approvers @evan-bradley @atoulme @tigrannajaryan
cmd/otelcontribcol/ @open-telemetry/collector-contrib-approvers
cmd/oteltestbedcol/ @open-telemetry/collector-contrib-approvers
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ body:
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
# Do not manually edit it.
# Start components list
- cmd/githubgen
- cmd/opampsupervisor
- cmd/otelcontribcol
- cmd/oteltestbedcol
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ body:
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
# Do not manually edit it.
# Start components list
- cmd/githubgen
- cmd/opampsupervisor
- cmd/otelcontribcol
- cmd/oteltestbedcol
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/other.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ body:
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
# Do not manually edit it.
# Start components list
- cmd/githubgen
- cmd/opampsupervisor
- cmd/otelcontribcol
- cmd/oteltestbedcol
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/unmaintained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ body:
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
# Do not manually edit it.
# Start components list
- cmd/githubgen
- cmd/opampsupervisor
- cmd/otelcontribcol
- cmd/oteltestbedcol
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-and-test-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
- other
timeout-minutes: 30
runs-on: ubuntu-22.04-arm
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
- other
os: [windows-2022, windows-2025]
runs-on: ${{ matrix.os }}
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
- other
runs-on: ubuntu-24.04
needs: [setup-environment]
Expand Down Expand Up @@ -144,7 +143,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -257,7 +255,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
- other
runs-on: ${{ matrix.runner }}
needs: [setup-environment]
Expand Down Expand Up @@ -355,7 +352,6 @@ jobs:
- internal
- pkg
- cmd-0
- cmd-1
runs-on: ubuntu-24.04
needs: [setup-environment]
steps:
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ EXTENSION_MODS := $(shell find ./extension/* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR
CONNECTOR_MODS := $(shell find ./connector/* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) )
INTERNAL_MODS := $(shell find ./internal/* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) )
PKG_MODS := $(shell find ./pkg/* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) )
CMD_MODS_0 := $(shell find ./cmd/[a-m]* $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) )
CMD_MODS_1 := $(shell find ./cmd/[n-z]* $(FIND_MOD_ARGS) -not -path "./cmd/otel*col/*" -exec $(TO_MOD_DIR) )
CMD_MODS_0 := $(shell find ./cmd/[a-z]* $(FIND_MOD_ARGS) -not -path "./cmd/otel*col/*" -exec $(TO_MOD_DIR) )
CMD_MODS := $(CMD_MODS_0) $(CMD_MODS_1)
OTHER_MODS := $(shell find . $(EX_COMPONENTS) $(EX_INTERNAL) $(EX_PKG) $(EX_CMD) $(FIND_MOD_ARGS) -exec $(TO_MOD_DIR) ) $(ROOT_DIR)
ALL_MODS := $(RECEIVER_MODS) $(PROCESSOR_MODS) $(EXPORTER_MODS) $(EXTENSION_MODS) $(CONNECTOR_MODS) $(INTERNAL_MODS) $(PKG_MODS) $(CMD_MODS) $(OTHER_MODS)
Expand Down Expand Up @@ -84,7 +83,6 @@ all-groups:
@echo -e "\ninternal: $(INTERNAL_MODS)"
@echo -e "\npkg: $(PKG_MODS)"
@echo -e "\ncmd-0: $(CMD_MODS_0)"
@echo -e "\ncmd-1: $(CMD_MODS_1)"
@echo -e "\ncmd: $(CMD_MODS)"
@echo -e "\nother: $(OTHER_MODS)"
@echo -e "\nintegration: $(INTEGRATION_MODS)"
Expand Down Expand Up @@ -154,7 +152,7 @@ gotest:
gotest-with-cover:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="test-with-cover"
$(GOCMD) tool covdata textfmt -i=./coverage/unit -o ./$(GROUP)-coverage.txt

.PHONY: gotest-with-junit
gotest-with-junit:
@$(MAKE) for-all-target TARGET="test-with-junit"
Expand Down Expand Up @@ -293,9 +291,6 @@ for-cmd-target: $(CMD_MODS)
.PHONY: for-cmd-0-target
for-cmd-0-target: $(CMD_MODS_0)

.PHONY: for-cmd-1-target
for-cmd-1-target: $(CMD_MODS_1)

.PHONY: for-other-target
for-other-target: $(OTHER_MODS)

Expand Down
1 change: 0 additions & 1 deletion cmd/githubgen/Makefile

This file was deleted.

34 changes: 1 addition & 33 deletions cmd/githubgen/README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,3 @@
⚠️ This executable has moved to [opentelemetry-go-build-tools](https://github.com/open-telemetry/opentelemetry-go-build-tools/tree/main/githubgen).

This code is deprecated and will be removed soon. See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/37294.

# githubgen

This executable is used to generate the `.github/CODEOWNERS` and `.github/ALLOWLIST` files.

It reads status metadata from `metadata.yaml` files located throughout the repository.

It checks that codeowners are known members of the OpenTelemetry organization.

## Usage

```
$> make gengithub
```
The equivalent of:
```
$> cd cmd/githubgen && $(GOCMD) install .
$> GITHUB_TOKEN=<mypattoken> githubgen --folder . [--allowlist cmd/githubgen/allowlist.txt]
```

## Checking codeowners against OpenTelemetry membership via Github API

To authenticate, set the environment variable `GITHUB_TOKEN` to a PAT token. If a PAT is not available you can use the `--skipgithub` flag to avoid checking for membership in the GitHub organization.

For each codeowner, the script will check if the user is registered as a member of the OpenTelemetry organization.

If any codeowner is missing, it will stop and print names of missing codeowners.

These can be added to allowlist.txt as a workaround.

If a codeowner is present in allowlist.txt and also a member of the OpenTelemetry organization, the script will error out.

See https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/37294.
Loading

0 comments on commit 78602dc

Please sign in to comment.