Repository navigation
feat(tracing): forward X-Campus-Device; JsonClient.set_default_header (campus#837) - #99
Merged
Merged
Conversation
… (#837) - propagation_headers() forwards a stashed g.device as X-Campus-Device (mirror of campus.config.DEVICE_ID_HEADER), so a child service's span carries the caller's device identity when the host knows it. The receiving middleware reads the header only when it knows nothing better (g.device absent, no campus_device cookie). - JsonClient.set_default_header(): non-browser clients (campus-cli) present their config-persisted device id on every API call without per-call plumbing. ABC gains a raising default so callers can detect a transport that cannot carry default headers. Lock bump: campus-suite -> a12f023 (DEVICE_ID_HEADER + middleware header fallback). Refs nyjc-computing/campus#837
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK half of campus#837 (the CLI device lane from the campus#825 design).
What changes
propagation_headers()forwardsg.deviceasX-Campus-Device(mirror ofcampus.config.DEVICE_ID_HEADER, same lockstep convention as the X-Journey-ID pair): a child service's span carries the caller's device identity when the host stashed one viaflask_campus'spush_context. The receiving middleware (campus#838) reads the header only when it knows nothing better.JsonClient.set_default_header(name, value): lets non-browser clients (campus-cli) present their config-persisted device id on every API call without per-call plumbing. The ABC gains a raising default so callers can detect a transport that cannot carry default headers.campus-suite→ a12f023 (middleware header fallback +DEVICE_ID_HEADERconstant).Test plan
test_trace_propagation.py: device forwarded inside/outside trace context; absent stash → no header; default header sent on every call; request-time forward wins over the static default; default persists across calls.Ref nyjc-computing/campus#837