Skip to content

Commit c0411a2

Browse files
authored
Merge branch 'main' into codeboten/load-context-api
2 parents 7d2e1c6 + 0844b5e commit c0411a2

5 files changed

Lines changed: 41 additions & 6 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ 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))
3941
- ci: wait for tracecontext server readiness instead of a fixed sleep in `scripts/tracecontext-integration-test.sh`
4042
([#5149](https://github.com/open-telemetry/opentelemetry-python/pull/5149))
4143
- `opentelemetry-api`: conditionallly import entrypoints for `opentelemetry_context` only if the `OTEL_PYTHON_CONTEXT` env variable is defined, return `ContextVarsRuntimeContext` otherwise

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

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)