Skip to content

Commit 867ed9c

Browse files
traskjoaopgrassi
andauthored
Less release steps (#1793)
Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
1 parent 62d5a7c commit 867ed9c

10 files changed

+87
-19
lines changed
File renamed without changes.

internal/tools/update_specification_version.sh .github/scripts/update-spec-repo-links.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# Example usage:
44
#
5-
# ./internal/tools/update_specification_version.sh
5+
# ./internal/tools/update-spec-repo-links.sh v1.41.0
66

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

8-
# Set this to the version number you want to CHANGE in URLs in the repository.
9-
PREVIOUS_SPECIFICATION_VERSION="v1.39.0"
1010
# Set this to the version number you want to KEEP in URLs in the repository.
11-
LATEST_SPECIFICATION_VERSION="v1.40.0"
11+
LATEST_SPECIFICATION_VERSION=$1
1212
# The specific pattern we look for when replacing URLs
1313
SPECIFICATION_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/tree/"
1414
SPECIFICATION_BLOB_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/blob/"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Auto-update spec repo links
2+
on:
3+
schedule:
4+
# hourly at minute 46
5+
- cron: "46 * * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
check-versions:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
current-version: ${{ steps.check-versions.outputs.current-version }}
13+
latest-version: ${{ steps.check-versions.outputs.latest-version }}
14+
already-opened: ${{ steps.check-versions.outputs.already-opened }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- id: check-versions
19+
name: Check versions
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
run: |
23+
current_version=$(grep "PREVIOUS_SPECIFICATION_VERSION=v.*" \
24+
internal/tools/update_specification_version.sh \
25+
| sed "s/PREVIOUS_SPECIFICATION_VERSION=//")
26+
latest_version=$(gh release view \
27+
--repo open-telemetry/opentelemetry-specification \
28+
--json tagName \
29+
--jq .tagName)
30+
31+
matches=$(gh pr list \
32+
--author opentelemetrybot \
33+
--state open \
34+
--search "in:title \"Update spec repo links to $latest_version\"")
35+
if [ ! -z "$matches" ]
36+
then
37+
already_opened=true
38+
fi
39+
40+
echo "current-version=$current_version" >> $GITHUB_OUTPUT
41+
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT
42+
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT
43+
44+
update-spec-repo-links:
45+
runs-on: ubuntu-latest
46+
if: |
47+
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
48+
needs.check-versions.outputs.already-opened != 'true'
49+
needs:
50+
- check-versions
51+
steps:
52+
- uses: actions/checkout@v4
53+
54+
- name: Use CLA approved github bot
55+
run: .github/scripts/use-cla-approved-github-bot.sh
56+
57+
- name: Update version
58+
env:
59+
VERSION: ${{ needs.check-versions.outputs.latest-version }}
60+
run: |
61+
.github/scripts/update-spec-repo-links.sh $VERSION
62+
sed -i "s/^PREVIOUS_SPECIFICATION_VERSION=.*/PREVIOUS_SPECIFICATION_VERSION=$VERSION/" .github/scripts/update-spec-repo-links.sh
63+
64+
- name: Create pull request
65+
env:
66+
VERSION: ${{ needs.check-versions.outputs.latest-version }}
67+
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
68+
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
69+
run: |
70+
message="Update spec repo links to $VERSION"
71+
body="Update spec repo links to \`$VERSION\`."
72+
branch="opentelemetrybot/update-spec-repo-links-to-$VERSION"
73+
74+
git checkout -b $branch
75+
git commit -a -m "$message"
76+
git push --set-upstream origin $branch
77+
gh pr create --title "$message" \
78+
--body "$body" \
79+
--label "Skip Changelog" \
80+
--base main

.github/workflows/prepare-new-issue.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4
1212

1313
- name: Run prepare-new-issue.sh
14-
run: ./.github/workflows/scripts/prepare-new-issue.sh
14+
run: ./.github/scripts/prepare-new-issue.sh
1515
env:
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717
ISSUE: ${{ github.event.issue.number }}

.github/workflows/prepare-new-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# we're going to run prepare-new-pr script from the main branch
2727
# to parse changelog record from the PR branch.
2828
- name: Run prepare-new-pr.sh
29-
run: ./.github/workflows/scripts/prepare-new-pr.sh
29+
run: ./.github/scripts/prepare-new-pr.sh
3030
env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
PR: ${{ github.event.pull_request.number }}

.github/workflows/prepare-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fi
2222
2323
- name: Use CLA approved github bot
24-
run: .github/workflows/scripts/use-cla-approved-github-bot.sh
24+
run: .github/scripts/use-cla-approved-github-bot.sh
2525

2626
- name: Update schema files
2727
run: |

CONTRIBUTING.md

-9
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ requirements and recommendations.
3434
- [Misspell check](#misspell-check)
3535
- [Update the tables of content](#update-the-tables-of-content)
3636
- [Markdown link check](#markdown-link-check)
37-
- [Updating the referenced specification version](#updating-the-referenced-specification-version)
3837
- [Merging existing ECS conventions](#merging-existing-ecs-conventions)
3938

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

409-
## Updating the referenced specification version
410-
411-
1. Open the `./internal/tools/update_specification_version.sh` script.
412-
2. Modify the `PREVIOUS_SPECIFICATION_VERSION` to be the same value as `LATEST_SPECIFICATION_VERSION`
413-
3. Modify `LATEST_SPECIFICATION_VERSION` to the latest specification tag, e.g. `1.21`
414-
4. Run the script from the root directory, e.g. `semantic-conventions$ ./internal/tools/update_specification_version.sh`.
415-
5. Add all modified files to the change submit and submit a PR.
416-
417408
## Merging existing ECS conventions
418409

419410
The Elastic Common Schema (ECS) is being merged into OpenTelemetry Semantic

RELEASING.md

-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

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

0 commit comments

Comments
 (0)