feat(rw-comments): process doc comments via a backend extension point#91
Merged
Conversation
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>
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.
What
Replaces the
rw.commentsevents bus with a backend extension point, decoupling the doc-comment notification mechanism from the events service.@rwdocs/backstage-plugin-rw-node— pure types +rwCommentProcessingExtensionPoint(addProcessor) +CommentProcessor/CommentActivity. Only dependency@backstage/backend-plugin-api; no@rwdocs/core, no knex.CommentActivityResolverresolves a self-containedCommentActivityfrom its own tables (plus a catalog lookup for the resolved actor name); a fire-and-forgetCommentPostProcessorfans it out to every registered processor and is injected into the comments router. The events bus +CommentEventPublisher+ rw-common'scommentEvents.tsare removed.CommentNotifierimplementsCommentProcessor(format + send only) and registers viaaddProcessor. 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)
comment:thread:created/comment:reply:created/comment:thread:resolvedrw:comment:${rootId}"the docs"and"Someone"fallbacksVerification
End-to-end in the browser (Alice/Bob,
yarn dev): all three topics, actor exclusion on both paths, and per-thread scope collapse confirmed.typecheck0, 238 rw-backend tests pass, lint + format clean.🤖 Generated with Claude Code