Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update everywhere to use new otelbot github app #13256

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/repository-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-conf
- Exclude:
- `release/*`
- `renovate/**/*`
- `opentelemetrybot/**/*`
- `otelbot/**/*`
- `revert-*/**/*` (these are created when using the GitHub UI to revert a PR)
- Restrict creations: CHECKED

Expand Down Expand Up @@ -125,6 +125,8 @@ settings](https://github.com/open-telemetry/community/blob/main/docs/how-to-conf

### Organization secrets

- `OPENTELEMETRYBOT_GITHUB_TOKEN`
- `OTELBOT_CLIENT_ID`
- `OTELBOT_PRIVATE_KEY`

### Organization variables

- `OTELBOT_APP_ID`
1 change: 1 addition & 0 deletions .github/scripts/generate-release-contributors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ echo "$contributors1" "$contributors2" \
| grep -v github-actions \
| grep -v renovate \
| grep -v opentelemetrybot \
| grep -v otelbot \
| sed 's/^/@/'
4 changes: 4 additions & 0 deletions .github/scripts/use-cla-approved-bot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash -e

git config user.name otelbot
git config user.email [email protected]
4 changes: 0 additions & 4 deletions .github/scripts/use-cla-approved-github-bot.sh

This file was deleted.

18 changes: 12 additions & 6 deletions .github/workflows/auto-update-otel-sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
| sed 's/^v//')
matches=$(gh pr list \
--author opentelemetrybot \
--author otelbot \
--state open \
--search "in:title \"Update the OpenTelemetry SDK version to $latest_version\"")
if [ ! -z "$matches" ]
Expand Down Expand Up @@ -62,9 +62,6 @@ jobs:
VERSION: ${{ needs.check-versions.outputs.latest-version }}
run: ./.github/scripts/update-sdk-version.sh $VERSION

- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Free disk space
run: .github/scripts/gha-free-disk-space.sh

Expand All @@ -84,16 +81,25 @@ jobs:
if: failure()
run: git checkout -- licenses

- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request against main
if: success() || failure()
env:
VERSION: ${{ needs.check-versions.outputs.latest-version }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
message="Update the OpenTelemetry SDK version to $VERSION"
body="Update the OpenTelemetry SDK version to \`$VERSION\`."
branch="opentelemetrybot/update-opentelemetry-sdk-to-${VERSION}"
branch="otelbot/update-opentelemetry-sdk-to-${VERSION}"
git checkout -b $branch
git add -u
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,25 @@ jobs:
# history is needed to run git cherry-pick below
fetch-depth: 0

- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: app-token
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Use CLA approved author
run: |
git config user.name otelbot
git config user.email [email protected]
- name: Create pull request
env:
NUMBER: ${{ github.event.inputs.number }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
title=$(gh pr view $NUMBER --json title --jq .title)
branch="opentelemetrybot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
branch="otelbot/backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"
git checkout -b $branch
git cherry-pick $commit
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/overhead-benchmark-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ jobs:
cwd: "./gh-pages"
branch: "gh-pages"
message: "update test result data"
author_name: opentelemetrybot
author_email: 107717825+opentelemetrybot@users.noreply.github.com
committer_name: opentelemetrybot
committer_email: 107717825+opentelemetrybot@users.noreply.github.com
author_name: otelbot
author_email: 197425009+otelbot@users.noreply.github.com
committer_name: otelbot
committer_email: 197425009+otelbot@users.noreply.github.com

workflow-notification:
permissions:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,22 @@ jobs:
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
message="Prepare release $VERSION"
branch="opentelemetrybot/prepare-release-${VERSION}"
branch="otelbot/prepare-release-${VERSION}"
git checkout -b $branch
git commit -a -m "$message"
Expand Down
28 changes: 20 additions & 8 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,22 @@ jobs:
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request against the release branch
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
message="Prepare release $VERSION"
branch="opentelemetrybot/prepare-release-${VERSION}"
branch="otelbot/prepare-release-${VERSION}"
git checkout -b $branch
git commit -a -m "$message"
Expand Down Expand Up @@ -111,17 +117,23 @@ jobs:
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version $VERSION ($date)/" CHANGELOG.md
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request against main
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
message="Update version to $NEXT_VERSION"
body="Update version to \`$NEXT_VERSION\`."
branch="opentelemetrybot/update-version-to-${NEXT_VERSION}"
branch="otelbot/update-version-to-${NEXT_VERSION}"
git checkout -b $branch
git commit -a -m "$message"
Expand Down
24 changes: 15 additions & 9 deletions .github/workflows/release-update-cloudfoundry-index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh

- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: 'cloudfoundry'

- name: create working branch
run: git checkout -b opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
run: git checkout -b otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}

- name: install xq (which is part of yq)
run: |
Expand All @@ -42,19 +39,28 @@ jobs:
- name: display changes
run: git diff

- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: create pr with repo changes
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
git add index.yml
if git diff-index --quiet --cached HEAD ; then
echo "index.yml already current"
exit 0
fi
git commit -m "Updated index.yml"
git push --set-upstream origin opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
git push --set-upstream origin otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }}
gh pr create --base cloudfoundry \
--head opentelemetrybot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }} \
--head otelbot/cloudfoundry-${{ github.run_number }}-${{ github.run_attempt }} \
--title 'Release updates for Cloudfoundry Repo' \
--body '[Created by Github action]'
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
30 changes: 21 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,20 @@ jobs:
release_date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
RELEASE_DATE=$release_date .github/scripts/merge-change-log-after-release.sh
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request against main
env:
VERSION: ${{ needs.release.outputs.version }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
if git diff --quiet; then
if [[ $VERSION == *.0 ]]; then
Expand All @@ -236,7 +242,7 @@ jobs:
message="Merge change log updates from $GITHUB_REF_NAME"
body="Merge change log updates from \`$GITHUB_REF_NAME\`."
branch="opentelemetrybot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
branch="otelbot/merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
git checkout -b $branch
git commit -a -m "$message"
Expand All @@ -254,9 +260,6 @@ jobs:
with:
ref: main

- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh

- name: Wait for release to be available in maven central
env:
VERSION: ${{ needs.release.outputs.version }}
Expand All @@ -279,15 +282,24 @@ jobs:
./gradlew japicmp -PapiBaseVersion=$PRIOR_VERSION -PapiNewVersion=$VERSION
./gradlew --refresh-dependencies japicmp
- name: Use CLA approved bot
run: .github/scripts/use-cla-approved-bot.sh

- uses: actions/create-github-app-token@67e27a7eb7db372a1c61a7f9bdab8699e9ee57f7 # v1.11.3
id: otelbot-token
with:
app-id: ${{ vars.OTELBOT_APP_ID }}
private-key: ${{ secrets.OTELBOT_PRIVATE_KEY }}

- name: Create pull request against main
env:
VERSION: ${{ needs.release.outputs.version }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
run: |
message="Update apidiff baseline to released version $VERSION"
body="Update apidiff baseline to released version \`$version\`."
branch="opentelemetrybot/update-apidiff-baseline-to-released-version-${VERSION}"
branch="otelbot/update-apidiff-baseline-to-released-version-${VERSION}"
git checkout -b $branch
git add docs/apidiffs
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ and deadlocks.
- Review and merge the backport pull request that it generates.
- Note: if the PR contains any changes to workflow files, it will have to be manually backported,
because the default `GITHUB_TOKEN` does not have permission to update workflow files (and the
`opentelemetrybot` token doesn't have write permission to this repository at all, so while it
`otelbot` token doesn't have write permission to this repository at all, so while it
can be used to open a PR, it can't be used to push to a local branch).
- Merge a pull request to the release branch updating the `CHANGELOG.md`.
- The heading for the unreleased entries should be `## Unreleased`.
Expand Down
Loading