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

Less release steps #1793

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file needed to be outside of the workflows directory in order for the automation to be able to update it, so I went ahead and moved all of the scripts to the same place

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Example usage:
#
# ./internal/tools/update_specification_version.sh
# ./internal/tools/update-spec-repo-links.sh v1.41.0

# this version should be kept up-to-date with the spec version that links use
PREVIOUS_SPECIFICATION_VERSION=v1.40.0

# Set this to the version number you want to CHANGE in URLs in the repository.
PREVIOUS_SPECIFICATION_VERSION="v1.39.0"
# Set this to the version number you want to KEEP in URLs in the repository.
LATEST_SPECIFICATION_VERSION="v1.40.0"
LATEST_SPECIFICATION_VERSION=$1
# The specific pattern we look for when replacing URLs
SPECIFICATION_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/tree/"
SPECIFICATION_BLOB_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/blob/"
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/auto-update-spec-repo-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Auto-update spec repo links
on:
schedule:
# hourly at minute 46
- cron: "46 * * * *"
workflow_dispatch:

jobs:
check-versions:
runs-on: ubuntu-latest
outputs:
current-version: ${{ steps.check-versions.outputs.current-version }}
latest-version: ${{ steps.check-versions.outputs.latest-version }}
already-opened: ${{ steps.check-versions.outputs.already-opened }}
steps:
- uses: actions/checkout@v4

- id: check-versions
name: Check versions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
current_version=$(grep "PREVIOUS_SPECIFICATION_VERSION=v.*" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be getting the value ofLATEST_SPECIFICATION_VERSION and replacing it on PREVIOUS_SPECIFICATION_VERSION as the guide said?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I totally follow, I think I removed the need for that step by only maintaining a single version in the file (which aligns with the version currently used in the links)

internal/tools/update_specification_version.sh \
| sed "s/PREVIOUS_SPECIFICATION_VERSION=//")
latest_version=$(gh release view \
--repo open-telemetry/opentelemetry-specification \
--json tagName \
--jq .tagName)

matches=$(gh pr list \
--author opentelemetrybot \
--state open \
--search "in:title \"Update spec repo links to $latest_version\"")
if [ ! -z "$matches" ]
then
already_opened=true
fi

echo "current-version=$current_version" >> $GITHUB_OUTPUT
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT

update-spec-repo-links:
runs-on: ubuntu-latest
if: |
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
needs.check-versions.outputs.already-opened != 'true'
needs:
- check-versions
steps:
- uses: actions/checkout@v4

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

- name: Update version
env:
VERSION: ${{ needs.check-versions.outputs.latest-version }}
run: |
.github/scripts/update-spec-repo-links.sh $VERSION
sed -i "s/^PREVIOUS_SPECIFICATION_VERSION=.*/PREVIOUS_SPECIFICATION_VERSION=$VERSION/" .github/scripts/update-spec-repo-links.sh

- name: Create pull request
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 }}
run: |
message="Update spec repo links to $VERSION"
body="Update spec repo links to \`$VERSION\`."
branch="opentelemetrybot/update-spec-repo-links-to-$VERSION"

git checkout -b $branch
git commit -a -m "$message"
git push --set-upstream origin $branch
gh pr create --title "$message" \
--body "$body" \
--label "Skip Changelog" \
--base main
2 changes: 1 addition & 1 deletion .github/workflows/prepare-new-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4

- name: Run prepare-new-issue.sh
run: ./.github/workflows/scripts/prepare-new-issue.sh
run: ./.github/scripts/prepare-new-issue.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-new-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
# we're going to run prepare-new-pr script from the main branch
# to parse changelog record from the PR branch.
- name: Run prepare-new-pr.sh
run: ./.github/workflows/scripts/prepare-new-pr.sh
run: ./.github/scripts/prepare-new-pr.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fi

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

- name: Update schema files
run: |
Expand Down
9 changes: 0 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ requirements and recommendations.
- [Misspell check](#misspell-check)
- [Update the tables of content](#update-the-tables-of-content)
- [Markdown link check](#markdown-link-check)
- [Updating the referenced specification version](#updating-the-referenced-specification-version)
- [Merging existing ECS conventions](#merging-existing-ecs-conventions)

<!-- tocstop -->
Expand Down Expand Up @@ -406,14 +405,6 @@ To check the validity of links in all markdown files, run the following command:
make markdown-link-check
```

## Updating the referenced specification version

1. Open the `./internal/tools/update_specification_version.sh` script.
2. Modify the `PREVIOUS_SPECIFICATION_VERSION` to be the same value as `LATEST_SPECIFICATION_VERSION`
3. Modify `LATEST_SPECIFICATION_VERSION` to the latest specification tag, e.g. `1.21`
4. Run the script from the root directory, e.g. `semantic-conventions$ ./internal/tools/update_specification_version.sh`.
5. Add all modified files to the change submit and submit a PR.

## Merging existing ECS conventions

The Elastic Common Schema (ECS) is being merged into OpenTelemetry Semantic
Expand Down
3 changes: 0 additions & 3 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

- Close the [release milestone](https://github.com/open-telemetry/semantic-conventions/milestones)
if there is one.
- Ensure the referenced specification version is up to date. Use
[tooling to update the spec](./CONTRIBUTING.md#updating-the-referenced-specification-version)
if needed.
- Run [opentelemetry.io workflow](https://github.com/open-telemetry/opentelemetry.io/actions/workflows/build-dev.yml)
against `semantic-conventions` submodule as a smoke-test for docs. Fix broken links, if any.
- Run the [prepare release workflow](https://github.com/open-telemetry/semantic-conventions/actions/workflows/prepare-release.yml).
Expand Down
Loading