[chain-pr 10/10] Documentation updates#2936
Conversation
This comment has been minimized.
This comment has been minimized.
163a6a9 to
7344cf8
Compare
cb6fb90 to
39de94f
Compare
7344cf8 to
2804d8b
Compare
002f8b2 to
dca24cc
Compare
2804d8b to
d717506
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d7175062cd
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| | `MessageBus` | The channel. Subscribe, unsubscribe, send. | | ||
| | `MessageBusSubscription` | Opaque handle returned by the closure-based `subscribe(block:)` API. | | ||
|
|
||
| All types live in `DatadogInternal/Sources/MessageBus/MessageBus.swift`. The concrete implementation is `CoreMessageBus` in `DatadogCore/Sources/Core/CoreMessageBus.swift`. |
There was a problem hiding this comment.
Point contributors at the wired bus implementation
In this branch there is no DatadogCore/Sources/Core/CoreMessageBus.swift (repo-wide rg "CoreMessageBus" finds only this doc), and DatadogCore still owns DatadogCore/Sources/Core/MessageBus.swift, which dispatches legacy FeatureMessage; DatadogCoreProtocol.messageBus currently falls back to NOPMessageBus() with no concrete override. Following this new reference would make feature authors subscribe/send through an unwired no-op typed bus instead of the implementation that actually delivers messages in this commit.
Useful? React with 👍 / 👎.
|
|
||
| ```swift | ||
| // Fire-and-forget — no fallback needed | ||
| core.messageBus.send(message: RUMViewReset()) |
There was a problem hiding this comment.
Use the actual bus message type name
The public message type in DatadogInternal/Sources/Models/RUM/RUMPayloadMessages.swift is RUMViewResetMessage, not RUMViewReset (confirmed with repo-wide rg "RUMViewReset"). The sending example as written will not compile for anyone following the new guide, and the same wrong name is repeated in the supported-message table.
Useful? React with 👍 / 👎.
| | `DatadogContext` | `"core.context"` | `DatadogCore` (on every context update) | `ContextSharingTransformer`, `NetworkContextCoreProvider`, `WatchdogTerminationMonitor`, `RUMContextReceiver` (SR), `ContextMessageReceiver` (Trace), `CrashContextCoreProvider` | | ||
| | `TelemetryMessage` | `"telemetry"` | Any feature via `core.telemetry.*` | `TelemetryReceiver` (RUM) | | ||
| | `LogMessage` | `"log-message"` | `TracingWithLoggingIntegration` (Trace) | `LogMessageReceiver` (Logs) | |
There was a problem hiding this comment.
Correct the documented message keys
These keys do not match the source: DatadogContext.key is "core-context" in DatadogInternal/Sources/Context/DatadogContext.swift, and LogMessage.key is "log" in DatadogInternal/Sources/Models/Logs/LogMessage.swift. Since this table is the new uniqueness reference for adding bus messages, the wrong values can lead contributors to choose colliding or incompatible keys.
Useful? React with 👍 / 👎.
What and why?
As the chain migrates all SDK modules off the legacy
FeatureMessageAPI,ARCHITECTURE.mdandAGENTS.mdbecome misleading: they describeFeatureMessage,FeatureMessageReceiver, andCombinedFeatureMessageReceiveras the canonical patterns, with no mention of the replacement. Developers touching the bus would follow the wrong path.This PR is the documentation layer: it adds a dedicated
MESSAGE_BUS.mdreference, updatesARCHITECTURE.mdto deprecate the old sections in-place, and wiresAGENTS.mdso contributors land on the right doc immediately.How?
New file —
docs/MESSAGE_BUS.mdComprehensive reference for the typed bus:
BusMessage,BusMessageReceiver,MessageBus,MessageBusSubscription— role and location of eachBusMessageReceiver, when to use it (long-lived feature objects), where to subscribe (inenable(with:in:))subscribe(block:)/MessageBusSubscriptionpattern for ad-hoc subscriptions;CrashContextCoreProvideras a canonical examplesend(message:)andsend(message:else:)with fallback; note on async dispatchBusMessagetype: key, sender, consumer(s)BusMessage, subscribe, sendPassthroughMessageBusMockandTelemetryReceiverMockin unit testsUpdated —
docs/ARCHITECTURE.mdThe "Message Types", ".context Pattern", ".payload Pattern", and "CombinedFeatureMessageReceiver" sections are struck through and annotated as deprecated, with inline replacement guidance pointing to the new
BusMessageAPI. TheRUMCoreContextsection is explicitly noted as not deprecated.Updated —
AGENTS.mdMESSAGE_BUS.mdadded to thedocs/directory listing with a one-line descriptiondocs/MESSAGE_BUS.mdReview checklist
make api-surfacewhen adding new APIsChain overview
graph LR G1["1 — Typed MessageBus protocol and shared message types"] G2["2 — Test infrastructure for typed message bus"] G3["3 — DatadogCore: CoreMessageBus implementation and rename"] G4["4 — DatadogCrashReporting: typed-bus migration"] G5["5 — DatadogLogs: typed-bus migration"] G6["6 — DatadogTrace: typed-bus migration"] G7["7 — DatadogFlags: typed-bus migration"] G8["8 — DatadogRUM: typed-bus migration and TelemetryInterceptor merge"] G9["9 — DatadogSessionReplay and DatadogWebViewTracking: typed-bus migration"] G10["10 — Documentation updates"] G1 --> G2 G2 --> G3 G3 --> G4 G3 --> G5 G5 --> G6 G3 --> G7 G6 --> G8 G7 --> G8 G8 --> G9 G1 --> G10Merge in dependency order. PRs with no incoming edges from un-merged PRs can be reviewed in parallel.