Skip to content

Update utopia-php/span to 3.0#49

Merged
loks0n merged 1 commit into
mainfrom
feat/span-3-0
Jun 7, 2026
Merged

Update utopia-php/span to 3.0#49
loks0n merged 1 commit into
mainfrom
feat/span-3-0

Conversation

@loks0n

@loks0n loks0n commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates utopia-php/span from 1.1.* to 3.0.* (resolves to 3.0.1) and migrates the breaking API changes.

Breaking changes migrated

  • Span::addExporter() removed → replaced with the variadic Span::setExporters(...) (tests/resources/server.php).
  • finish() now owns the level attribute → it sets level itself (from error presence, or an optional finish(?string $level) argument), so the old $span->set('level', 'warn') calls would be silently clobbered. onPacket() now tracks the level in a variable and passes it through as $span->finish($level) (src/DNS/Server.php).

Verification

  • PHPStan (level max): clean.
  • PHPUnit: 186 tests / 776 assertions pass against the Swoole server (docker compose).
  • Confirmed live span output uses the 3.0 format: {"level":"info","action":"dns.worker.start",...}.

🤖 Generated with Claude Code

Migrate the three breaking API changes from span 1.1 to 3.0:

- addExporter() was removed; use the variadic setExporters() instead.
- finish() now sets the `level` attribute itself, so the previous
  $span->set('level', 'warn') calls would be clobbered. Track the level
  through onPacket() and pass it via finish($level).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Jun 7, 2026

Copy link
Copy Markdown

Greptile Summary

This PR upgrades utopia-php/span from 1.1.* to 3.0.* and migrates two breaking API changes introduced in that library.

  • Span::addExporter() is replaced with the variadic Span::setExporters() in the test server bootstrap.
  • Level tracking is moved from an inline $span->set('level', 'warn') (which finish() would clobber in 3.0) to a local $level variable that is passed to $span->finish($level) in the outer finally block — covering all early-return paths correctly.

Confidence Score: 5/5

Straightforward dependency upgrade with two targeted call-site changes; all early-return paths correctly reach finish($level) through the outer finally block.

Both breaking-change migrations are minimal and correctly placed. The $level variable is always reachable by the outer finally regardless of which early-return branch is taken, and the setExporters swap is a one-to-one replacement. No logic was altered beyond what the span 3.0 API requires.

No files require special attention.

Important Files Changed

Filename Overview
src/DNS/Server.php Migrates span level tracking from $span->set('level', 'warn') to a local $level variable passed to finish($level), correctly handled via the outer finally block.
tests/resources/server.php Updates Span::addExporter() to Span::setExporters() per the span 3.0 API change.
composer.json Bumps utopia-php/span constraint from 1.1.* to 3.0.*.
composer.lock Lock file updated to utopia-php/span v3.0.1 with new commit reference.

Reviews (1): Last reviewed commit: "Update utopia-php/span to 3.0" | Re-trigger Greptile

@loks0n loks0n merged commit 5ee1c16 into main Jun 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant