Unify Compose/Helm lifecycle behavior in cds up/down/state - #699
Open
RonaldHensbergen wants to merge 2 commits into
Open
RonaldHensbergen wants to merge 2 commits into
RonaldHensbergen wants to merge 2 commits into
Conversation
- Readiness: helm_up() now polls get_k8s_state()/group_services_by_health() via a new poll_k8s_state_until_settled(), sharing the exact bucket/settle logic cds state --target helm already uses, instead of a separate helm --wait + per-workload kubectl wait/rollout status loop. - Refactored the shared polling core out of poll_state_until_settled() into a private _poll_until_settled(fetch_grouped_fn) so Compose and Helm both drive the same loop. - Timeout: --timeout is now a single overall budget for helm_up (apply + readiness poll), matching how Compose already treats --timeout as one deadline instead of resetting per workload. - --no-color is now wired through to helm_up's redraw output; --no-build prints an explicit note that it has no effect under --target helm (no build step exists there yet). - namespace/release derivation: down/state now resolve a profile's extends chain and --environment overlay (via a new best-effort resolver that skips full validation, so an already-invalid profile can still be torn down/inspected) through the same _helm_identity() rule up's plan-derived namespace/release already use. Added --environment support to down/state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merges origin/main (#700, #701, #702, #703, #704, #705) into this branch, resolving conflicts in cli/k8s_runner.py::helm_up() and cli/main.py's up/down command dispatch. Keeps this branch's unified lifecycle behavior (deadline-based timeout budget, _helm_identity() release/namespace rule, _k8s_runtime_defaults(..., environment) for down/state) while layering in main's SonarCloud command-argument/path injection hardening (_validate_k8s_name/_validate_kube_context/ _validate_timeout, and .resolve() on chart_dir/log_path). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
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.



Resolves #689.
Summary
Unifies four areas where Compose and Helm lifecycle handling had diverged:
helm_up()now waits for readiness by pollingget_k8s_state()+group_services_by_health()(via newpoll_k8s_state_until_settled()), the exact same functionscds state --target helmuses — instead of Helm's own--waitplus a separate per-workloadkubectl wait/rollout statusloop. Both Compose and Helm now share a single_poll_until_settled()core loop (extracted frompoll_state_until_settled()), so "ready" (up) and "healthy" (state) always agree.--timeoutbudgeting: previously Helm's--timeoutwas applied in full tohelm upgrade --install --waitand again in full to each subsequent per-workload wait, so total wall-clock time could scale with workload count. It's now a single overall deadline shared between the apply step and the readiness poll, matching how Compose already treats--timeout.--no-color/--no-build:--no-coloris now wired through tohelm_up's state redraw output (previously a no-op under--target helm).--no-buildnow prints an explicit note that it has no effect under Helm, since that target doesn't build local images yet (tracked separately in Make cds up --target helm self-contained (build images, prepare cluster, import images) #690).cds down/cds state --target helmpreviously read the raw base profile file only, ignoring bothextendschains and--environmentoverlays — socds up --target helm --environment prodand a latercds down --target helm --environment prodcould target different releases/namespaces if the overlay changedmetadata.name/spec.runtime.namespace.down/statenow resolveextends+--environment(via a new best-effort resolver that deliberately skips full profile validation, so a profile that's since been edited into an invalid state can still be torn down/inspected against its real release) through the same_helm_identity()ruleup's plan already uses. Added--environmentsupport todown/state.Testing
python scripts/run_tests_with_deprecation_gate.py— 862 tests pass, 1 skipped.make lint— clean (ruff, yamllint, markdownlint, renovate config all pass).coverage run -m unittest discover ...— 89% overall coverage oncli/(gate is 80%).Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com