Skip to content

Commit c74bf59

Browse files
authored
chore: update dependencies, CI, and tracing sem conv across codebase (#206)
* chore(composer): update dependencies and tools * ci(github): update GitHub Actions versions and add PHP 8.5 support * chore: migrate from deprecated `TraceAttributes` to updated Semantic Convention attributes across codebase * fix(DependencyInjection/Routing): optimize tracer locator and improve reflection method handling * chore(phpstan): update baseline and set PHP version to 8.2 * chore(phpstan): update excluded paths in phpstan configuration
1 parent 8127daa commit c74bf59

24 files changed

Lines changed: 180 additions & 135 deletions

File tree

.github/workflows/ci.yml

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
timeout-minutes: 20
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v5
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1818
- name: Install Nix
19-
uses: DeterminateSystems/nix-installer-action@v19
19+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
2020
- name: Setup Cachix
21-
uses: cachix/cachix-action@v16
21+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
2222
with:
2323
name: opentelemetry
2424
extraPullNames: nix-shell, php-src-nix
2525
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2626
- name: Setup Nix magic cache
27-
uses: DeterminateSystems/magic-nix-cache-action@v13
27+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
2828
- name: Run Nix Flake check
2929
run: nix flake check
3030
php-cs-fixer:
@@ -34,28 +34,31 @@ jobs:
3434
strategy:
3535
matrix:
3636
php:
37+
- '8.2'
3738
- '8.3'
39+
- '8.4'
40+
- '8.5'
3841
fail-fast: false
3942
steps:
4043
- name: Checkout
41-
uses: actions/checkout@v5
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4245
- name: Install Nix
43-
uses: DeterminateSystems/nix-installer-action@v19
46+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
4447
- name: Setup Cachix
45-
uses: cachix/cachix-action@v16
48+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
4649
with:
4750
name: opentelemetry
4851
extraPullNames: nix-shell, php-src-nix
4952
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
5053
- name: Setup Nix magic cache
51-
uses: DeterminateSystems/magic-nix-cache-action@v13
54+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
5255
- name: Instantiate Nix develop
53-
uses: nicknovitski/nix-develop@v1
56+
uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
5457
- name: Get composer cache directory
5558
id: composercache
5659
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
5760
- name: Cache dependencies
58-
uses: actions/cache@v4
61+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5962
with:
6063
path: ${{ steps.composercache.outputs.dir }}
6164
key: ${{ runner.os }}-composer-tools-php-cs-fixer-${{ hashFiles('**/composer.json') }}
@@ -73,28 +76,31 @@ jobs:
7376
strategy:
7477
matrix:
7578
php:
79+
- '8.2'
7680
- '8.3'
81+
- '8.4'
82+
- '8.5'
7783
fail-fast: false
7884
steps:
7985
- name: Checkout
80-
uses: actions/checkout@v5
86+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
8187
- name: Install Nix
82-
uses: DeterminateSystems/nix-installer-action@v19
88+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
8389
- name: Setup Cachix
84-
uses: cachix/cachix-action@v16
90+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
8591
with:
8692
name: opentelemetry
8793
extraPullNames: nix-shell, php-src-nix
8894
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
8995
- name: Setup Nix magic cache
90-
uses: DeterminateSystems/magic-nix-cache-action@v13
96+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
9197
- name: Instantiate Nix develop
92-
uses: nicknovitski/nix-develop@v1
98+
uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
9399
- name: Get composer cache directory
94100
id: composercache
95101
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
96102
- name: Cache dependencies
97-
uses: actions/cache@v4
103+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
98104
with:
99105
path: ${{ steps.composercache.outputs.dir }}
100106
key: ${{ runner.os }}-composer-tools-phpstan-${{ hashFiles('**/composer.json') }}
@@ -106,7 +112,7 @@ jobs:
106112
composer update --no-interaction --no-progress --ansi
107113
cd tools/phpstan && composer update --no-interaction --no-progress --ansi
108114
- name: Cache PHPStan results
109-
uses: actions/cache@v4
115+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
110116
with:
111117
path: /tmp/phpstan
112118
key: phpstan-php${{ matrix.php }}-${{ github.sha }}
@@ -128,9 +134,13 @@ jobs:
128134
- '8.2'
129135
- '8.3'
130136
- '8.4'
137+
- '8.5'
131138
dependencies:
132139
- 'highest'
133140
include:
141+
- php: '8.5'
142+
dependencies: 'highest'
143+
coverage: true
134144
- php: '8.4'
135145
dependencies: 'highest'
136146
coverage: true
@@ -143,24 +153,24 @@ jobs:
143153
fail-fast: false
144154
steps:
145155
- name: Checkout
146-
uses: actions/checkout@v5
156+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
147157
- name: Install Nix
148-
uses: DeterminateSystems/nix-installer-action@v19
158+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
149159
- name: Setup Cachix
150-
uses: cachix/cachix-action@v16
160+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
151161
with:
152162
name: opentelemetry
153163
extraPullNames: nix-shell, php-src-nix
154164
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
155165
- name: Setup Nix magic cache
156-
uses: DeterminateSystems/magic-nix-cache-action@v13
166+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
157167
- name: Instantiate Nix develop
158-
uses: nicknovitski/nix-develop@v1
168+
uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
159169
- name: Get composer cache directory
160170
id: composercache
161171
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
162172
- name: Cache dependencies
163-
uses: actions/cache@v4
173+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
164174
with:
165175
path: ${{ steps.composercache.outputs.dir }}
166176
key: ${{ runner.os }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
@@ -175,13 +185,13 @@ jobs:
175185
XDEBUG_MODE: coverage
176186
- name: Upload test artifacts
177187
if: always()
178-
uses: actions/upload-artifact@v4
188+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
179189
with:
180190
name: phpunit-logs-php${{ matrix.php }}-${{ matrix.dependencies }}
181191
path: build/logs/phpunit
182192
- name: Upload coverage results to Codecov
183193
if: matrix.coverage
184-
uses: codecov/codecov-action@v5
194+
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
185195
env:
186196
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
187197
with:

.github/workflows/docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v5
12+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1313
with:
1414
fetch-depth: 0
1515
- name: Install Nix
16-
uses: DeterminateSystems/nix-installer-action@v19
16+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
1717
- name: Setup Cachix
18-
uses: cachix/cachix-action@v16
18+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
1919
with:
2020
name: opentelemetry
2121
extraPullNames: nix-shell, php-src-nix
2222
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2323
- name: Setup Nix magic cache
24-
uses: DeterminateSystems/magic-nix-cache-action@v13
24+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
2525
- name: Instantiate Nix develop
26-
uses: nicknovitski/nix-develop@v1
26+
uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
2727
- name: Get composer cache directory
2828
id: composercache
2929
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
3030
- name: Cache dependencies
31-
uses: actions/cache@v4
31+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3232
with:
3333
path: ${{ steps.composercache.outputs.dir }}
3434
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -39,7 +39,7 @@ jobs:
3939
- name: Generate configuration reference
4040
run: composer test:console -- config:dump open_telemetry > docs/src/reference.yaml
4141
- name: Setup Node.js
42-
uses: actions/setup-node@v4
42+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
4343
with:
4444
node-version: 20
4545
cache: npm
@@ -49,7 +49,7 @@ jobs:
4949
- name: Build Docs
5050
run: cd docs && npm run build
5151
- name: Deploy Docs
52-
uses: JamesIves/github-pages-deploy-action@v4
52+
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
5353
with:
5454
branch: gh-pages
5555
folder: docs/src/.vuepress/dist

.github/workflows/fossa-scan.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ jobs:
88
timeout-minutes: 20
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v5
11+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1212
- name: Install Nix
13-
uses: DeterminateSystems/nix-installer-action@v19
13+
uses: DeterminateSystems/nix-installer-action@ef8a148080ab6020fd15196c2084a2eea5ff2d25 # v22
1414
- name: Setup Cachix
15-
uses: cachix/cachix-action@v16
15+
uses: cachix/cachix-action@1eb2ef646ac0255473d23a5907ad7b04ce94065c # v17
1616
with:
1717
name: opentelemetry
1818
extraPullNames: nix-shell, php-src-nix
1919
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
2020
- name: Setup Nix magic cache
21-
uses: DeterminateSystems/magic-nix-cache-action@v13
21+
uses: DeterminateSystems/magic-nix-cache-action@565684385bcd71bad329742eefe8d12f2e765b39 # v13
2222
- name: Instantiate Nix develop
23-
uses: nicknovitski/nix-develop@v1
23+
uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1
2424
- name: Get composer cache directory
2525
id: composercache
2626
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
2727
- name: Cache dependencies
28-
uses: actions/cache@v4
28+
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
2929
with:
3030
path: ${{ steps.composercache.outputs.dir }}
3131
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -36,11 +36,11 @@ jobs:
3636
run: |
3737
composer update --no-interaction --no-progress --ansi
3838
- name: Run Fossa Scan
39-
uses: fossas/fossa-action@v1
39+
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # v1.9.0
4040
with:
4141
api-key: '384c9e439463ce9d43a4bb7641d6785b'
4242
- name: Run Fossa Test
43-
uses: fossas/fossa-action@v1
43+
uses: fossas/fossa-action@ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 # v1.9.0
4444
with:
4545
api-key: '384c9e439463ce9d43a4bb7641d6785b'
4646
run-tests: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ var
1919
docs/node_modules
2020
docs/src/.vuepress/dist
2121
docs/src/reference.yaml
22+
/tests/Functional/Application/config/reference.php

composer.json

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
],
2323
"require": {
2424
"php": ">=8.2",
25-
"guzzlehttp/guzzle": "^7.9",
26-
"guzzlehttp/psr7": "^2.7",
27-
"monolog/monolog": "^3.8",
25+
"guzzlehttp/guzzle": "^7.10",
26+
"guzzlehttp/psr7": "^2.9",
27+
"monolog/monolog": "^3.10",
2828
"open-telemetry/api": "^1",
2929
"open-telemetry/context": "^1",
3030
"open-telemetry/opentelemetry-logger-monolog": "^1",
@@ -33,11 +33,11 @@
3333
"open-telemetry/sdk": "^1",
3434
"open-telemetry/sem-conv": "^1",
3535
"open-telemetry/symfony-sdk-bundle": "^0",
36-
"symfony/config": "^7.2",
37-
"symfony/dependency-injection": "^7.2",
38-
"symfony/event-dispatcher": "^7.2",
36+
"symfony/config": "^7.4",
37+
"symfony/dependency-injection": "^7.4",
38+
"symfony/event-dispatcher": "^7.4",
3939
"zenstruck/dsn": "^0.2",
40-
"zenstruck/uri": "^2.3"
40+
"zenstruck/uri": "^2.4"
4141
},
4242
"require-dev": {
4343
"ext-grpc": "*",
@@ -46,35 +46,36 @@
4646
"ext-pdo": "*",
4747
"ext-pdo_sqlite": "*",
4848
"ext-xdebug": "*",
49-
"doctrine/dbal": "^3.8 || ^4.2",
50-
"doctrine/doctrine-bundle": "^2.13",
51-
"doctrine/doctrine-migrations-bundle": "^3.4",
52-
"doctrine/orm": "^2.18 || ^3.3",
53-
"ergebnis/composer-normalize": "^2.45",
54-
"matthiasnoback/symfony-config-test": "^6.0",
55-
"matthiasnoback/symfony-dependency-injection-test": "^6.0",
49+
"doctrine/dbal": "^3.8 || ^4.4",
50+
"doctrine/doctrine-bundle": "^2.18",
51+
"doctrine/doctrine-migrations-bundle": "^3.7",
52+
"doctrine/orm": "^2.18 || ^3.6",
53+
"ergebnis/composer-normalize": "^2.50",
54+
"matthiasnoback/symfony-config-test": "^6.2",
55+
"matthiasnoback/symfony-dependency-injection-test": "^6.3",
5656
"mcaskill/composer-exclude-files": "^4.0",
5757
"nyholm/symfony-bundle-test": "^3.0",
5858
"open-telemetry/exporter-otlp": "^1",
5959
"open-telemetry/exporter-zipkin": "^1",
6060
"open-telemetry/transport-grpc": "^1",
6161
"phpunit/phpunit": "^11.5",
62-
"pyrech/composer-changelogs": "^2.1",
62+
"pyrech/composer-changelogs": "^2.2",
6363
"roave/security-advisories": "dev-master",
64-
"symfony/browser-kit": "^7.2",
65-
"symfony/cache": "^7.2",
66-
"symfony/framework-bundle": "^7.2",
67-
"symfony/http-client": "^7.2",
68-
"symfony/http-kernel": "^7.2",
69-
"symfony/mailer": "^7.2",
70-
"symfony/messenger": "^7.2",
71-
"symfony/monolog-bundle": "^3.10",
72-
"symfony/phpunit-bridge": "^7.2",
73-
"symfony/runtime": "^7.2",
74-
"symfony/twig-bundle": "^7.2",
75-
"symfony/yaml": "^7.2",
76-
"twig/twig": "^3.18",
77-
"zalas/phpunit-globals": "^4.0"
64+
"symfony/browser-kit": "^7.4",
65+
"symfony/cache": "^7.4",
66+
"symfony/framework-bundle": "^7.4",
67+
"symfony/http-client": "^7.4",
68+
"symfony/http-kernel": "^7.4",
69+
"symfony/mailer": "^7.4",
70+
"symfony/messenger": "^7.4",
71+
"symfony/monolog-bundle": "^3.11",
72+
"symfony/phpunit-bridge": "^7.4",
73+
"symfony/runtime": "^7.4",
74+
"symfony/twig-bundle": "^7.4",
75+
"symfony/var-exporter": "^7.4",
76+
"symfony/yaml": "^7.4",
77+
"twig/twig": "^3.24",
78+
"zalas/phpunit-globals": "^4.2"
7879
},
7980
"suggest": {
8081
"doctrine/doctrine-bundle": "Needed to enable Doctrine DBAL & ORM instrumentation",

phpstan-baseline.neon

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,9 @@ parameters:
8989
identifier: method.resultUnused
9090
count: 1
9191
path: tests/Unit/OpenTelemetry/Trace/TracerProvider/NoopTracerProviderFactoryTest.php
92+
93+
-
94+
message: '#^Call to an undefined static method ReflectionMethod\:\:createFromMethodName\(\)\.$#'
95+
identifier: staticMethod.notFound
96+
count: 1
97+
path: src/Instrumentation/Symfony/Framework/Routing/TraceableRouteLoader.php

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ includes:
22
- phpstan-baseline.neon
33

44
parameters:
5+
phpVersion: 80200
56
level: 6
67
paths:
78
- src/
@@ -13,6 +14,7 @@ parameters:
1314
reportUnmatchedIgnoredErrors: true
1415
excludePaths:
1516
- tests/*/var/*
17+
- tests/Functional/Application/config/reference.php (?)
1618

1719
# Doctrine ^3.8
1820
- src/Instrumentation/Doctrine/Middleware/TraceableConnectionV3.php

src/DependencyInjection/Compiler/TracerLocatorPass.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ public function process(ContainerBuilder $container): void
3131
*/
3232
private function setTracerLocatorArgument(ContainerBuilder $container, Definition $service, array $tracers): void
3333
{
34+
$refs = [];
35+
foreach ($tracers as $id => $_) {
36+
$refs[$id] = new Reference($id);
37+
}
38+
3439
$service->setArgument(
3540
'$tracerLocator',
36-
ServiceLocatorTagPass::register($container, array_map(fn (string $id) => new Reference($id), array_keys($tracers))),
41+
ServiceLocatorTagPass::register($container, $refs),
3742
);
3843
}
3944
}

0 commit comments

Comments
 (0)