Repository navigation
[SDT-0002]: move ServiceContext from SSC to SDT implementation - #240
Conversation
72d78ea to
2f61cd5
Compare
czechboy0
left a comment
There was a problem hiding this comment.
Did we consider putting the new types into one of the existing modules? Why do we want it in a separate one?
|
@kukushechkin would you mind tacking on diff --git a/.spi.yml b/.spi.yml
index 26f45b2..ea570cd 100644
--- a/.spi.yml
+++ b/.spi.yml
@@ -1,4 +1,4 @@
version: 1
builder:
configs:
- - documentation_targets: [Tracing, Instrumentation, InMemoryTracing]
+ - documentation_targets: [Tracing, Instrumentation, InMemoryTracing, ContextStorage] |
Co-authored-by: Joseph Heck <j_heck@apple.com>
@czechboy0 no, did not think about it. It feels it should be in a separate module. What is the downside of have a new module? |
I feel that the default should be not to separate into a separate module, unless we have a good reason. Do we? |
I agree with Honza to put it in |
|
@czechboy0 @slashmo UPD. Ah, wait, no, |
|
Hm, yeah. We need it for the context propagation requirement of |
Also works. @czechboy0 wdyt? |
|
Works for me. |
|
Sounds fine to me, while keeping a typealias for compatibility I guess right? |
czechboy0
left a comment
There was a problem hiding this comment.
One last docs fix, otherwise lgtm
Co-authored-by: Honza Dvorsky <honza@apple.com>
…tion (#92) Turn this package into a thin compatibility layer over swift-distributed-tracing. ## Motivation: Companion to apple/swift-distributed-tracing#240. `ServiceContext`'s implementation moved there, renamed to `TracingContext`. This package now re-exports it instead of owning it. ## Modifications: - Added a dependency on swift-distributed-tracing. - `ServiceContextModule` re-exports its `ContextStorage` module and declares its own non-deprecated `ServiceContext`/`ServiceContextKey`/`AnyServiceContextKey` typealiases. - Moved the behavior test suite to swift-distributed-tracing. - Add a compatibility smoke test. - Updated the README to point new adopters at swift-distributed-tracing directly. ## Result: `import ServiceContextModule` keeps working with no code changes and no deprecation warning, even in a file that also imports `Tracing` directly. New code should depend on swift-distributed-tracing and use `TracingContext` instead.
Move
ServiceContextfrom swift-service-context asInstrumentation.InstrumentationContext. Implements SDT-0002, companion to apple/swift-service-context#92.Motivation:
ServiceContextlived in its own package mainly for swift-distributed-tracing users, adding release overhead for little benefit. The name also reads as server-specific, discouraging non-server adoption.Modifications:
ServiceContexttoInstrumentation.ServiceContext/ServiceContextKey/AnyServiceContextKeytoInstrumentationContext/InstrumentationContextKey/AnyInstrumentationContextKey, keeping deprecated typealiases for old symbols.Result:
Existing code keeps compiling unchanged. Direct dependents using the old names get a deprecation warning with a fix-it; swift-service-context dependents get none, by design.
diagnose-api-breaking-changesreports breaking changes acrossTracing/Instrumentation/InMemoryTracing, all "type changed toInstrumentation.InstrumentationContext". This is expected — typealiases are transparent to the type system, so this shows up no matter which name call sites use, and we don't target ABI stability here, only source-compatibility.