Skip to content

polish 😁#5

Merged
STRRL merged 9 commits intomasterfrom
chore/polish
Nov 16, 2025
Merged

polish 😁#5
STRRL merged 9 commits intomasterfrom
chore/polish

Conversation

@STRRL
Copy link
Owner

@STRRL STRRL commented Nov 8, 2025

No description provided.

STRRL and others added 9 commits November 7, 2025 20:43
…rnal package

Move webhook implementation from api/v1alpha1 to internal/webhook package
following Kubebuilder best practices for webhook organization. Implement
proper defaulting for component images through webhook defaulter instead
of hardcoding fallbacks in controller.

Changes:
- Move SupabaseProjectWebhook to internal/webhook package
- Add wellknown_supabase_images.go with centralized default image constants
- Implement Default() method to set component image defaults
- Simplify controller by using spec.Component.Image directly
- Update webhook registration in main.go

This improves separation of concerns and ensures image defaults are set
at admission time rather than reconciliation time.

Co-Authored-By: Claude <noreply@anthropic.com>
Restructure resource management by introducing a ComponentBuilder
interface and ComponentReconciler to standardize component lifecycle
management across all Supabase services.

Changes:
- Rename internal/resources package to internal/component
- Add ComponentBuilder interface with BuildDeployment/BuildService
- Create ComponentReconciler for unified reconciliation logic
- Update all component implementations to use new abstraction
- Refactor SupabaseProjectController to leverage ComponentReconciler

This improves code maintainability and reduces duplication in the
reconciliation logic for Kong, Auth, PostgREST, Realtime, Storage,
Meta, and Studio components.

Co-Authored-By: Claude <noreply@anthropic.com>
Phase 3.11: Documentation & Polish
- Add comprehensive architecture documentation (docs/architecture.md, 21KB)
- Add complete API reference (docs/api-reference.md, 22KB)
- Add package-level documentation (7 doc.go files)
- Update README with documentation links

Phase 3.9: Integration & Configuration
- Add StudioReady condition (15th condition, completing FR-015)
- Implement event recording for all phase transitions
- Add event constants for type safety and maintainability
- Update tests with FakeRecorder

Event Constants:
- 9 event reasons (PhaseChanged, DependenciesValidated, etc.)
- 10 event messages (with 3 format templates)
- Refactor all event calls to use constants

Testing:
- All unit and integration tests passing
- Code coverage: 11.2% controller, 71% component, 93% secrets
- Build verification successful

Project Status: 126/132 tasks (95.5%) complete

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ractices

- Replace Event() + fmt.Sprintf() with Eventf() for formatted messages
- Add comprehensive documentation comments to events.go explaining:
  - Reason format conventions (CamelCase, max 128 chars)
  - Message format guidelines (sentence case, human-readable)
  - References to official Kubernetes API conventions and guides

This aligns with:
- Kubernetes API conventions for Events
- Kubebuilder event recording best practices
- Core Kubernetes event patterns (pkg/kubelet/events/event.go)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add webhook and cert-manager scaffolding for admission webhooks:
- Add cert-manager certificate and issuer configuration
- Enable webhook manifests with mutating and validating webhooks
- Configure kustomize patches for webhook server deployment
- Uncomment webhook-related kustomize configurations

This enables validation and defaulting webhooks for SupabaseProject CRD.

Co-Authored-By: Claude <noreply@anthropic.com>
…t references

Separate validation responsibilities between admission webhook and controller:
- Webhook validates format/structure (secretRef.name not empty, image format)
- Controller validates runtime state (secret existence, content, connectivity)

Changes:
- Refactor webhook to only validate secret reference format
- Add comprehensive API documentation explaining validation layers
- Update specs to document layered validation approach (FR-019)
- Enhance E2E tests to validate both layers separately (T105a, T105b)
- Fix cert-manager kustomize configuration for Issuer references

This provides faster feedback (webhook rejects malformed requests immediately)
while enabling detailed error reporting (controller reports content errors via
status conditions).

Co-Authored-By: Claude <noreply@anthropic.com>
- Update go.mod version from 1.25 to 1.25.0
- Upgrade testing dependencies (Ginkgo v2.26.0, Gomega v1.38.2)
- Update k8s.io/apimachinery to v0.35.0-alpha.1
- Update OpenTelemetry instrumentation packages
- Upgrade controller-runtime dependencies
- Add clean-tools Makefile target to remove all downloaded tools

Co-Authored-By: Claude <noreply@anthropic.com>
Updated multiple dependencies to their latest versions and consolidated
the Go version declaration in go.mod by removing the separate toolchain
directive. Also enhanced webhook validation logic for SupabaseProject.

Co-Authored-By: Claude <noreply@anthropic.com>
…iation

Refactor T105b test case to verify that invalid database secrets are rejected
by the admission webhook before resource creation, rather than detecting the
issue during reconciliation. This improves the user experience by providing
immediate feedback when a secret is missing required keys.

Changes:
- Update test expectations to check for admission webhook rejection
- Simplify cleanup logic since invalid resources are never created
- Improve test description clarity

Co-Authored-By: Claude <noreply@anthropic.com>
@STRRL STRRL merged commit 6c3ac4c into master Nov 16, 2025
3 checks passed
@STRRL STRRL deleted the chore/polish branch November 23, 2025 22:42
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