First attempt of apply recommendations#5
Merged
Conversation
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds initial support for discovering and applying Kedify rightsizing recommendations, including new CLI subcommands and improved text rendering for recommendation outputs.
Changes:
- Introduces
kedify apply recommendationsto patch Helm values (diff/override/json modes) based on a recommendations payload. - Adds
kedify list recommendations <cluster-id>andkedify auth token, and reorganizes auth commands underkedify auth .... - Extends output formatting to render recommendations as a table in
textoutput, plus adds sample chart/data for testing.
Reviewed changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
test/chart/values.yaml |
Adds a sample values file with explicit resource blocks for patching tests. |
test/chart/templates/deployments.yaml |
Adds a minimal Helm template set used to validate rendered workload/container existence. |
test/chart/Chart.yaml |
Adds a Helm chart definition for the test fixture. |
recommendations.json |
Adds a sample recommendations payload used by tests and demos. |
README.md |
Updates CLI usage docs for new auth subcommands and recommendations listing. |
internal/output/output.go |
Adds heuristic text rendering for recommendation lists (table output). |
internal/output/output_test.go |
Adds tests for recommendation table rendering and YAML fallbacks. |
internal/cli/run.go |
Adds new top-level commands and introduces commandResultError handling with JSON payload output. |
internal/cli/recommendations.go |
Implements list recommendations command wiring to API client + output formatting. |
internal/cli/commands_test.go |
Extends fakes and adds tests for auth token and list recommendations. |
internal/cli/auth_token.go |
Implements kedify auth token printing the resolved token to stdout. |
internal/cli/apply_recommendations.go |
Implements the Helm values patching workflow for recommendations (diff/override/json). |
internal/cli/apply_recommendations_test.go |
Adds end-to-end-ish tests for apply modes using the sample chart + recommendations. |
internal/api/client.go |
Refactors pagination into generic helpers and adds recommendations endpoint support. |
internal/api/client_test.go |
Adds tests for recommendations endpoint behavior incl. pagination/non-paginated fallback. |
docs/apply-recommendation.md |
Documents the v1 design/shape for applying recommendations. |
AGENTS.md |
Documents a new repo convention: automatically read all pages for paginated API endpoints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
Signed-off-by: Josef Karasek <karasek.jose@gmail.com>
zroubalik
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
kedify apply recommendationsfor Helm values patchingThe command applies Kedify recommendations to a Helm values file for a specific workload.
Arguments
deployment/<NAME>Target workload in
kind/nameform. v1 currently supportsdeployment.--namespaceNamespace of the target workload.
--chart-pathPath to the Helm chart to render and verify against.
--values-filePath to the Helm values file to patch.
--recommendations-filePath to a saved recommendations JSON/YAML file.
--containerOptional container filter. If omitted, the command matches all recommendation-bearing containers in the workload.
--resourcesOptional comma-separated resource list:
cpu-requests,cpu-limits,memory-requests,memory-limits.If omitted, all available recommendations are applied per matched container.
--min-confidenceInclusive confidence threshold. Defaults to
60.--formatOutput mode:
jsonfor machine-readable plan/resultdifffor unified diff against the values fileoverridefor a generated override values file--output-fileRequired when
--format overrideis used without--dry-run.--dry-runComputes the result without writing files.
Behavior
not_found,ambiguous,unsupported, andbelow_confidence_threshold.Example