From 2793d7429c19b351a76359c35acfafd9cf70f1ae Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 27 Aug 2026 15:19:26 +0200 Subject: [PATCH] Expose observer reconcilers via public pkg/controller aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same convention already used for the domain reconcilers (pkg/controller/{environments,events,networks,sources}) — a thin public alias so environments-tests has a legal, non-internal import path to construct these against. The observer reconcilers (build/buildrun/githubevent/gitrepository/deployment/environment) had none, which made their behavior (GitHubEvent-triggered Build annotation patching, retry bookkeeping, etc.) unreachable from the conformance suite despite being live, wired code. Co-Authored-By: Claude Sonnet 5 --- pkg/controller/observers/build/reconciler.go | 30 ++++++++++++++++++ .../observers/buildrun/reconciler.go | 31 +++++++++++++++++++ .../observers/deployment/reconciler.go | 31 +++++++++++++++++++ .../observers/environment/reconciler.go | 31 +++++++++++++++++++ .../observers/githubevent/reconciler.go | 31 +++++++++++++++++++ .../observers/gitrepository/reconciler.go | 31 +++++++++++++++++++ 6 files changed, 185 insertions(+) create mode 100644 pkg/controller/observers/build/reconciler.go create mode 100644 pkg/controller/observers/buildrun/reconciler.go create mode 100644 pkg/controller/observers/deployment/reconciler.go create mode 100644 pkg/controller/observers/environment/reconciler.go create mode 100644 pkg/controller/observers/githubevent/reconciler.go create mode 100644 pkg/controller/observers/gitrepository/reconciler.go diff --git a/pkg/controller/observers/build/reconciler.go b/pkg/controller/observers/build/reconciler.go new file mode 100644 index 0000000..e1bb6ec --- /dev/null +++ b/pkg/controller/observers/build/reconciler.go @@ -0,0 +1,30 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package build re-exports the build-observer reconciler type as a public +// alias. The reconciler itself stays in internal/controller/observers/build, +// unchanged; this package exists only so that external test modules have a +// valid, non-internal import path to construct it against. +package build + +import ( + internalbuild "github.com/blanketops/environments-controller/internal/controller/observers/build" +) + +type ( + // Reconciler mirrors GitHubEvent trigger metadata onto Build annotations + // and bumps retry-attempt against the Build's retry policy. + Reconciler = internalbuild.Reconciler +) diff --git a/pkg/controller/observers/buildrun/reconciler.go b/pkg/controller/observers/buildrun/reconciler.go new file mode 100644 index 0000000..00df52a --- /dev/null +++ b/pkg/controller/observers/buildrun/reconciler.go @@ -0,0 +1,31 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package buildrun re-exports the buildrun-observer reconciler type as a +// public alias. The reconciler itself stays in +// internal/controller/observers/buildrun, unchanged; this package exists +// only so that external test modules have a valid, non-internal import path +// to construct it against. +package buildrun + +import ( + internalbuildrun "github.com/blanketops/environments-controller/internal/controller/observers/buildrun" +) + +type ( + // Reconciler observes Shipwright BuildRun objects and reflects their + // terminal Succeeded condition back onto the owning Build CR's status. + Reconciler = internalbuildrun.Reconciler +) diff --git a/pkg/controller/observers/deployment/reconciler.go b/pkg/controller/observers/deployment/reconciler.go new file mode 100644 index 0000000..f745d04 --- /dev/null +++ b/pkg/controller/observers/deployment/reconciler.go @@ -0,0 +1,31 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package deployment re-exports the deployment-observer reconciler type as +// a public alias. The reconciler itself stays in +// internal/controller/observers/deployment, unchanged; this package exists +// only so that external test modules have a valid, non-internal import path +// to construct it against. +package deployment + +import ( + internaldeployment "github.com/blanketops/environments-controller/internal/controller/observers/deployment" +) + +type ( + // Reconciler observes Flux Kustomization resources and feeds their + // terminal reconciliation outcome back to the owning Deployment CR. + Reconciler = internaldeployment.Reconciler +) diff --git a/pkg/controller/observers/environment/reconciler.go b/pkg/controller/observers/environment/reconciler.go new file mode 100644 index 0000000..55ff10c --- /dev/null +++ b/pkg/controller/observers/environment/reconciler.go @@ -0,0 +1,31 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package environment re-exports the environment-observer reconciler type +// as a public alias. The reconciler itself stays in +// internal/controller/observers/environment, unchanged; this package +// exists only so that external test modules have a valid, non-internal +// import path to construct it against. +package environment + +import ( + internalenvironment "github.com/blanketops/environments-controller/internal/controller/observers/environment" +) + +type ( + // Reconciler fans in readiness from all composed CR types and + // aggregates them into the owning Environment's status. + Reconciler = internalenvironment.Reconciler +) diff --git a/pkg/controller/observers/githubevent/reconciler.go b/pkg/controller/observers/githubevent/reconciler.go new file mode 100644 index 0000000..c7f7e30 --- /dev/null +++ b/pkg/controller/observers/githubevent/reconciler.go @@ -0,0 +1,31 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package githubevent re-exports the githubevent-observer reconciler type +// as a public alias. The reconciler itself stays in +// internal/controller/observers/githubevent, unchanged; this package exists +// only so that external test modules have a valid, non-internal import path +// to construct it against. +package githubevent + +import ( + internalgithubevent "github.com/blanketops/environments-controller/internal/controller/observers/githubevent" +) + +type ( + // Reconciler observes GitHubEvent CRs and their Argo Events Sensor, + // deriving and writing the event's accepted/triggered/success status. + Reconciler = internalgithubevent.Reconciler +) diff --git a/pkg/controller/observers/gitrepository/reconciler.go b/pkg/controller/observers/gitrepository/reconciler.go new file mode 100644 index 0000000..ad85d24 --- /dev/null +++ b/pkg/controller/observers/gitrepository/reconciler.go @@ -0,0 +1,31 @@ +/* +Copyright 2026 The BlanketOps Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package gitrepository re-exports the gitrepository-observer reconciler +// type as a public alias. The reconciler itself stays in +// internal/controller/observers/gitrepository, unchanged; this package +// exists only so that external test modules have a valid, non-internal +// import path to construct it against. +package gitrepository + +import ( + internalgitrepository "github.com/blanketops/environments-controller/internal/controller/observers/gitrepository" +) + +type ( + // Reconciler observes the Crossplane Repository backing a GitRepository + // CR and reflects its Ready condition back onto the GitRepository status. + Reconciler = internalgitrepository.Reconciler +)