Skip to content

Add release orchestration state to local apply flow#396

Merged
kacy merged 13 commits intomainfrom
feat/release-orchestration-state
Apr 8, 2026
Merged

Add release orchestration state to local apply flow#396
kacy merged 13 commits intomainfrom
feat/release-orchestration-state

Conversation

@kacy
Copy link
Copy Markdown
Owner

@kacy kacy commented Apr 8, 2026

Summary

This PR advances release-orchestration state for local app applies.

It adds richer release states and threads them through the local app release model, then introduces the first real local replacement-apply path instead of treating every apply as a fresh start.

What Changed

  • added partially_failed release status and propagated it through local rolling-update handling
  • generalized local app release persistence so richer final states are stored instead of only completed and failed
  • improved shared apply-report messaging for orchestration states
  • added local app status/history coverage for partially failed releases
  • extracted single-service orchestrator start and stop helpers
  • added local apply scope detection for fresh vs replacement-candidate applies
  • classified selected services into replacement targets vs new targets
  • branched local apply execution:
    • fresh applies still use the existing startAll() path
    • replacement-candidate applies now seed existing running state, start new targets, and stop/start replacement targets
  • refactored replacement execution into smaller helpers and pinned branch selection explicitly

Why

Before this change, release state became richer in the shared model and cluster path, but the local app-apply path still treated every apply as a fresh startup and could not express partial replacement outcomes cleanly.

This closes that gap by giving local apply the minimum orchestration seams and branch logic needed to behave like a replacement flow when services already exist.

Validation

All checks were run serially, one test command at a time, with YOQ_SKIP_SLOW_TESTS=1.

  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='app apply route preserves partially failed release metadata across reads'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='pause failure after cutover becomes partially failed'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='markAppReleaseStatus persists partially failed state'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='materializeMessage defaults are operator friendly for orchestration states'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='appStatusFromReport preserves partially failed local release state'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='historyEntryFromDeployment preserves partially failed local release state'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='PreparedLocalApply detects replacement candidates from existing app containers'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='startServiceByIndex launches a single service thread'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='stopServiceByIndex marks running service stopped without pid'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='PreparedLocalApply classifies replacement and new service indexes'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='syncExistingServiceStates marks selected running services'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='runReplacementPlan counts started and replaced services'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='runReplacementPlan reports partial failure after mutation'
  • zig build test -Doptimize=ReleaseSafe -Dtest-filter='runScopedApply chooses replacement branch for replacement candidates'

Impact

Local app applies now have a clearer release-state model and a real replacement branch, which reduces drift between local and remote orchestration behavior and gives status/history a more accurate view of what happened during local apply.

@kacy kacy marked this pull request as ready for review April 8, 2026 16:42
@kacy kacy merged commit 0a5e8e2 into main Apr 8, 2026
6 of 7 checks passed
@kacy kacy deleted the feat/release-orchestration-state branch April 8, 2026 16:43
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