Skip to content

Add traceFlags to SpanContext type definition#6751

Merged
mar-cf merged 1 commit into
mainfrom
mar/traceflags
May 11, 2026
Merged

Add traceFlags to SpanContext type definition#6751
mar-cf merged 1 commit into
mainfrom
mar/traceflags

Conversation

@mar-cf

@mar-cf mar-cf commented May 11, 2026

Copy link
Copy Markdown
Contributor

Add trace flags to type. Missed in #6576

@mar-cf mar-cf requested a review from a team as a code owner May 11, 2026 09:30
@mar-cf mar-cf requested a review from jamesopstad May 11, 2026 09:30

@ask-bonk ask-bonk Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm Bonk, and I've done a quick review of your PR.

This adds the missing traceFlags property to the SpanContext type definition, matching the C++ implementation from #6576.

The type change itself is correct — readonly traceFlags?: number matches the C++ kj::Maybe<TraceFlags> exposed as js.num(flags) in trace-stream.c++.

However, one issue:

  1. Missing snapshot regeneration (medium severity): The types/generated-snapshot/ files need to be regenerated after changes to types/defines/. CI validates that the snapshot matches the generated output. Run just generate-types and commit the updated snapshot files (types/generated-snapshot/latest/index.d.ts, types/generated-snapshot/latest/index.ts, types/generated-snapshot/experimental/index.d.ts, types/generated-snapshot/experimental/index.ts). See the recent Workflows PR for an example of this pattern (commit 12cb5c8).

@ask-bonk

ask-bonk Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

I'm Bonk, and I've done a quick review of your PR.

The type definition change itself is correct — readonly traceFlags?: number accurately matches the C++ implementation (kj::Maybe<TraceFlags> exposed via js.num(flags) in trace-stream.c++:555).

One actionable issue found:

  1. Missing snapshot regeneration (medium severity): The types/generated-snapshot/ files are not updated. CI validates that these snapshots match the generated output, and changes to types/defines/ require running just generate-types and committing the resulting snapshot files. Recent PRs modifying defines/ (e.g., the Workflows PR at commit 12cb5c8) included the snapshot updates alongside the source changes.

Review posted to PR #6751.

github run

@github-actions

github-actions Bot commented May 11, 2026

Copy link
Copy Markdown

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

@mar-cf mar-cf requested review from a team as code owners May 11, 2026 12:16
@mar-cf mar-cf enabled auto-merge May 11, 2026 12:52
@mar-cf mar-cf merged commit 97c004d into main May 11, 2026
24 checks passed
@mar-cf mar-cf deleted the mar/traceflags branch May 11, 2026 12:53
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.

3 participants