Shopify/krane
67.1
Adequate · 6 November 2026
5.4k
lines of production code
Ruby
primary language
4
measurements over time
What this system is
Features
Add Krane CLI executable
A new executable script named 'krane' has been added to the 'exe' directory. This script serves as the entry point for the Krane CLI, invoking the Krane::CLI::Krane class with command-line arguments.
exe · high confidence
Introduce Krane CLI with deploy, render, restart, run, and global-deploy commands
The library now provides a structured command-line interface (CLI) built on Thor, replacing the previous entry points. Users can now invoke specific actions via dedicated commands: \deploy\ to ship resources to a namespace (with options for pruning, selectors, and protected namespaces), \global-deploy\ for cluster-wide non-namespaced resources, \render\ to process templates with ERB bindings and partials, \restart\ to restart deployments, statefulsets, or daemonsets, and \run\ to execute a pod for a specific task. A \version\ command is also included. This change shifts the product from implicit or script-based execution to an explicit, flag-driven CLI experience.
lib/krane/cli · high confidence
Krane 3.9.2 introduces dynamic cluster discovery, ejson secret provisioning, and structured logging
This release adds a new \ClusterResourceDiscovery\ component that dynamically determines the Kubernetes API base path and discovers available resources and CRDs using concurrent kubectl calls, replacing static discovery. It introduces an \EjsonSecretProvisioner\ to automatically decrypt ejson files and generate Kubernetes Secrets from them. The \BindingsParser\ now supports loading variable bindings from JSON, YAML, and CSV files. Logging is restructured with \DeferredSummaryLogging\ to provide a consolidated deployment summary at the end of operations, and \ContainerLogs\ now supports configurable line limits via the \KRANE\_LOG\_LINE\_LIMIT\ environment variable. The minimum supported Kubernetes version is raised to 1.22.0.
lib/krane · high confidence
Removals
Removed version constant file
The file defining the library's version constant has been deleted, removing the explicit version string from the codebase.
lib/kubernetes-deploy · high confidence
Behavioural changes
Comprehensive Kubernetes resource deployment logic and status reporting
This release introduces explicit resource handlers for ConfigMap, CronJob, CustomResource, CustomResourceDefinition, DaemonSet, Deployment, HorizontalPodAutoscaler, Ingress, Job, NetworkPolicy, PersistentVolumeClaim, Pod, PodDisruptionBudget, PodTemplate, ReplicaSet, ResourceQuota, Role, RoleBinding, Secret, Service, ServiceAccount, and StatefulSet. Each handler defines specific deployment success/failure criteria, status reporting, and timeout behaviors tailored to the resource type. Notable behavioral changes include: DaemonSets now ignore evicted pods and actively monitor node status; Deployments support a 'required-rollout' annotation to control success criteria (full, maxUnavailable, none, or percentage) and respect progress deadlines; StatefulSets with 'OnDelete' update strategy skip readiness checks during updates; CustomResources use CRD-defined rollout conditions for success/failure determination; PersistentVolumeClaims treat 'Pending' as success when using 'WaitForFirstConsumer' storage classes; Services support a 'skip-endpoint-validation' annotation; and the HorizontalPodAutoscaler uses the v2 API version.
_lib/krane/kubernetes\resource · high confidence
New CI and test runner scripts with updated local setup requirements
The repository introduces new \bin/ci\ and \bin/test\ scripts to standardize test execution, with \bin/ci\ running tests inside a Docker container using Ruby 2.7.6 and \bin/test\ handling local test dispatching with automatic parallelism detection. The \bin/setup\ script has been updated to explicitly check for and display warnings if \minikube\ or \kubectl\ (requiring version 1.22.0 or higher) are missing, ensuring developers have the necessary Kubernetes tooling before running tests. The legacy \bin/console\ script has been removed.
bin · high confidence
Project renamed to krane with redesigned CLI and public API
The tool has been renamed from kubernetes-deploy to krane, introducing a redesigned command-line interface and breaking changes to the public Ruby API. The main executable is now \krane deploy\ (replacing \kubernetes-deploy\), and the public namespace has changed from \KubernetesDeploy\ to \Krane\. Key CLI flags have been updated, such as \--template-dir\ becoming \-f, --filenames\ and \--max-watch-seconds\ becoming \--global-timeout\. The public API methods have been renamed to match CLI conventions (e.g., \DeployTask\#new\ now uses \filenames\ instead of \template\_paths\). A new \krane global-deploy\ command and \GlobalDeployTask\ class have been added to handle non-namespaced resources, as the main deploy task no longer supports them. Additionally, ERB template rendering is no longer performed by default in \krane deploy\; users must use \krane render\ and pipe the output to \krane deploy --stdin\ to reproduce previous behavior.
(repo-wide) · high confidence
Test coverage
Add ERB-based test fixtures for collection rendering; Added CLI integration tests for Krane commands; Added ejson-cloud test fixtures for secrets and web deployment; Added invalid test fixtures for error handling validation; Added script to generate flamegraphs from integration tests; Added serial integration tests for deployment and task execution metrics; Added test fixture for custom partials directory support; Added test fixtures for Kubernetes deployment templates and partials; Added test fixtures for YAML partials support; Added test fixtures for empty resources; Added test fixtures for invalid resource validation; Added test fixtures for missing partial scenarios; Added test fixtures for partial rendering scenarios; Added unit test fixtures for Kubernetes resources and configuration parsing; Added unit tests for Krane core components; Added unit tests for Kubernetes resource deployment logic; Added unit tests for cluster resource discovery, container logs, and resource caching; Expanded test assertions for Kubernetes resource types in fixture sets; Expanded test fixtures for hello-cloud; Integration tests added for Krane global deploy, restart, run, and render tasks; New test helper modules for fixture deployment and resource assertions; Refactored test infrastructure for the Krane gem.
Dependencies
Gem renamed to Krane with updated dependencies and Ruby version requirements
The project has been renamed from 'kubernetes-deploy' to 'krane', replacing the old gemspec with a new one that enforces a minimum Ruby version of 2.7.6 and updates core dependencies such as kubeclient (\~\> 4.9), googleauth (\~\> 1.2), and activesupport (\>= 5.0). The Gemfile now explicitly references the krane gemspec and adds the ruby-lsp development dependency.
(dependencies) · high confidence
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 65 → 67 (+2.0)
- Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.
Lenses
- Code Health 74 → 74 (+0.0)
- Architecture 99 → 99 (+0.0)
- Maturity 55 → 60 (+4.9)
- Readiness 66 → 67 (+0.1)
- Security 87 → 82 (-4.9)
Resolved (7)
- Ambiguous method overloading/usage. parse exists as both a constructor-like initializer taking a string and a no-arg method. This suggests parse(string) might be a factory or setter, while parse() is the execution step, but the naming is identical, causing confusion about whether calling parse with args replaces the buffer or parses immediately.
- Confusingly similar naming for distinct concepts. type() likely returns the Kubernetes Kind (e.g., 'Deployment'), while kubectl_resource_type() likely returns the API resource name (e.g., 'deployments'). Similarly, group() returns the API group. These are semantically distinct but named similarly, risking confusion about which returns the plural resource name vs the Kind string.
- Inconsistent exception handling semantics. The ! suffix in Ruby typically indicates a method that raises exceptions on failure, while the non-! version might return a boolean or nil. Without documentation, it is unclear if validate_config_files is a 'soft' check and validate_config_files! is a 'hard' check, or if they are redundant aliases with different error handling. This creates a cognitive load for API users to remember which variant to use.
- Off-boarding risk: anonymized user #1
- Orphaned file (lib/krane/kubeclient_builder.rb)
- Outdated: ruby-prof
- Outdated: statsd-instrument
New (2)
- Further sole-owners (lower concentration)
- Off-boarding risk: anonymized user #1
Changes since last survey
- 2 commits — 0 feature/other, 2 fixes
By area
- (repo) — 1 commit
- (root) — 1 commit
Notable commits
- fix: Merge pull request #993 from Shopify/bugfix/validate-empty-context-kube-config
- fix: fix: validate that contexts exists before trying to build client
Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Shopify/krane 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 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 1716f394c5e7940f678357c940ea56e5bb410d8c — the exact code this score is about.
- Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
- Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.2+preprod-5c4e66d9318b.