Skip to content

send block creation events for sub-blocks as well#3247

Merged
sawka merged 1 commit intomainfrom
sawka/sub-block-events
Apr 24, 2026
Merged

send block creation events for sub-blocks as well#3247
sawka merged 1 commit intomainfrom
sawka/sub-block-events

Conversation

@sawka
Copy link
Copy Markdown
Member

@sawka sawka commented Apr 24, 2026

need to understand vdom usage

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 24, 2026

Walkthrough

This pull request adds telemetry tracking to differentiate between top-level block creation and sub-block creation in the wcore package. Changes include: adding .kilocode/package-lock.json to the .gitignore file, introducing a new optional BlockSubBlock boolean field to the TEventProps struct in the telemetry data layer, and updating the recordBlockCreationTelemetry helper function to accept a subBlock parameter that is passed to the telemetry event. Call sites in CreateSubBlock and CreateBlockWithTelemetry are updated to reflect the appropriate block type.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description 'need to understand vdom usage' is vague and generic, lacking meaningful connection to the actual changes made in the changeset. Provide a more descriptive explanation of the changes, such as clarifying how the telemetry differentiation between top-level and sub-block creation relates to understanding vdom usage.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'send block creation events for sub-blocks as well' clearly and accurately describes the main change: adding telemetry tracking for sub-block creation in addition to top-level blocks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sawka/sub-block-events

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pkg/wcore/block.go (1)

24-39: ⚠️ Potential issue | 🟠 Major

Clarify telemetry intent for CreateSubBlock — asymmetry with top-level path.

The PR adds unconditional telemetry to CreateSubBlock without an opt-out flag. This differs from the top-level path: CreateBlockWithTelemetry exposes a recordTelemetry parameter (though CreateBlock itself always passes true), but CreateSubBlock has no such option.

Before merging, confirm whether:

  1. Sub-block telemetry inflation is intentional and acceptable (each sub-block emits action:createblock and Renderers activity).
  2. If frequent sub-block creation is expected, whether filtering at the reporting layer (block:subblock=true) is preferred to avoid skewing historical action:createblock metrics, or whether a flag-based opt-out (like CreateBlockWithTelemetry) is better.

The code search shows the only caller is CreateSubBlockCommand (RPC handler), so this is not driven directly by vdom itself — but understanding the typical frequency of sub-block creation will inform the decision.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/wcore/block.go` around lines 24 - 39, CreateSubBlock unconditionally
calls recordBlockCreationTelemetry which asymmetrically inflates telemetry
versus the top-level CreateBlockWithTelemetry; update CreateSubBlock to accept
an opt-out telemetry flag (or honor a blockDef.Meta key like "block:subblock" /
"recordTelemetry") and pass that flag through to decide whether to call
recordBlockCreationTelemetry, or alternatively annotate the emitted telemetry
with a "block:subblock=true" tag so reporting can filter it; change the
CreateSubBlock signature and its caller CreateSubBlockCommand (and any other
callers) to provide the flag or ensure Meta contains the filtering tag, and keep
recordBlockCreationTelemetry usage consistent with CreateBlockWithTelemetry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@pkg/wcore/block.go`:
- Around line 24-39: CreateSubBlock unconditionally calls
recordBlockCreationTelemetry which asymmetrically inflates telemetry versus the
top-level CreateBlockWithTelemetry; update CreateSubBlock to accept an opt-out
telemetry flag (or honor a blockDef.Meta key like "block:subblock" /
"recordTelemetry") and pass that flag through to decide whether to call
recordBlockCreationTelemetry, or alternatively annotate the emitted telemetry
with a "block:subblock=true" tag so reporting can filter it; change the
CreateSubBlock signature and its caller CreateSubBlockCommand (and any other
callers) to provide the flag or ensure Meta contains the filtering tag, and keep
recordBlockCreationTelemetry usage consistent with CreateBlockWithTelemetry.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1d7f85c7-08b2-44fa-8270-8769c5fb1743

📥 Commits

Reviewing files that changed from the base of the PR and between c2a17e7 and ad68c37.

📒 Files selected for processing (3)
  • .gitignore
  • pkg/telemetry/telemetrydata/telemetrydata.go
  • pkg/wcore/block.go

@sawka sawka merged commit efd450f into main Apr 24, 2026
8 checks passed
@sawka sawka deleted the sawka/sub-block-events branch April 24, 2026 23:24
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