Skip to content
CAI
Software that uses CAICheck a score

coryodaniel/bonny

69.7

Adequate · 3 October 2026

5k

lines of production code

Elixir

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Bonny is an Elixir framework for building Kubernetes operators, providing the infrastructure to define custom resources, manage controller lifecycles, and handle reconciliation events. It features a pluggable pipeline architecture for processing actions, supports leader election for high availability, and includes tools for scaffolding projects and generating Kubernetes manifests. The system integrates telemetry for observability and offers utilities for periodic tasks, status management, and finalizer handling.

How it got here

2018 — ControllerV2 architecture and tooling modernization

12 changes.

The project underwent a significant architectural shift by introducing the ControllerV2 event-driven pipeline, replacing the legacy handler model with a pluggable Axn-based system. This release modernized the developer experience by splitting monolithic generator tasks into modular commands and upgrading core dependencies, including the migration from the kazan client to the k8s library. Comprehensive test coverage was added to validate the new controller lifecycle, generator outputs, and integration scenarios.

2019–2022 — v0.5 architecture and observability overhaul

18 changes.

This period focused on the comprehensive v0.5 architecture rewrite, introducing a pluggable pipeline model, robust telemetry-based observability, and leader election support. It also established foundational API modules for Custom Resource Definitions and expanded the framework with new server components like the Reconciler and Scheduler.

Features

Add Credo linting configuration and mise-based development tooling

The repository now includes a \.credo.exs\ file that configures the Credo static analysis tool with a comprehensive set of enabled checks for consistency, design, readability, refactoring, and warnings, alongside a \.mise.toml\ file that standardizes the development environment by defining specific versions for Erlang (28.3.1) and Elixir (1.19.5) and providing tasks for dependency management, compilation, testing, and integration tests. Additionally, a \.envrc\ file is added to configure IEx persistent history via \direnv\, and the \.formatter.exs\ is updated to import the \:pluggable\ dependency, ensuring consistent code formatting across the project.

(repo-wide) · high confidence

Add Kubernetes Binding resource helper with telemetry

A new \Bonny.Server.Scheduler.Binding\ module has been added to the scheduler library to facilitate the creation and submission of Kubernetes Pod Binding resources. This module provides a helper to construct the binding map from pod and node data and executes the creation request via the K8s client. The operation is now wrapped in telemetry spans under the \\[:scheduler, :binding\]\ event, allowing users to monitor the success or failure of binding operations through standard telemetry metrics and logs.

lib/bonny/server/scheduler · high confidence

Added Leader Election support for multi-replica deployments

The operator now supports leader election using Kubernetes Leases to ensure only one replica runs active controllers at a time. This is enabled by passing \enable\_leader\_election: true\ when adding the operator to your Supervisor. The new \Bonny.Operator.LeaderElector\ module manages lease acquisition and renewal, starting the \Bonny.Operator.Supervisor\ (which hosts controllers and the event recorder) only when the instance becomes the leader, and gracefully shutting down the operator processes if leadership is lost or the process goes down.

lib/bonny/operator · high confidence

New API definition modules for CRDs, versions, and resource endpoints

Added three new modules in \lib/bonny/api\ to define Kubernetes API structures: \Bonny.API.CRD\ for generating Custom Resource Definition manifests, \Bonny.API.Version\ for defining API version schemas and defaults, and \Bonny.API.ResourceEndpoint\ for parsing and representing resource API endpoints. These modules provide the foundational structs and helper functions (such as \new!/1\ and \to\_manifest/1\) required to configure and expose custom resources within the operator.

lib/bonny/api · high confidence

New Kubernetes operator server components: Reconciler, Watcher, Scheduler, and AsyncStreamRunner

This change introduces four new modules in the Bonny server library to support Kubernetes operator functionality. The Reconciler module provides a stream-based mechanism to fetch resources and invoke controller reconciliation logic in parallel, wrapped with telemetry spans. The Watcher module creates streams for Kubernetes watch events (add, modify, delete) and maps them to controller event handlers, also using telemetry. The Scheduler module implements a custom Kubernetes scheduler interface, allowing users to define custom node selection logic for pods, and integrates with the Reconciler to handle pod scheduling. Finally, the AsyncStreamRunner module provides a supervised way to run these streams in separate processes, handling termination delays and supervision tree integration.

lib/bonny/server · high confidence

New Mix tasks for operator scaffolding and manifest generation

The library now includes \lib/mix/bonny.ex\ and \lib/mix/operator.ex\, introducing new Mix tasks such as \mix bonny.init\ and \mix bonny.gen.controller\. These tools allow users to scaffold new Bonny operator projects and generate Kubernetes resource manifests (ClusterRole, ServiceAccount, CRDs, and Deployment) directly from the command line, automating the setup of RBAC rules and deployment configurations.

lib/mix · high confidence

New documentation guides for Bonny v0.5+ architecture

Added a comprehensive set of documentation guides covering the v0.5+ operator architecture, including how to define operators, controllers, CRD versions, and mix tasks. The guides explain the new Pluggable pipeline model, event handling, descendant resource management, status updates, and observed generation skipping. A migration guide is included to help users upgrade from versions 0.4 and 0.5, detailing changes to configuration (e.g., \get\_conn\), controller definitions (\Bonny.ControllerV2\), and CRD manifests. Testing documentation covers both unit and integration testing strategies.

guides · high confidence

New example controllers and scheduler for Kubernetes resource management

Added two new example modules to demonstrate Bonny framework capabilities: DeploymentEventLogController, which logs lifecycle events for Kubernetes Deployments without requiring custom resource definitions, and TestScheduler, a node selection scheduler that picks the first available node for pod scheduling.

examples · high confidence

New pluggable pipeline steps for status safety, finalizers, and resource management

This release introduces several new pluggable steps to enhance controller capabilities and reliability. The new \Bonny.Pluggable.ApplyStatus\ step adds a \safe\_mode\ option (defaulting to false for backwards compatibility but configurable globally) to gracefully handle NotFound errors during status updates, preventing crashes when resources are deleted mid-reconciliation. A new \Bonny.Pluggable.Finalizer\ step allows declaring finalizer IDs and implementations, supporting automatic addition/removal of finalizers based on resource state and configurable logging. Additional steps include \Bonny.Pluggable.AddManagedByLabelToDescendants\ to automatically tag child resources with a managed-by label, \Bonny.Pluggable.AddMissingGVK\ to ensure apiVersion and kind fields are present on resources (fixing issues with list operations), \Bonny.Pluggable.ApplyDescendants\ to apply registered child resources with configurable event creation, \Bonny.Pluggable.SkipObservedGenerations\ to halt pipelines when observed generation matches the resource generation, and \Bonny.Pluggable.Logger\ for structured logging of action events.

lib/bonny/pluggable · high confidence

Removals

Removal of legacy module and placeholder API

The \Mix.Bonny.Operator\ module, which previously validated operator names, has been removed. Additionally, the \Bonny\ module's public API has been cleaned up by removing the \hello/0\ function and its documentation, while the module's documentation has been updated to reflect its purpose of extending the Kubernetes API.

lib · high confidence

Behavioural changes

Deprecate legacy events module in favor of new telemetry system

The \Bonny.Sys.Event\ module is now deprecated and delegates to the new \Bonny.Sys.Telemetry\ module, which defines structured telemetry spans for reconciler, watcher, scheduler, task, and operator operations. A new \Bonny.Sys.Logger\ component has been added to automatically attach these telemetry events to the Elixir Logger, enabling users to easily observe system activity through standard logging mechanisms.

lib/bonny/sys · high confidence

Introduce ControllerV2 and Axn-based event pipeline

Bonny introduces a new controller architecture (ControllerV2) that replaces the legacy handler model with a pluggable, event-driven pipeline. Controllers now process \Bonny.Axn\ action tokens, allowing users to register descendants, update status, and emit Kubernetes events via explicit steps rather than implicit delegation. This change decouples the controller logic from the CRD definition, supports core API resources, and integrates telemetry for observability, while the legacy \Bonny.Controller\ is marked deprecated.

lib/bonny · high confidence

Migrated configuration to import Config and environment-specific blocks

The application configuration has been updated to use the modern \import Config\ syntax instead of the deprecated \use Mix.Config\. Configuration is now explicitly scoped using \config\_env()\ checks for \:test\ and \:dev\ environments, replacing the previous single global configuration block. The test environment now explicitly defines controllers, API versions, and a mock connection provider, while the dev environment configures debug logging and a specific K8s connection context. Additionally, a global logger configuration was added to purge compile-time logs from the \:k8s\ library.

config · high confidence

Periodic task execution now emits telemetry events

The periodic task runner now instruments task execution using the :telemetry library, emitting events under the \[:task, :execution\] namespace. This allows users to monitor task lifecycle events (start, success, stop, failure) and capture metadata such as task ID and error reasons, replacing previous logging-only approaches with a standardized observability mechanism.

_lib/bonny/periodic\task · high confidence

Refactored generator tasks and removed legacy \`mix bonny.gen\`

The monolithic \mix bonny.gen\ task has been removed and replaced with specialized, modular tasks: \mix bonny.init\ for project scaffolding, \mix bonny.gen.controller\ for creating CRD controllers, \mix bonny.gen.manifest\ for generating Kubernetes YAML manifests, and \mix bonny.gen.dockerfile\ for building Dockerfiles. This change allows users to generate specific components independently rather than creating a full operator structure in one step, and the manifest generator now supports optional image flags and custom override callbacks.

lib/mix/tasks · high confidence

Updated \`mix bonny.init\` template to support runtime Kubernetes connection configuration

The \mix bonny.init\ generator now includes a dedicated \K8sConn\ module and updated \config.exs\ to resolve the Kubernetes connection object at runtime based on the mix environment. This allows the operator to use \\~/.kube/config\ for development, a file-based discovery driver for tests, and service account credentials in production, replacing the previous static configuration approach.

priv/templates/bonny.gen/init · high confidence

Updated controller generator to use Bonny.ControllerV2 and new module structure

The generated Kubernetes controller template has been refactored to use the \Bonny.ControllerV2\ behavior instead of the previous implicit delegation model. Generated controllers now explicitly define a \handle\_event/2\ function to manage \:add\, \:modify\, \:reconcile\, and \:delete\ actions, and include a \SkipObservedGenerations\ step. The generated module structure has also changed from \Operators.\<mod\_name\>.Controller\ to \Controller.\<controller\_name\>\, and a corresponding test template has been added to verify these event handling paths.

priv/templates/bonny.gen · high confidence

Test coverage

Added comprehensive test coverage for Bonny core components; Added test customizer for generated manifests; Added test helper module for Axn steps; Added test support controllers for integration testing; Added test support for API v1 TestResourceV2; Added test support infrastructure for integration testing; Added tests for Bonny pluggable steps; Added tests for Bonny.Mix.Operator manifest generation; Added tests for controller, Dockerfile, and manifest generators; Added unit tests for API modules; Added unit tests for Bonny server components; Updated test configuration and removed obsolete unit test.

Dependencies

Bonny 1.5.0 release with Elixir 1.14 support and dependency upgrades

This update bumps the project version to 1.5.0 and raises the minimum Elixir requirement to 1.14. It replaces the older \kazan\ client with the \k8s\ library (version 2.0+), switches the JSON library from Poison to Jason, and upgrades several development and testing tools including \credo\, \dialyxir\, \ex\_doc\, \excoveralls\, \mix\_test\_watch\, \ymlr\, \owl\, \telemetry\, and \pluggable\. The package metadata is also updated to include proper maintainer information, license details, and documentation extras.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 68 → 70 (+1.4)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 99 → 99 (+0.0)
  • Architecture 92 → 94 (+1.9)
  • Maturity 58 → 58 (+0.0)
  • Readiness 78 → 79 (+1.1)
  • Security 70 → 74 (+4.3)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (1)

  • Off-boarding risk: anonymized user #1

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

coryodaniel/bonny was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 3 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit da40ad7ba30c1de25ad7a9db211f00b8fcf2312e — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-8fe32cd45d00.