Skip to content

Add W3C Baggage propagation#292

Merged
JE-Chen merged 1 commit into
devfrom
feat/baggage-batch
Jun 21, 2026
Merged

Add W3C Baggage propagation#292
JE-Chen merged 1 commit into
devfrom
feat/baggage-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Adds W3C Baggage propagation. trace_context carried trace/span identity across an HTTP boundary, but nothing propagated cross-cutting key-value context (run_id/tenant/experiment).

  • Baggage — immutable key-value map (get; set/remove return new instances; to_dict).
  • parse_baggage(header) — drops optional ;metadata, rejects empty keys, percent-decodes.
  • format_baggage(baggage) — percent-encodes keys/values into a header value.
  • inject_baggage / extract_baggage — write/read the baggage header on a request dict (case-insensitive extract).

Pairs with trace_context.

Layers

  • Headless core: utils/baggage/ (pure stdlib urllib.parse, zero PySide6).
  • Facade: 5 symbols + __all__.
  • Executor: AC_baggage_parse, AC_baggage_format.
  • MCP: ac_baggage_parse, ac_baggage_format (read-only).
  • Script Builder: both under Data.
  • Tests: test/unit_test/headless/test_baggage_batch.py (9 tests, no Qt).
  • Docs: v84_features_doc.rst (EN + Zh) + toctrees + 3 README What's-new sections.

Verification

  • pytest test/unit_test/headless/test_baggage_batch.py → 9 passed.
  • ruff check je_auto_control/ clean; pylint 10.00/10; bandit clean; radon CC clean.
  • Package stays Qt-free.

trace_context carries trace/span identity across an HTTP boundary, but
nothing propagated cross-cutting key-value context (run_id / tenant /
experiment). Add the W3C Baggage header: an immutable Baggage value with
parse/format and case-insensitive inject/extract over a headers dict.
Wired through facade, executor (AC_baggage_parse / AC_baggage_format),
MCP, and the Script Builder with a headless test batch and EN/Zh docs.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 48 complexity · 0 duplication

Metric Results
Complexity 48
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 6e7bc9b into dev Jun 21, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/baggage-batch branch June 21, 2026 15:29
@sonarqubecloud

Copy link
Copy Markdown

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