Class BuildLifecycleCleanup

java.lang.Object
io.jenkins.plugins.interactiveinput.store.BuildLifecycleCleanup

public final class BuildLifecycleCleanup extends Object
Keeps interactive-input notifications in step with the build lifecycle: when a build is deleted its questions and reviews must stop appearing in the global notification centre and stop counting towards the sidebar badge (previously they lingered because nothing cleaned them up on deletion).

Two complementary hooks:

  • BuildLifecycleCleanup.Deletion — a RunListener fired the moment a build is deleted. The build's questions are purged outright (a question is only meaningful alongside its build, whose audit page is gone), and its reviews are marked "build deleted": the review record is kept (its comment/decision history is a durable artefact) but it no longer notifies, and the per-job interactive-view page shows it as build-deleted.
  • BuildLifecycleCleanup.Reconcile — an ItemListener whose onLoaded runs once at startup to self-heal builds that were deleted before this cleanup existed (or while the controller was down). It only acts when the owning job still resolves but the build is gone, so nothing is lost for a job that is merely slow to load.

Both hooks are defensively wrapped: a store fault is logged, never propagated, so it can neither break a build deletion nor abort Jenkins startup.