Skip to content

Commit 61161a3

Browse files
authored
Merge branch 'main' into flaky-weaver-test-pypy
2 parents 739316a + 0844b5e commit 61161a3

7 files changed

Lines changed: 72 additions & 13 deletions

File tree

.github/workflows/check-links.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
steps:
3030
- name: Checkout Repo
3131
uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
3234

3335
- name: Get changed markdown files
3436
id: changed-files
@@ -42,11 +44,41 @@ jobs:
4244
if: steps.changed-files.outputs.any_changed == 'true'
4345
run: npm install -g markdown-link-check@v3.12.2
4446

45-
- name: Run markdown-link-check
46-
if: steps.changed-files.outputs.any_changed == 'true'
47+
- name: Check links on push to main
48+
if: steps.changed-files.outputs.any_changed == 'true' && github.event_name == 'push'
4749
run: |
4850
markdown-link-check \
4951
--verbose \
5052
--config .github/workflows/check_links_config.json \
5153
${{ steps.changed-files.outputs.all_changed_files }} \
52-
|| { echo "Check that anchor links are lowercase"; exit 1; }
54+
|| { echo "Check that anchor links are lowercase"; exit 1; }
55+
56+
- name: Check new links only on pull requests
57+
if: steps.changed-files.outputs.any_changed == 'true' && github.event_name == 'pull_request'
58+
run: |
59+
# Extract URLs only from added lines in the diff to avoid
60+
# rate limiting when checking all links in large files like
61+
# CHANGELOG.md. Only new/changed links are checked on PRs;
62+
# pushes to main still check all links in changed files.
63+
git diff "origin/${{ github.base_ref }}...HEAD" -- \
64+
${{ steps.changed-files.outputs.all_changed_files }} \
65+
| grep '^+' | grep -v '^+++' \
66+
| grep -oP 'https?://[^\s\)\]\"'"'"'`>]+' \
67+
| sort -u > /tmp/new_links.txt
68+
69+
if [ ! -s /tmp/new_links.txt ]; then
70+
echo "No new links found in diff, skipping check"
71+
exit 0
72+
fi
73+
74+
echo "Checking $(wc -l < /tmp/new_links.txt) new links:"
75+
cat /tmp/new_links.txt
76+
77+
# Write links as markdown so markdown-link-check can parse them
78+
awk '{print "- <" $0 ">"}' /tmp/new_links.txt > /tmp/new_links.md
79+
80+
markdown-link-check \
81+
--verbose \
82+
--config .github/workflows/check_links_config.json \
83+
/tmp/new_links.md \
84+
|| { echo "Check that anchor links are lowercase"; exit 1; }

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3636
([#5120](https://github.com/open-telemetry/opentelemetry-python/pull/5120))
3737
- Add WeaverLiveCheck test util
3838
([#5088](https://github.com/open-telemetry/opentelemetry-python/pull/5088))
39+
- Fix incorrect type annotation on `detectors` parameter of `get_aggregated_resources`
40+
([#5135](https://github.com/open-telemetry/opentelemetry-python/pull/5135))
41+
- ci: wait for tracecontext server readiness instead of a fixed sleep in `scripts/tracecontext-integration-test.sh`
42+
([#5149](https://github.com/open-telemetry/opentelemetry-python/pull/5149))
3943

4044
## Version 1.41.0/0.62b0 (2026-04-09)
4145

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Before you can contribute, you will need to sign the [Contributor License Agreem
1313

1414
Please also read the [OpenTelemetry Contributor Guide](https://github.com/open-telemetry/community/blob/main/guides/contributor/README.md).
1515

16+
If you are using AI agents to assist with contributions, please read [AGENTS.md](AGENTS.md) for guidance on how to use them responsibly in this project.
17+
1618
# Find your right repo
1719

1820
This is the main repo for OpenTelemetry Python. Nevertheless, there are other repos that are related to this project.
@@ -144,7 +146,7 @@ CONTRIB_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox
144146
```
145147

146148
The continuation integration overrides that environment variable with as per the configuration
147-
[here](https://github.com/open-telemetry/opentelemetry-python/blob/main/.github/workflows/test_0.yml#L14).
149+
[here](https://github.com/open-telemetry/opentelemetry-python/blob/main/.github/workflows/test.yml#L14).
148150

149151
### Benchmarks
150152

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ requests==2.32.3
1414
ruamel.yaml==0.17.21
1515
asgiref==3.7.2
1616
psutil==7.2.2
17-
GitPython==3.1.41
17+
GitPython==3.1.47
1818
pre-commit==3.7.0
1919
ruff==0.14.1

opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
import socket
6868
import sys
6969
import typing
70+
from collections.abc import Sequence
7071
from json import dumps
7172
from os import environ
7273
from types import ModuleType
@@ -517,7 +518,7 @@ def detect(self) -> "Resource":
517518

518519

519520
def get_aggregated_resources(
520-
detectors: typing.List["ResourceDetector"],
521+
detectors: Sequence["ResourceDetector"],
521522
initial_resource: typing.Optional[Resource] = None,
522523
timeout: int = 5,
523524
) -> "Resource":

scripts/tracecontext-integration-test.sh

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,42 @@ mkdir -p target
77
rm -rf ./target/trace-context
88
git clone https://github.com/w3c/trace-context ./target/trace-context
99
cd ./target/trace-context && git checkout $TRACECONTEXT_GIT_TAG && cd -
10-
# start example opentelemetry service, which propagates trace-context by
10+
# start example opentelemetry service, which propagates trace-context by
1111
# default.
1212
python ./tests/w3c_tracecontext_validation_server.py 1>&2 &
1313
EXAMPLE_SERVER_PID=$!
14-
# give the app server a little time to start up. Not adding some sort
15-
# of delay would cause many of the tracecontext tests to fail being
16-
# unable to connect.
17-
sleep 1
18-
onshutdown()
14+
onshutdown()
1915
{
2016
# send a sigint, to ensure
2117
# it is caught as a KeyboardInterrupt in the
2218
# example service.
2319
kill $EXAMPLE_SERVER_PID
2420
}
2521
trap onshutdown EXIT
22+
# Wait for the example server to accept connections on 127.0.0.1:5000
23+
# before running the W3C tracecontext tests. A fixed `sleep` raced the
24+
# Flask startup on slow CI runners and produced intermittent connection
25+
# errors (see issue #5104).
26+
wait_for_server() {
27+
host=127.0.0.1
28+
port=5000
29+
deadline=$(( $(date +%s) + 30 ))
30+
while [ "$(date +%s)" -lt "$deadline" ]; do
31+
# Bail out early if the server process died.
32+
if ! kill -0 "$EXAMPLE_SERVER_PID" 2>/dev/null; then
33+
echo "tracecontext example server exited before becoming ready" >&2
34+
return 1
35+
fi
36+
# Use python so we don't depend on extra tools (nc, curl, etc.).
37+
if python -c "import socket,sys; s=socket.socket(); s.settimeout(1); sys.exit(0 if s.connect_ex(('$host', $port)) == 0 else 1)" 2>/dev/null; then
38+
return 0
39+
fi
40+
sleep 0.5
41+
done
42+
echo "tracecontext example server did not become ready within 30s" >&2
43+
return 1
44+
}
45+
wait_for_server
2646
cd ./target/trace-context/test
2747

2848
# The disabled test is not compatible with an optional part of the W3C

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ commands_post =
344344
[testenv:public-symbols-check]
345345
recreate = True
346346
deps =
347-
GitPython==3.1.40
347+
GitPython==3.1.47
348348
griffe==1.7.3
349349
toml
350350
commands =

0 commit comments

Comments
 (0)