Skip to content

Commit a446419

Browse files
authored
Merge branch 'main' into test-metrics-concurrency
2 parents 3fdef73 + 7477b10 commit a446419

250 files changed

Lines changed: 23272 additions & 4394 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ body:
1010
1111
Before filing a bug, please be sure you have searched through [existing bugs](https://github.com/open-telemetry/opentelemetry-python/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug) to see if your bug is already addressed.
1212
If your bug is related to an instrumentation or plugin in [opentelemetry-python-contrib](https://github.com/open-telemetry/opentelemetry-python-contrib) please be sure to file it there.
13-
13+
1414
- type: textarea
1515
id: environment
1616
attributes:
@@ -19,10 +19,10 @@ 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.9.10)
22+
Python version: (e.g., Python 3.10.0)
2323
SDK version: (e.g., 1.25.0)
2424
API version: (e.g., 1.25.0)
25-
25+
2626
- type: textarea
2727
attributes:
2828
label: What happened?

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
sdk-benchmarks:
1212
permissions:
1313
contents: write # required for pushing to gh-pages
14-
runs-on: oracle-bare-metal-64cpu-512gb-x86-64
14+
runs-on: oracle-bare-metal-64cpu-1024gb-x86-64-ubuntu-24
1515
container:
1616
image: python:3.13-slim
1717
steps:

.github/workflows/check-links.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,48 @@ name: check-links
22
on:
33
push:
44
branches: [ main ]
5+
paths:
6+
- '**/*.md'
7+
- '.github/workflows/check-links.yml'
8+
- '.github/workflows/check_links_config.json'
59
pull_request:
10+
paths:
11+
- '**/*.md'
12+
- '.github/workflows/check-links.yml'
13+
- '.github/workflows/check_links_config.json'
614

715
permissions:
816
contents: read
917

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
20+
cancel-in-progress: true
21+
1022
jobs:
11-
changedfiles:
12-
name: changed files
13-
runs-on: ubuntu-latest
14-
if: ${{ github.actor != 'dependabot[bot]' }}
15-
outputs:
16-
md: ${{ steps.changes.outputs.md }}
17-
steps:
18-
- name: Checkout Repo
19-
uses: actions/checkout@v4
20-
with:
21-
fetch-depth: 0
22-
- name: Get changed files
23-
id: changes
24-
run: |
25-
echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main ${{ github.event.pull_request.head.sha }}) ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)" >> $GITHUB_OUTPUT
2623
check-links:
2724
runs-on: ubuntu-latest
28-
needs: changedfiles
29-
if: |
30-
github.event.pull_request.user.login != 'otelbot[bot]' && github.event_name == 'pull_request'
31-
&& ${{needs.changedfiles.outputs.md}}
25+
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'otelbot[bot]' }}
26+
timeout-minutes: 15
3227
steps:
3328
- name: Checkout Repo
34-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
30+
31+
- name: Get changed markdown files
32+
id: changed-files
33+
uses: tj-actions/changed-files@v46
3534
with:
36-
fetch-depth: 0
35+
files: |
36+
**/*.md
3737
3838
- name: Install markdown-link-check
39+
if: steps.changed-files.outputs.any_changed == 'true'
3940
run: npm install -g markdown-link-check@v3.12.2
4041

4142
- name: Run markdown-link-check
43+
if: steps.changed-files.outputs.any_changed == 'true'
4244
run: |
4345
markdown-link-check \
4446
--verbose \
4547
--config .github/workflows/check_links_config.json \
46-
${{needs.changedfiles.outputs.md}} \
47-
|| { echo "Check that anchor links are lowercase"; exit 1; }
48+
${{ steps.changed-files.outputs.all_changed_files }} \
49+
|| { echo "Check that anchor links are lowercase"; exit 1; }
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
name: Core Contrib Test
1+
# Do not edit this file.
2+
# This file is generated automatically by executing tox -e generate-workflows
3+
4+
name: CI
25

36
on:
47
push:
5-
branches-ignore:
6-
- 'release/*'
7-
- 'otelbot/*'
8+
branches:
9+
- 'main'
810
pull_request:
911

1012
permissions:
@@ -15,12 +17,32 @@ concurrency:
1517
cancel-in-progress: true
1618

1719
jobs:
18-
contrib_0:
19-
uses: open-telemetry/opentelemetry-python-contrib/.github/workflows/core_contrib_test_0.yml@main
20+
misc:
21+
uses: ./.github/workflows/misc.yml
22+
lint:
23+
uses: ./.github/workflows/lint.yml
24+
tests:
25+
uses: ./.github/workflows/test.yml
26+
contrib:
27+
uses: open-telemetry/opentelemetry-python-contrib/.github/workflows/core_contrib_test.yml@main
2028
with:
2129
CORE_REPO_SHA: ${{ github.sha }}
2230
CONTRIB_REPO_SHA: ${{ github.event_name == 'pull_request' && (
2331
contains(github.event.pull_request.labels.*.name, 'prepare-release') && github.event.pull_request.head.ref ||
2432
contains(github.event.pull_request.labels.*.name, 'backport') && github.event.pull_request.base.ref ||
2533
'main'
2634
) || 'main' }}
35+
36+
check:
37+
if: always()
38+
needs:
39+
- misc
40+
- lint
41+
- tests
42+
- contrib
43+
runs-on: ubuntu-latest
44+
steps:
45+
- name: Decide whether the needed jobs succeeded or failed
46+
uses: re-actors/alls-green@release/v1
47+
with:
48+
jobs: ${{ toJSON(needs) }}

.github/workflows/generate_workflows.py

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
)
1515
_tox_lint_env_regex = re_compile(r"lint-(?P<name>[-\w]+)")
1616
_tox_contrib_env_regex = re_compile(
17-
r"py39-test-(?P<name>[-\w]+\w)-?(?P<contrib_requirements>\d+)?"
17+
r"py310-test-(?P<name>[-\w]+\w)-?(?P<contrib_requirements>\d+)?"
1818
)
1919

2020

@@ -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.9",
51-
"py39": "3.9",
50+
"pypy3": "pypy-3.10",
5251
"py310": "3.10",
5352
"py311": "3.11",
5453
"py312": "3.12",
@@ -140,29 +139,17 @@ def _generate_workflow(
140139
job_datas: list,
141140
template_name: str,
142141
output_dir: Path,
143-
max_jobs: int = 250,
144-
):
145-
# Github seems to limit the amount of jobs in a workflow file, that is why
146-
# they are split in groups of 250 per workflow file.
147-
for file_number, job_datas in enumerate(
148-
[
149-
job_datas[index : index + max_jobs]
150-
for index in range(0, len(job_datas), max_jobs)
151-
]
152-
):
153-
with open(
154-
output_dir.joinpath(f"{template_name}_{file_number}.yml"), "w"
155-
) as test_yml_file:
156-
test_yml_file.write(
157-
Environment(
158-
loader=FileSystemLoader(
159-
Path(__file__).parent.joinpath("templates")
160-
)
161-
)
162-
.get_template(f"{template_name}.yml.j2")
163-
.render(job_datas=job_datas, file_number=file_number)
142+
) -> None:
143+
env = Environment(
144+
loader=FileSystemLoader(Path(__file__).parent.joinpath("templates"))
145+
)
146+
with open(output_dir.joinpath(f"{template_name}.yml"), "w") as yml_file:
147+
yml_file.write(
148+
env.get_template(f"{template_name}.yml.j2").render(
149+
job_datas=job_datas,
164150
)
165-
test_yml_file.write("\n")
151+
)
152+
yml_file.write("\n")
166153

167154

168155
def generate_test_workflow(
@@ -197,6 +184,22 @@ def generate_misc_workflow(
197184
)
198185

199186

187+
def generate_ci_workflow(
188+
output_dir: Path,
189+
) -> None:
190+
with open(output_dir.joinpath("ci.yml"), "w") as ci_yml_file:
191+
ci_yml_file.write(
192+
Environment(
193+
loader=FileSystemLoader(
194+
Path(__file__).parent.joinpath("templates")
195+
)
196+
)
197+
.get_template("ci.yml.j2")
198+
.render()
199+
)
200+
ci_yml_file.write("\n")
201+
202+
200203
if __name__ == "__main__":
201204
tox_ini_path = Path(__file__).parent.parent.parent.joinpath("tox.ini")
202205
output_dir = Path(__file__).parent
@@ -205,3 +208,4 @@ def generate_misc_workflow(
205208
)
206209
generate_lint_workflow(tox_ini_path, output_dir)
207210
generate_misc_workflow(tox_ini_path, output_dir)
211+
generate_ci_workflow(output_dir)
Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# Do not edit this file.
22
# This file is generated automatically by executing tox -e generate-workflows
33

4-
name: Lint 0
4+
name: Lint
55

66
on:
7-
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
11-
pull_request:
7+
workflow_call:
128

139
permissions:
1410
contents: read
1511

16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18-
cancel-in-progress: true
19-
2012
env:
2113
CORE_REPO_SHA: main
2214
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'
@@ -70,6 +62,44 @@ jobs:
7062
- name: Run tests
7163
run: tox -e lint-opentelemetry-proto-gen-latest
7264

65+
lint-opentelemetry-protojson-gen-latest:
66+
name: opentelemetry-protojson-gen-latest
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 30
69+
steps:
70+
- name: Checkout repo @ SHA - ${{ github.sha }}
71+
uses: actions/checkout@v4
72+
73+
- name: Set up Python 3.14
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: "3.14"
77+
78+
- name: Install tox
79+
run: pip install tox-uv
80+
81+
- name: Run tests
82+
run: tox -e lint-opentelemetry-protojson-gen-latest
83+
84+
lint-opentelemetry-codegen-json:
85+
name: opentelemetry-codegen-json
86+
runs-on: ubuntu-latest
87+
timeout-minutes: 30
88+
steps:
89+
- name: Checkout repo @ SHA - ${{ github.sha }}
90+
uses: actions/checkout@v4
91+
92+
- name: Set up Python 3.14
93+
uses: actions/setup-python@v5
94+
with:
95+
python-version: "3.14"
96+
97+
- name: Install tox
98+
run: pip install tox-uv
99+
100+
- name: Run tests
101+
run: tox -e lint-opentelemetry-codegen-json
102+
73103
lint-opentelemetry-sdk:
74104
name: opentelemetry-sdk
75105
runs-on: ubuntu-latest
Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# Do not edit this file.
22
# This file is generated automatically by executing tox -e generate-workflows
33

4-
name: Misc 0
4+
name: Misc
55

66
on:
7-
push:
8-
branches-ignore:
9-
- 'release/*'
10-
- 'otelbot/*'
11-
pull_request:
7+
workflow_call:
128

139
permissions:
1410
contents: read
1511

16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18-
cancel-in-progress: true
19-
2012
env:
2113
CORE_REPO_SHA: main
2214
# Set the SHA to the branch name if the PR has a label 'prepare-release' or 'backport' otherwise, set it to 'main'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
# next few steps publish to pypi
7575
- uses: actions/setup-python@v5
7676
with:
77-
python-version: '3.9'
77+
python-version: '3.10'
7878

7979
- name: Build wheels
8080
run: ./scripts/build.sh

.github/workflows/stale.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
This PR has been closed due to inactivity. Please reopen if you would
3434
like to continue working on it.
3535
exempt-pr-labels: "hold,WIP,blocked by spec,do not merge"
36+
# TODO: Revert back to default of 30 after we have cleared the backlog of stale PRs.
37+
operations-per-run: 500

0 commit comments

Comments
 (0)