Skip to content

Commit 95149c6

Browse files
committed
Merge origin/main into sql-transactions
Migrates the new transaction-span code to the semconv stability pattern introduced on main in open-telemetry#4109: - Replace direct DB_OPERATION / DB_SYSTEM / DB_NAME imports with the _set_db_operation / _set_db_system / _set_db_name helpers from opentelemetry.instrumentation._semconv, so transaction spans emit db.operation or db.operation.name (and equivalents) based on OTEL_SEMCONV_STABILITY_OPT_IN. - Gate error.type on _report_new(sem_conv_mode), matching requests/urllib. - Add new_semconv / both_semconv variants for the transaction tests in test_dbapi_integration.py to cover the migration matrix. - Drop the pre-semconv ERROR_TYPE failure-test assertions in psycopg, since ERROR_TYPE is now gated to new semconv mode and the dbapi-level new_semconv tests cover the gating behavior. Assisted-by: Claude Opus 4.7
2 parents a69e0e1 + a651600 commit 95149c6

810 files changed

Lines changed: 17710 additions & 10650 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.

.changelog/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Switch to SPDX license headers (#4533)
2+
# TODO: update with the squash-merge commit SHA after merge
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Add PR to project board
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened, ready_for_review]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
add-to-project:
12+
name: add to project board
13+
runs-on: ubuntu-latest
14+
if: github.event.pull_request.draft == false
15+
steps:
16+
# NOTE: do NOT add an actions/checkout step here. This workflow uses
17+
# pull_request_target (which has access to secrets) but must never
18+
# execute code from the fork branch. See open-telemetry/opentelemetry-python#4955 for context.
19+
- uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
20+
id: otelbot-token
21+
with:
22+
app-id: ${{ vars.OTELBOT_PYTHON_APP_ID }}
23+
private-key: ${{ secrets.OTELBOT_PYTHON_PRIVATE_KEY }}
24+
25+
- uses: actions/add-to-project@v1.0.2
26+
with:
27+
project-url: https://github.com/orgs/open-telemetry/projects/88
28+
github-token: ${{ steps.otelbot-token.outputs.token }}

.github/workflows/changelog.yml

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# This action requires that any PR targeting the main branch should touch at
2-
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
3-
# Changelog" label to disable this action.
1+
# This action requires that any PR targeting the main branch should add a
2+
# changelog fragment file in a .changelog/ directory. If a changelog entry
3+
# is not required, add the "Skip Changelog" label to disable this action.
44

55
name: changelog
66

@@ -22,18 +22,46 @@ jobs:
2222
2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
2527

26-
- name: Check for CHANGELOG changes
28+
- name: Fetch base branch
29+
run: git fetch origin ${{ github.base_ref }} --depth=1
30+
31+
- name: Ensure no direct changes to CHANGELOG.md
2732
run: |
28-
# Only the latest commit of the feature branch is available
29-
# automatically. To diff with the base branch, we need to
30-
# fetch that too (and we only need its latest commit).
31-
git fetch origin ${{ github.base_ref }} --depth=1
32-
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
33+
if [[ $(git diff --name-only FETCH_HEAD -- '**/CHANGELOG.md') ]]
3334
then
34-
echo "A CHANGELOG was modified. Looks good!"
35-
else
36-
echo "No CHANGELOG was modified."
37-
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
35+
echo "CHANGELOG.md files should not be directly modified."
36+
echo "Please add a changelog fragment file to the appropriate .changelog/ directory instead."
37+
echo "See CONTRIBUTING.md for details."
38+
echo ""
39+
echo "Or add the \"Skip Changelog\" label if this job should be skipped."
3840
false
3941
fi
42+
43+
- name: Check for changelog fragment
44+
run: |
45+
# Check for any new fragment files in any .changelog/ directory
46+
fragments=$(git diff --diff-filter=A --name-only FETCH_HEAD -- '**/.changelog/*' '.changelog/*' | grep -v '.gitignore' || true)
47+
if [[ -z "$fragments" ]]; then
48+
echo "No changelog fragment found for this PR."
49+
echo ""
50+
echo "Add a file named .changelog/${{ github.event.pull_request.number }}.<type>"
51+
echo "where <type> is one of: added, changed, deprecated, removed, fixed"
52+
echo ""
53+
echo "For coordinated packages, add to the root .changelog/ directory."
54+
echo "For independently released packages, add to <package>/.changelog/"
55+
echo "See CONTRIBUTING.md for details."
56+
echo ""
57+
echo "Or add the \"Skip Changelog\" label if this job should be skipped."
58+
exit 1
59+
fi
60+
echo "Found changelog fragment(s):"
61+
echo "$fragments"
62+
63+
- name: Install towncrier
64+
run: pip install towncrier==25.8.0
65+
66+
- name: Preview changelog
67+
run: towncrier build --draft --version Unreleased

.github/workflows/check-links.yml

Lines changed: 34 additions & 2 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 }} \
5254
|| { 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; }

.github/workflows/generate_workflows_lib/src/generate_workflows_lib/misc.yml.j2

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ jobs:
6868
- name: Install tox
6969
run: pip install tox-uv
7070

71+
{%- if job_data == "docker-tests" %}
72+
73+
- name: Install Microsoft SQL ODBC driver
74+
run: sudo apt update -y && ACCEPT_EULA=Y sudo apt install -y msodbcsql18 unixodbc-dev unixodbc
75+
{%- endif %}
76+
7177
- name: Run tests
7278
run: tox -e {{ job_data }}
7379
{%- if job_data == "generate-workflows" %}

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,3 +1353,22 @@ jobs:
13531353

13541354
- name: Run tests
13551355
run: tox -e lint-opamp-client
1356+
1357+
lint-license-header-check:
1358+
name: license-header-check
1359+
runs-on: ubuntu-latest
1360+
timeout-minutes: 30
1361+
steps:
1362+
- name: Checkout repo @ SHA - ${{ github.sha }}
1363+
uses: actions/checkout@v4
1364+
1365+
- name: Set up Python 3.14
1366+
uses: actions/setup-python@v5
1367+
with:
1368+
python-version: "3.14"
1369+
1370+
- name: Install tox
1371+
run: pip install tox-uv
1372+
1373+
- name: Run tests
1374+
run: tox -e lint-license-header-check

.github/workflows/misc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ jobs:
5959
- name: Install tox
6060
run: pip install tox-uv
6161

62+
- name: Install Microsoft SQL ODBC driver
63+
run: sudo apt update -y && ACCEPT_EULA=Y sudo apt install -y msodbcsql18 unixodbc-dev unixodbc
64+
6265
- name: Run tests
6366
run: tox -e docker-tests
6467

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ jobs:
4646
exit 1
4747
fi
4848
49-
if ! grep --quiet "^## Unreleased$" CHANGELOG.md; then
50-
echo the $changelog is missing an \"Unreleased\" section
51-
exit 1
52-
fi
53-
5449
version=$(./scripts/eachdist.py version --package ${{ inputs.package }})
5550
5651
version_file=$(find $path -type f -path "**/version.py")
@@ -106,11 +101,11 @@ jobs:
106101
- name: run tox
107102
run: tox -e generate
108103

109-
- name: Update the change log with the approximate release date
110-
run: |
111-
# the actual release date on main will be updated at the end of the release workflow
112-
date=$(date "+%Y-%m-%d")
113-
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version ${NEXT_VERSION} ($date)/" ${CHANGELOG}
104+
- name: Install towncrier
105+
run: pip install towncrier==25.8.0
106+
107+
- name: Generate changelog
108+
run: towncrier build --yes --version "$NEXT_VERSION" --dir "$(dirname $CHANGELOG)"
114109

115110
- name: Use CLA approved github bot
116111
run: .github/scripts/use-cla-approved-github-bot.sh

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ jobs:
5353
exit 1
5454
fi
5555
56-
if ! grep --quiet "^## Unreleased$" $changelog; then
57-
echo the $changelog is missing an \"Unreleased\" section
58-
exit 1
59-
fi
60-
6156
version_dev=$(./scripts/eachdist.py version --package ${{ inputs.package }})
6257
6358
if [[ ! $version_dev =~ ^([0-9]+)\.([0-9]+)[\.|b]{1}([0-9]+).*.dev$ ]]; then
@@ -134,10 +129,11 @@ jobs:
134129
- name: run tox
135130
run: tox -e generate
136131

137-
- name: Update the change log with the approximate release date
138-
run: |
139-
date=$(date "+%Y-%m-%d")
140-
sed -Ei "s/^## Unreleased$/## Version ${VERSION} ($date)/" ${CHANGELOG}
132+
- name: Install towncrier
133+
run: pip install towncrier==25.8.0
134+
135+
- name: Generate changelog
136+
run: towncrier build --yes --version "$VERSION" --dir "$(dirname $CHANGELOG)"
141137

142138
- name: Use CLA approved github bot
143139
run: .github/scripts/use-cla-approved-github-bot.sh
@@ -194,11 +190,11 @@ jobs:
194190
- name: run tox
195191
run: tox -e generate
196192

197-
- name: Update the change log on main
198-
run: |
199-
# the actual release date on main will be updated at the end of the release workflow
200-
date=$(date "+%Y-%m-%d")
201-
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version ${VERSION} ($date)/" ${CHANGELOG}
193+
- name: Install towncrier
194+
run: pip install towncrier==25.8.0
195+
196+
- name: Generate changelog
197+
run: towncrier build --yes --version "$VERSION" --dir "$(dirname $CHANGELOG)"
202198

203199
- name: Use CLA approved github bot
204200
run: .github/scripts/use-cla-approved-github-bot.sh

0 commit comments

Comments
 (0)