diff --git a/.chloggen/mowies-deprecate-githubgen.yaml b/.chloggen/mowies-deprecate-githubgen.yaml new file mode 100644 index 000000000000..8a31d91dbf6c --- /dev/null +++ b/.chloggen/mowies-deprecate-githubgen.yaml @@ -0,0 +1,27 @@ +# 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. filelogreceiver) +component: githubgen + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Switch over all usages of githubgen to the new tool location, since the old tool was deprecated + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [37412, 37294] + +# (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: + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# 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/.github/ALLOWLIST b/.github/ALLOWLIST index eafc6d753c45..5e8e173f2d5e 100644 --- a/.github/ALLOWLIST +++ b/.github/ALLOWLIST @@ -1,15 +1,11 @@ # Code generated by githubgen. DO NOT EDIT. ##################################################### # -# List of components in OpenTelemetry Collector Contrib +# List of components # waiting on owners to be assigned # ##################################################### # -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md -# -# # Learn about CODEOWNERS file format: # https://help.github.com/en/articles/about-code-owners # diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ca402aeb52ce..d03ad6c45167 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,14 +1,10 @@ # Code generated by githubgen. DO NOT EDIT. ##################################################### # -# List of codeowners for OpenTelemetry Collector Contrib +# List of codeowners # ##################################################### # -# Learn about membership in OpenTelemetry community: -# https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md -# -# # Learn about CODEOWNERS file format: # https://help.github.com/en/articles/about-code-owners # @@ -316,16 +312,18 @@ testbed/mockdatasenders/mockdatadogagentexporter/ @open-telemetry ##################################################### # -# List of distribution maintainers for OpenTelemetry Collector Contrib +# List of distribution maintainers # ##################################################### reports/distributions/core.yaml @open-telemetry/collector-contrib-approvers reports/distributions/contrib.yaml @open-telemetry/collector-contrib-approvers reports/distributions/k8s.yaml @open-telemetry/collector-contrib-approvers - +##################################################### +# ## UNMAINTAINED components - +# +##################################################### exporter/kineticaexporter/ @open-telemetry/collector-contrib-approvers exporter/opensearchexporter/ @open-telemetry/collector-contrib-approvers extension/observer/ecstaskobserver/ @open-telemetry/collector-contrib-approvers diff --git a/.github/workflows/check-codeowners.yaml b/.github/workflows/check-codeowners.yaml index ba4e638e31b9..8933c56f0400 100644 --- a/.github/workflows/check-codeowners.yaml +++ b/.github/workflows/check-codeowners.yaml @@ -21,42 +21,40 @@ concurrency: cancel-in-progress: true jobs: - setup-environment: + check-codeowners: timeout-minutes: 30 runs-on: ubuntu-24.04 if: ${{ github.actor != 'dependabot[bot]' && github.repository == 'open-telemetry/opentelemetry-collector-contrib' }} steps: - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version: "1.22.8" cache: false - - name: Cache Go - id: go-cache + + - name: Cache Go Tools + id: go-tools-cache timeout-minutes: 5 uses: actions/cache@v4 with: path: | - ~/go/bin - ~/go/pkg/mod ./.tools - key: go-cache-${{ runner.os }}-${{ hashFiles('**/go.sum') }} - check-codeowners: - runs-on: ubuntu-24.04 - needs: [setup-environment] - steps: - - uses: actions/checkout@v4 - - name: Gen githubgen tool + key: go-tools-${{ runner.os }}-${{ hashFiles('internal/tools/go.sum') }} + + - name: Install tools + if: github.repository == 'open-telemetry/opentelemetry-collector-contrib' && steps.go-tools-cache.outputs.cache-hit != 'true' run: | - make githubgen-install - echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + make install-tools + - uses: actions/checkout@v4 with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} path: pr + - name: Gen CODEOWNERS run: | cd pr - GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} githubgen + GITHUB_TOKEN=${{ secrets.READ_ORG_AND_USER_TOKEN }} ./.tools/githubgen codeowners 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) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7b2ca3c127d2..fce6b7f09c0d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -215,6 +215,7 @@ When submitting a component to the community, consider breaking it down into sep * `make generate` * `make multimod-verify` * `make generate-gh-issue-templates` + * `make gengithub` * `make addlicense` * **Second PR** should include the concrete implementation of the component. If the size of this PR is larger than the recommended size consider splitting it in diff --git a/Makefile b/Makefile index 341c909dbfc3..8e74373da58b 100644 --- a/Makefile +++ b/Makefile @@ -310,20 +310,16 @@ generate: install-tools PATH="$$PWD/.tools:$$PATH" $(MAKE) for-all CMD="$(GOCMD) generate ./..." $(MAKE) gofmt -.PHONY: githubgen-install -githubgen-install: - cd cmd/githubgen && $(GOCMD) install . - .PHONY: gengithub -gengithub: githubgen-install - githubgen +gengithub: $(GITHUBGEN) + $(GITHUBGEN) .PHONY: gendistributions -gendistributions: githubgen-install - githubgen distributions +gendistributions: $(GITHUBGEN) + $(GITHUBGEN) distributions .PHONY: update-codeowners -update-codeowners: gengithub generate +update-codeowners: generate gengithub FILENAME?=$(shell git branch --show-current) .PHONY: chlog-new @@ -557,8 +553,7 @@ clean: .PHONY: generate-gh-issue-templates generate-gh-issue-templates: - cd cmd/githubgen && $(GOCMD) install . - githubgen issue-templates + $(GITHUBGEN) issue-templates .PHONY: checks checks: diff --git a/Makefile.Common b/Makefile.Common index e370566008a6..1f8f3161e3ac 100644 --- a/Makefile.Common +++ b/Makefile.Common @@ -68,6 +68,7 @@ MISSPELL_CORRECTION := $(TOOLS_BIN_DIR)/misspell -w LINT := $(TOOLS_BIN_DIR)/golangci-lint MULTIMOD := $(TOOLS_BIN_DIR)/multimod CHLOGGEN := $(TOOLS_BIN_DIR)/chloggen +GITHUBGEN := $(TOOLS_BIN_DIR)/githubgen GOIMPORTS := $(TOOLS_BIN_DIR)/goimports PORTO := $(TOOLS_BIN_DIR)/porto CHECKFILE := $(TOOLS_BIN_DIR)/checkfile diff --git a/cmd/githubgen/metadata.yaml b/cmd/githubgen/metadata.yaml index a0d01e83f024..51a898cd7e2d 100644 --- a/cmd/githubgen/metadata.yaml +++ b/cmd/githubgen/metadata.yaml @@ -1,6 +1,8 @@ type: githubgen status: + stability: + deprecated: [] class: cmd codeowners: - active: [atoulme] \ No newline at end of file + active: [atoulme] diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 9a124f065083..d380c9f989dc 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -14,6 +14,7 @@ require ( go.opentelemetry.io/build-tools/checkfile v0.16.0 go.opentelemetry.io/build-tools/chloggen v0.16.0 go.opentelemetry.io/build-tools/crosslink v0.16.0 + go.opentelemetry.io/build-tools/githubgen v0.17.0 go.opentelemetry.io/build-tools/issuegenerator v0.16.0 go.opentelemetry.io/build-tools/multimod v0.16.0 go.opentelemetry.io/collector/cmd/builder v0.118.1-0.20250121185328-fbefb22cc2b3 @@ -107,7 +108,8 @@ require ( github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-github v17.0.0+incompatible // indirect - github.com/google/go-querystring v1.0.0 // indirect + github.com/google/go-github/v66 v66.0.0 // indirect + github.com/google/go-querystring v1.1.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 67cf5bc624cc..4756920ab426 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -227,8 +227,10 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= -github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-github/v66 v66.0.0 h1:ADJsaXj9UotwdgK8/iFZtv7MLc8E8WBl62WLd/D/9+M= +github.com/google/go-github/v66 v66.0.0/go.mod h1:+4SO9Zkuyf8ytMj0csN1NR/5OTR+MfqPp8P8dVlcvY4= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= @@ -572,6 +574,8 @@ go.opentelemetry.io/build-tools/chloggen v0.16.0 h1:iuotHxlcK46JJtQLdwQPsC5dcAyg go.opentelemetry.io/build-tools/chloggen v0.16.0/go.mod h1:Wk92v9Wsv36sXYi7hOg3ndeeLKmKBu0/kgB7wcaeqJg= go.opentelemetry.io/build-tools/crosslink v0.16.0 h1:7Y5QPt5TR3qpiW5bwIOnsCJdt1yjZSFDPKtjt2g2zHw= go.opentelemetry.io/build-tools/crosslink v0.16.0/go.mod h1:xogE6iWmt53bsDazb81dQrZw9TQ30+9hc4D8QfVG9aA= +go.opentelemetry.io/build-tools/githubgen v0.17.0 h1:2DFeHglGmrtTMoRDfJoR+iJd/I/3eCm8FtQJpZAb3W8= +go.opentelemetry.io/build-tools/githubgen v0.17.0/go.mod h1:UBpPXtso7exy3VU5EH1ZFfSkYQANJWO/u1lO50qdKkE= go.opentelemetry.io/build-tools/issuegenerator v0.16.0 h1:Ka14LdI0suh63HR25gy0deuspgBThl/z95e/LIIaiRw= go.opentelemetry.io/build-tools/issuegenerator v0.16.0/go.mod h1:JfdlpwSKBYbwdTOdGGlCRw4vptEgnYPhApnACBps8N8= go.opentelemetry.io/build-tools/multimod v0.16.0 h1:o205mGH61VXebXeiIPXwxeHRCm332TZqRb8gmypI6po= diff --git a/internal/tools/tools.go b/internal/tools/tools.go index 2dcc07248445..6d75302b13b8 100644 --- a/internal/tools/tools.go +++ b/internal/tools/tools.go @@ -22,6 +22,7 @@ import ( _ "go.opentelemetry.io/build-tools/checkfile" _ "go.opentelemetry.io/build-tools/chloggen" _ "go.opentelemetry.io/build-tools/crosslink" + _ "go.opentelemetry.io/build-tools/githubgen" _ "go.opentelemetry.io/build-tools/issuegenerator" _ "go.opentelemetry.io/build-tools/multimod" _ "go.opentelemetry.io/collector/cmd/builder"