Skip to content

Commit e2dba83

Browse files
authored
Merge branch 'main' into fix-prometheus-exporter-link
2 parents 82d58ab + 14401e1 commit e2dba83

File tree

251 files changed

+9431
-5996
lines changed

Some content is hidden

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

251 files changed

+9431
-5996
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body:
1919
Please describe any aspect of your environment relevant to the problem, including your Python version, [platform](https://docs.python.org/3/library/platform.html), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.
2020
value: |
2121
OS: (e.g, Ubuntu)
22-
Python version: (e.g., Python 3.8.10)
22+
Python version: (e.g., Python 3.9.10)
2323
SDK version: (e.g., 1.25.0)
2424
API version: (e.g., 1.25.0)
2525

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
sdk-benchmarks:
9-
runs-on: self-hosted
9+
runs-on: equinix-bare-metal
1010
steps:
1111
- name: Checkout Core Repo @ SHA - ${{ github.sha }}
1212
uses: actions/checkout@v4

.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/generate_workflows.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ def get_test_job_datas(tox_envs: list, operating_systems: list) -> list:
4747
os_alias = {"ubuntu-latest": "Ubuntu", "windows-latest": "Windows"}
4848

4949
python_version_alias = {
50-
"pypy3": "pypy-3.8",
51-
"py38": "3.8",
50+
"pypy3": "pypy-3.9",
5251
"py39": "3.9",
5352
"py310": "3.10",
5453
"py311": "3.11",

.github/workflows/lint_0.yml

Lines changed: 15 additions & 7 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:
@@ -39,8 +47,8 @@ jobs:
3947
- name: Run tests
4048
run: tox -e lint-opentelemetry-api
4149

42-
lint-opentelemetry-proto-protobuf5:
43-
name: opentelemetry-proto-protobuf5
50+
lint-opentelemetry-proto-gen-latest:
51+
name: opentelemetry-proto-gen-latest
4452
runs-on: ubuntu-latest
4553
timeout-minutes: 30
4654
steps:
@@ -56,7 +64,7 @@ jobs:
5664
run: pip install tox
5765

5866
- name: Run tests
59-
run: tox -e lint-opentelemetry-proto-protobuf5
67+
run: tox -e lint-opentelemetry-proto-gen-latest
6068

6169
lint-opentelemetry-sdk:
6270
name: opentelemetry-sdk
@@ -210,8 +218,8 @@ jobs:
210218
- name: Run tests
211219
run: tox -e lint-opentelemetry-exporter-otlp-combined
212220

213-
lint-opentelemetry-exporter-otlp-proto-grpc:
214-
name: opentelemetry-exporter-otlp-proto-grpc
221+
lint-opentelemetry-exporter-otlp-proto-grpc-latest:
222+
name: opentelemetry-exporter-otlp-proto-grpc-latest
215223
runs-on: ubuntu-latest
216224
timeout-minutes: 30
217225
steps:
@@ -227,7 +235,7 @@ jobs:
227235
run: pip install tox
228236

229237
- name: Run tests
230-
run: tox -e lint-opentelemetry-exporter-otlp-proto-grpc
238+
run: tox -e lint-opentelemetry-exporter-otlp-proto-grpc-latest
231239

232240
lint-opentelemetry-exporter-otlp-proto-http:
233241
name: opentelemetry-exporter-otlp-proto-http

.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
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: OSSF Scorecard
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: "16 11 * * 4" # once a week
9+
workflow_dispatch:
10+
11+
permissions: read-all
12+
13+
jobs:
14+
analysis:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
# Needed for Code scanning upload
18+
security-events: write
19+
# Needed for GitHub OIDC token if publish_results is true
20+
id-token: write
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
27+
with:
28+
results_file: results.sarif
29+
results_format: sarif
30+
publish_results: true
31+
32+
# Upload the results as artifacts (optional). Commenting out will disable
33+
# uploads of run results in SARIF format to the repository Actions tab.
34+
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
35+
- name: "Upload artifact"
36+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
37+
with:
38+
name: SARIF file
39+
path: results.sarif
40+
retention-days: 5
41+
42+
# Upload the results to GitHub's code scanning dashboard (optional).
43+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
44+
- name: "Upload to code-scanning"
45+
uses: github/codeql-action/upload-sarif@5f8171a638ada777af81d42b55959a643bb29017 # v3.28.12
46+
with:
47+
sarif_file: results.sarif

.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"

0 commit comments

Comments
 (0)