Skip to content

feat(rw-comments): process doc comments via a backend extension point#91

Merged
yumike merged 1 commit into
mainfrom
feat/rw-comment-processing
Jun 29, 2026
Merged

feat(rw-comments): process doc comments via a backend extension point#91
yumike merged 1 commit into
mainfrom
feat/rw-comment-processing

Conversation

@yumike

@yumike yumike commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What

Replaces the rw.comments events bus with a backend extension point, decoupling the doc-comment notification mechanism from the events service.

  • New package @rwdocs/backstage-plugin-rw-node — pure types + rwCommentProcessingExtensionPoint (addProcessor) + CommentProcessor / CommentActivity. Only dependency @backstage/backend-plugin-api; no @rwdocs/core, no knex.
  • rw-backendCommentActivityResolver resolves a self-contained CommentActivity from its own tables (plus a catalog lookup for the resolved actor name); a fire-and-forget CommentPostProcessor fans it out to every registered processor and is injected into the comments router. The events bus + CommentEventPublisher + rw-common's commentEvents.ts are removed.
  • notifications moduleCommentNotifier implements CommentProcessor (format + send only) and registers via addProcessor. No DB, events, or catalog.

All resolver reads are best-effort and run concurrently, so one transient failure can't reject the resolve and suppress an otherwise-deliverable notification.

Frozen contract (preserved byte-for-byte)

  • topics comment:thread:created / comment:reply:created / comment:thread:resolved
  • scope rw:comment:${rootId}
  • title/description/link wording incl. the "the docs" and "Someone" fallbacks

Verification

End-to-end in the browser (Alice/Bob, yarn dev): all three topics, actor exclusion on both paths, and per-thread scope collapse confirmed. typecheck 0, 238 rw-backend tests pass, lint + format clean.

🤖 Generated with Claude Code

Replace the rw.comments events bus with a backend extension point, decoupling the
doc-comment notification mechanism from the events service.

- New package @rwdocs/backstage-plugin-rw-node: pure types +
  rwCommentProcessingExtensionPoint (addProcessor) + CommentProcessor /
  CommentActivity. Only dep @backstage/backend-plugin-api; no @rwdocs/core, no knex.
- rw-backend: CommentActivityResolver resolves a self-contained CommentActivity from
  its own tables (+ a catalog lookup for the resolved actor name); a fire-and-forget
  CommentPostProcessor fans it out to every registered processor and is injected into
  the comments router. The events bus + CommentEventPublisher + rw-common's
  commentEvents.ts are removed.
- notifications module: CommentNotifier implements CommentProcessor (format + send
  only) and registers via addProcessor. No DB, events, or catalog.

All resolver reads are best-effort and run concurrently, so one transient failure
can't reject the resolve and suppress an otherwise-deliverable notification. The
frozen notification contract is preserved byte-for-byte: topics
comment:thread:created / comment:reply:created / comment:thread:resolved; scope
rw:comment:${rootId}; title/description/link wording incl. the "the docs" and
"Someone" fallbacks.

Verified end-to-end in the browser (Alice/Bob): all three topics, actor exclusion,
and per-thread scope collapse. typecheck 0, 238 rw-backend tests pass, lint+format clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@yumike yumike merged commit a626a28 into main Jun 29, 2026
1 check passed
@yumike yumike deleted the feat/rw-comment-processing branch June 29, 2026 08:49
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