Skip to content

Commit 78c7064

Browse files
authored
Merge branch 'main' into chore-4513/drop-py38-support
2 parents a2e0ae5 + 1292c80 commit 78c7064

File tree

159 files changed

+2660
-1797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+2660
-1797
lines changed

.github/workflows/contrib.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ jobs:
1515
uses: open-telemetry/opentelemetry-python-contrib/.github/workflows/core_contrib_test_0.yml@main
1616
with:
1717
CORE_REPO_SHA: ${{ github.sha }}
18-
CONTRIB_REPO_SHA: main
18+
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
19+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
20+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
21+
'main'
22+
) || 'main' }}

.github/workflows/fossa.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1616

17-
- uses: fossas/fossa-action@c0a7d013f84c8ee5e910593186598625513cc1e4 # v1.6.0
17+
- uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
1818
with:
1919
api-key: ${{secrets.FOSSA_API_KEY}}
2020
team: OpenTelemetry

.github/workflows/lint_0.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:

.github/workflows/misc_0.yml

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:
@@ -58,44 +66,6 @@ jobs:
5866
- name: Run tests
5967
run: tox -e tracecontext
6068

61-
mypy:
62-
name: mypy
63-
runs-on: ubuntu-latest
64-
timeout-minutes: 30
65-
steps:
66-
- name: Checkout repo @ SHA - ${{ github.sha }}
67-
uses: actions/checkout@v4
68-
69-
- name: Set up Python 3.11
70-
uses: actions/setup-python@v5
71-
with:
72-
python-version: "3.11"
73-
74-
- name: Install tox
75-
run: pip install tox
76-
77-
- name: Run tests
78-
run: tox -e mypy
79-
80-
mypyinstalled:
81-
name: mypyinstalled
82-
runs-on: ubuntu-latest
83-
timeout-minutes: 30
84-
steps:
85-
- name: Checkout repo @ SHA - ${{ github.sha }}
86-
uses: actions/checkout@v4
87-
88-
- name: Set up Python 3.11
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: "3.11"
92-
93-
- name: Install tox
94-
run: pip install tox
95-
96-
- name: Run tests
97-
run: tox -e mypyinstalled
98-
9969
typecheck:
10070
name: typecheck
10171
runs-on: ubuntu-latest

.github/workflows/prepare-patch-release.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
run: .github/scripts/use-cla-approved-github-bot.sh
6666

6767
- name: Create pull request
68+
id: create_pr
6869
env:
6970
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
7071
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -74,7 +75,15 @@ jobs:
7475
7576
git commit -a -m "$message"
7677
git push origin HEAD:$branch
77-
gh pr create --title "[$GITHUB_REF_NAME] $message" \
78+
pr_url=$(gh pr create --title "[$GITHUB_REF_NAME] $message" \
7879
--body "$message." \
7980
--head $branch \
80-
--base $GITHUB_REF_NAME
81+
--base $GITHUB_REF_NAME)
82+
83+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
84+
- name: Add prepare-release label to PR
85+
if: steps.create_pr.outputs.pr_url != ''
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: |
89+
gh pr edit ${{ steps.create_pr.outputs.pr_url }} --add-label "prepare-release"

.github/workflows/prepare-release-branch.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
run: .github/scripts/use-cla-approved-github-bot.sh
9292

9393
- name: Create pull request against the release branch
94+
id: create_release_branch_pr
9495
env:
9596
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
9697
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -100,10 +101,18 @@ jobs:
100101
101102
git commit -a -m "$message"
102103
git push origin HEAD:$branch
103-
gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
104+
pr_url=$(gh pr create --title "[$RELEASE_BRANCH_NAME] $message" \
104105
--body "$message." \
105106
--head $branch \
106-
--base $RELEASE_BRANCH_NAME
107+
--base $RELEASE_BRANCH_NAME)
108+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
109+
110+
- name: Add prepare-release label to PR
111+
if: steps.create_release_branch_pr.outputs.pr_url != ''
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
run: |
115+
gh pr edit ${{ steps.create_release_branch_pr.outputs.pr_url }} --add-label "prepare-release"
107116
108117
create-pull-request-against-main:
109118
runs-on: ubuntu-latest
@@ -170,6 +179,7 @@ jobs:
170179
run: .github/scripts/use-cla-approved-github-bot.sh
171180

172181
- name: Create pull request against main
182+
id: create_main_pr
173183
env:
174184
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
175185
GITHUB_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
@@ -180,7 +190,15 @@ jobs:
180190
181191
git commit -a -m "$message"
182192
git push origin HEAD:$branch
183-
gh pr create --title "$message" \
193+
pr_url=$(gh pr create --title "$message" \
184194
--body "$body" \
185195
--head $branch \
186-
--base main
196+
--base main)
197+
echo "pr_url=$pr_url" >> $GITHUB_OUTPUT
198+
199+
- name: Add prepare-release label to PR
200+
if: steps.create_main_pr.outputs.pr_url != ''
201+
env:
202+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
203+
run: |
204+
gh pr edit ${{ steps.create_main_pr.outputs.pr_url }} --add-label "prepare-release"

.github/workflows/templates/lint.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}{% endraw %}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:

.github/workflows/templates/misc.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}{% endraw %}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:

.github/workflows/templates/test.yml.j2

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: {% raw %}${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}{% endraw %}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:

.github/workflows/test_0.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ concurrency:
1515

1616
env:
1717
CORE_REPO_SHA: main
18-
CONTRIB_REPO_SHA: main
18+
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
19+
# For PRs you can change the inner fallback ('main')
20+
# For pushes you change the outer fallback ('main')
21+
# The logic below is used during releases and depends on having an equivalent branch name in the contrib repo.
22+
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
23+
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
24+
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
25+
'main'
26+
) || 'main' }}
1927
PIP_EXISTS_ACTION: w
2028

2129
jobs:

0 commit comments

Comments
 (0)