Skip to content

Rewrite SubscriptionReconciler to use new planner and Pipeline CRs#206

Open
ryannedolan wants to merge 1 commit intomainfrom
rdolan/unify-planner
Open

Rewrite SubscriptionReconciler to use new planner and Pipeline CRs#206
ryannedolan wants to merge 1 commit intomainfrom
rdolan/unify-planner

Conversation

@ryannedolan
Copy link
Copy Markdown
Collaborator

Summary

  • Rewrote SubscriptionReconciler to use DeploymentService.plan() / PipelineRel instead of the legacy HoptimatorPlanner, Operator, and Resource template system
  • Reconciler now creates Pipeline K8s CRs owned by Subscriptions, delegating readiness monitoring to the existing PipelineReconciler
  • Registered SUBSCRIPTIONS endpoint in K8sApiEndpoints and wired the controller into PipelineOperatorApp
  • Removed SubscriptionEnvironment (deprecated) and dropped hoptimator-planner/hoptimator-catalog/hoptimator-avro dependencies from the operator module
  • Planning is abstracted via a Planner interface for testability, with jdbcPlanner() factory for production use
  • Fixed a hanging K8sJobDeployerTest caused by stale mock stubs

Migration note: The hoptimator-planner module is intentionally untouched — the internal SubscriptionOperator fork still depends on the published jar. This PR provides a clear upgrade path: deploy the new operator and existing Subscription CRs will be handled by the new planner.

Testing Done

  • Unit tests rewritten for SubscriptionReconciler using FakeK8sApi pattern
  • All existing operator, k8s, jdbc, util, and api tests pass
  • Fixed previously-hanging K8sJobDeployerTest
  • Full ./gradlew test passes with 0 failures

Replace the legacy SubscriptionReconciler (which used HoptimatorPlanner,
Operator, and Resource templates) with a new implementation built on the
modern planner infrastructure (DeploymentService, PipelineRel, Deployers).

The new reconciler creates Pipeline K8s CRs owned by Subscriptions,
delegating status monitoring to the existing PipelineReconciler. This
provides a clear upgrade path for the internal SubscriptionOperator fork
while preserving the Subscription CRD contract.

Also fixes a hanging K8sJobDeployerTest caused by stale mock stubs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@jogrogan jogrogan left a comment

Choose a reason for hiding this comment

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

Change overall makes sense. Discussed already, but think we need some additional testing with our internal extensions before we can merge

Comment on lines +70 to +71
SubscriptionReconciler.Planner planner = SubscriptionReconciler.jdbcPlanner(jdbcConnection);
new PipelineOperatorApp(context).run(planner);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems like there is a lot of logic just to allow SubscriptionReconciler to support drop in planners, though in practice it'll always use the jdbcPlanner. Do you think we need this?

@@ -6,9 +6,6 @@ plugins {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suspect there are more files that are now unused in the hoptimator-operator package, namely "Operator.java" but maybe more that we can remove.

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.

2 participants