Skip to content

Added ADR-0013 to document event driven federation#1673

Open
mike182uk wants to merge 1 commit intomainfrom
adr-0013
Open

Added ADR-0013 to document event driven federation#1673
mike182uk wants to merge 1 commit intomainfrom
adr-0013

Conversation

@mike182uk
Copy link
Member

ref https://linear.app/ghost/issue/BER-2715

Added ADR-0013 to document event driven federation which is a prerequisite to resolving https://linear.app/ghost/issue/BER-2715

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 76db6c56-63b5-437a-becd-2993b9c0a4f2

📥 Commits

Reviewing files that changed from the base of the PR and between 72202ca and 0e519ae.

📒 Files selected for processing (1)
  • adr/0013-event-driven-federation.md
✅ Files skipped from review due to trivial changes (1)
  • adr/0013-event-driven-federation.md

Walkthrough

A new ADR defines a codebase-wide standard for outbound ActivityPub federation: all sendActivity-based outbound flows must go through FediverseBridge and be triggered by domain events; controllers and services must not call sendActivity directly. It scopes this to federation as a side effect of domain ops (excluding inbound-response and protocol-specific integrations), prescribes a handler pattern where controllers emit domain events and FediverseBridge reconstructs context and performs inbox/follower deliveries, mandates delivery failures be caught and logged (best-effort), lists new events (PostUnlikedEvent, FollowRequestedEvent), and documents an incremental migration strategy plus noted risks (latency via emitAsync, repository lookups, payload completeness, deletion races, and future queue work).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding ADR-0013 documentation for event-driven federation.
Description check ✅ Passed The description is related to the changeset, referencing the ADR addition and linking it to a Linear issue as prerequisite work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adr-0013
📝 Coding Plan
  • Generate coding plan for human review comments

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

Copy link

@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.

🧹 Nitpick comments (2)
adr/0013-event-driven-federation.md (2)

127-127: Minor style improvement.

The phrase "grows in size" could be simplified to "grows" for conciseness.

📝 Suggested simplification
-- `FediverseBridge` grows in size as more handlers are added -- may need to be split into focused modules later
+- `FediverseBridge` grows as more handlers are added -- may need to be split into focused modules later
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@adr/0013-event-driven-federation.md` at line 127, Update the wording in the
ADR where `FediverseBridge` is described: replace the phrase "grows in size"
with the simpler "grows" for conciseness (i.e., change the sentence referencing
`FediverseBridge` to "`FediverseBridge` grows — may need to be split into
focused modules later" or similar concise wording).

71-94: Consider adding observability beyond error logging.

The error handling pattern correctly implements best-effort delivery with logging, preventing federation failures from crashing requests. However, consider documenting observability requirements such as metrics (delivery success/failure rates, retry counts) or alerting thresholds to ensure federation issues are surfaced proactively rather than discovered through log analysis.

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

In `@adr/0013-event-driven-federation.md` around lines 71 - 94, The review
suggests adding observability (metrics/alerts) beyond current error logging in
FediverseBridge; update the FediverseBridge helper methods
(sendActivityToFollowers and sendActivityToInbox) to emit metrics on
success/failure and retries in addition to calling this.logger.error on
exceptions—e.g., increment counters for federation.delivery.success/failure and
record retry_attempts or latency via your metrics client where ctx.sendActivity
is invoked, and ensure metric names and tags include identifiers like
account.username and activity.id (use the same symbols: FediverseBridge,
sendActivityToFollowers, sendActivityToInbox, this.logger.error) so downstream
monitoring and alerting can be configured.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@adr/0013-event-driven-federation.md`:
- Line 127: Update the wording in the ADR where `FediverseBridge` is described:
replace the phrase "grows in size" with the simpler "grows" for conciseness
(i.e., change the sentence referencing `FediverseBridge` to "`FediverseBridge`
grows — may need to be split into focused modules later" or similar concise
wording).
- Around line 71-94: The review suggests adding observability (metrics/alerts)
beyond current error logging in FediverseBridge; update the FediverseBridge
helper methods (sendActivityToFollowers and sendActivityToInbox) to emit metrics
on success/failure and retries in addition to calling this.logger.error on
exceptions—e.g., increment counters for federation.delivery.success/failure and
record retry_attempts or latency via your metrics client where ctx.sendActivity
is invoked, and ensure metric names and tags include identifiers like
account.username and activity.id (use the same symbols: FediverseBridge,
sendActivityToFollowers, sendActivityToInbox, this.logger.error) so downstream
monitoring and alerting can be configured.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 09368eae-2a19-4cbb-ae1e-dbcf54cff4f3

📥 Commits

Reviewing files that changed from the base of the PR and between b4c773b and 72202ca.

📒 Files selected for processing (1)
  • adr/0013-event-driven-federation.md

ref https://linear.app/ghost/issue/BER-2715

Added ADR-0013 to document event driven federation which is a prerequisite
to resolving https://linear.app/ghost/issue/BER-2715
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