Skip to content

docs(eventing): refresh page content and add event source hierarchy#3369

Open
Dennis-Mircea wants to merge 2 commits into
operator-framework:mainfrom
Dennis-Mircea:docs/refresh-eventing-page
Open

docs(eventing): refresh page content and add event source hierarchy#3369
Dennis-Mircea wants to merge 2 commits into
operator-framework:mainfrom
Dennis-Mircea:docs/refresh-eventing-page

Conversation

@Dennis-Mircea
Copy link
Copy Markdown
Contributor

Summary

Refreshes docs/content/en/docs/documentation/eventing.md, which had drifted from the current code on several fronts and was missing an overview of the event source class hierarchy.

Highlights:

  • Flow diagram updated. The mermaid diagram at the top of the page now includes Timer Event Source alongside Controller Event Source as the second SDK-managed event source. The latter was previously labeled "Custom Resource Event Source", which is not a real class. The dispatcher box was also renamed from "Event Handler" to "Event Processor" to match the actual EventProcessor class.
  • Intro paragraph rewrite. Split the single dense paragraph into three shorter ones, fixed the broken sentence ("Event sources act as listen to events..."), and standardized the voice to second person.
  • Fixed the post-diagram explanation. The "There are few interesting points here:" paragraph is now an actual bullet list. It mentions TimerEventSource (previously unmentioned) alongside ControllerEventSource, names RetryAndRescheduleTimerEventSource as the runtime identifier, and walks through the real dispatch chain EventProcessorReconciliationDispatcherController.reconcile(...) → user Reconciler.
  • Updated the registration code snippet. Removed references to EventSourceInitializer<Webapp> (no longer exists) and the bogus Webapp / WebappReconciler naming. The snippet now matches the actual WebPageReconciler in sample-operators/webpage/, with prepareEventSources correctly described as a default method on Reconciler.
  • Renamed ControllerResourceEventSourceControllerEventSource in the heading and link (the class was renamed in 2021 via commit 86245ca6; the page still carried the old name and a 404 link).
  • Added a TimerEventSource subsection under Built-in EventSources documenting the second auto-registered built-in.
  • Added an event source hierarchy diagram at the top of Built-in EventSources (mermaid graph TD) showing how InformerEventSource / ControllerEventSource share ManagedInformerEventSource, how PollingEventSource / PerResourcePollingEventSource / CachingInboundEventSource share ExternalResourceCachingEventSource, and where TimerEventSource and SimpleInboundEventSource fit. Distinct colors for interface, abstract classes, plain concretes, and the two SDK-managed built-ins.
  • Fixed a stale code link. The "related method" link in Caching and Event Sources pointed to a return; statement inside FetchingExecutor.run() (line 146). It now points to getSecondaryResources (#L160-L180), which is the method the surrounding prose is actually describing.
  • Normalized GitHub org in inline links from github.com/java-operator-sdk/java-operator-sdk to github.com/operator-framework/java-operator-sdk across the page (the old URLs still redirect, but the page mixed both orgs).

No code changes. Docs only.

Fixes #3368

Signed-off-by: Dennis-Mircea Ciupitu <dennis.mircea.ciupitu@gmail.com>
Copilot AI review requested due to automatic review settings May 21, 2026 17:01
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank May 21, 2026 17:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the Eventing documentation to clarify event source concepts, refresh diagrams, and align references/examples with the current repository structure.

Changes:

  • Rewrites introductory sections for clearer event-source and dispatch-flow explanations.
  • Updates Mermaid diagrams to include EventProcessor, TimerEventSource, and internal components.
  • Refreshes GitHub links and modernizes the “Registering Event Sources” example snippet.

Comment on lines +95 to 104
public class WebPageReconciler implements Reconciler<WebPage> {

@Override
public List<EventSource<?, Webapp>> prepareEventSources(EventSourceContext<Webapp> context) {
InformerEventSourceConfiguration<Webapp> configuration =
InformerEventSourceConfiguration.from(Deployment.class, Webapp.class)
public List<EventSource<?, WebPage>> prepareEventSources(EventSourceContext<WebPage> context) {
var configuration =
InformerEventSourceConfiguration.from(Deployment.class, WebPage.class)
.withLabelSelector(SELECTOR)
.build();
return List.of(new InformerEventSource<>(configuration, context));
}
Comment thread docs/content/en/docs/documentation/eventing.md Outdated
Comment on lines +47 to +59
- The `ControllerEventSource` is a special, internal event source responsible for handling events
pertaining to changes affecting the primary resource. The SDK registers it automatically for every
controller and you never instantiate it yourself.
- Every controller also gets a dedicated `TimerEventSource` (named
`RetryAndRescheduleTimerEventSource`) that the SDK uses to drive retry attempts after a failed
reconciliation, `UpdateControl.rescheduleAfter(...)` requests, and the periodic max-interval
failsafe trigger. The `EventProcessor` is the sole caller into this timer, scheduling delayed
events back to itself via `scheduleOnce(...)`. Like the controller event source, this one is
wired internally and is not something you register or interact with directly.
- Once an event reaches the `EventProcessor`, dispatch is delegated to the
`ReconciliationDispatcher`, which prepares the execution context, handles finalizers and other
framework concerns, and ultimately invokes `reconcile(...)` on the internal `Controller` wrapper,
which in turn calls the user-implemented `Reconciler`.
Signed-off-by: Dennis-Mircea Ciupitu <dennis.mircea.ciupitu@gmail.com>
Copy link
Copy Markdown
Collaborator

@xstefank xstefank left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@xstefank xstefank requested a review from csviri May 22, 2026 06:34
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.

docs(eventing): page is stale and missing event source hierarchy

3 participants