docs: update PLAN.md with completed phase status

pull/31991/head
caretak3r 8 months ago
parent 7550e7296d
commit ae29473779
No known key found for this signature in database
GPG Key ID: 9A0DD6E91D0288EC

@ -1,84 +1,84 @@
# PLAN.md — worktree/1: HIP-0025 Foundation (Chart Metadata + DAG) # PLAN.md — worktree/1: HIP-0025 Subchart Sequencing (Full Stack)
## Context ## Context
HIP-0025 introduces native resource and subchart sequencing to Helm v4. HIP-0025 introduces native resource and subchart sequencing to Helm v4.
This worktree implements the **foundation layer**: chart metadata extensions This worktree implements the complete subchart sequencing pipeline: chart metadata,
and DAG construction needed before action/CLI integration. DAG engine, CLI flag, action layer integration, and release storage.
**Spec source:** `hip-0025/hip-0025.md`, `hip-0025/subchart-sequencing.md` **Spec source:** `hip-0025/hip-0025.md`, `hip-0025/subchart-sequencing.md`
## Scope (this branch) ## Delivered
### 1. Chart Metadata Extension — `DependsOn` field ### Phase 2: Chart Metadata Extension — DONE
- Add `DependsOn []string` to `Dependency` struct in both v2 and v3 - `DependsOn []string` field on v2 + v3 `Dependency` struct
- Supports `depends-on` YAML key in Chart.yaml dependencies list - Sanitization in `Validate()`
- Add validation: each DependsOn entry must reference a known dependency name/alias - Files: `pkg/chart/v2/dependency.go`, `internal/chart/v3/dependency.go`
- Sanitize DependsOn strings in `Validate()`
### Phase 3: DAG Construction & Topo Sort — DONE
**Files:** - DAG struct: AddNode, AddEdge, DetectCycles, TopologicalSort, Batches
- `pkg/chart/v2/dependency.go` — add field + validation - `BuildSubchartDAG` combines DependsOn field + annotation parsing
- `internal/chart/v3/dependency.go` — add field + validation - `ParseDependsOnSubcharts` for `helm.sh/depends-on/subcharts` annotation
- Annotation constants for resource-group sequencing (future use)
### 2. Annotation Parsing — `helm.sh/depends-on/subcharts` - Files: `pkg/chart/v2/util/dag.go`, `pkg/chart/v2/util/sequencing.go` (+ v3 mirrors)
- Parse `helm.sh/depends-on/subcharts` from `Metadata.Annotations`
- Already available: `Annotations map[string]string` exists on both v2/v3 Metadata ### Phase 4: WaitStrategy Extension — DONE
- Utility function to extract and parse the annotation value (JSON array of strings) - `OrderedStrategy WaitStrategy = "ordered"` constant
- Delegates to StatusWatcher for readiness checks
**Files:** - CLI accepts `--wait=ordered`
- New: `pkg/chart/v2/util/sequencing.go` — annotation constants, parse helpers - Files: `pkg/kube/client.go`, `pkg/cmd/flags.go`
- New: `internal/chart/v3/util/sequencing.go` — v3 variant
### Phase 5: Action System Integration — DONE
### 3. DAG Construction & Topological Sort - `performOrderedInstall`: deploy resources in DAG batch order
- Build subchart dependency graph from: - `SplitManifestsBySubchart`: partition manifest by `# Source:` comments
- `Dependency.DependsOn` field entries - `BuildInstallBatches`: compute ordered batches from chart metadata
- `Metadata.Annotations["helm.sh/depends-on/subcharts"]` entries - `createAndWaitResources`: extracted helper for create+wait
- Topological sort → produce ordered batches (layers) - Falls back to all-at-once when no sequencing metadata exists
- Circular dependency detection with clear error messages - Files: `pkg/action/install.go`, `pkg/action/sequencing.go`
- Orphaned subchart handling (no deps → deployed with parent in final batch)
### Phase 6: CLI Integration — DONE (bundled with Phase 4)
**Files:** - `--wait=ordered` accepted alongside watcher/hookOnly/legacy
- New: `pkg/chart/v2/util/dag.go` — DAG struct, AddNode, AddEdge, TopologicalSort, DetectCycles - Error messages updated to include ordered option
- New: `internal/chart/v3/util/dag.go` — v3 variant (or shared via common)
### Phase 7: Release Storage — DONE
### 4. Integration with ProcessDependencies - `SequencingMetadata` struct: enabled, strategy, batches
- After existing enable/disable logic, build subchart DAG - Persisted in `Release.Sequencing` during ordered install
- Validate DAG (no cycles, all DependsOn refs resolve) - Enables rollback/uninstall to reconstruct deployment order
- Attach DAG to chart processing result for downstream use - Files: `pkg/release/v1/release.go`
**Files:** ## Test Coverage
- `pkg/chart/v2/util/dependencies.go` — add DAG building after ProcessDependencies
- `internal/chart/v3/util/dependencies.go` — same - 10 DAG unit tests (empty, single, linear, diamond, parallel, cycles, self-dep, orphans, complex)
- 7 annotation parsing tests (nil, empty, valid, invalid JSON, etc.)
### 5. Tests - 6 BuildSubchartDAG tests (HIP-0025 example, aliases, cycles, unknown refs)
- Unit tests for DependsOn parsing and validation - 7 action sequencing tests (manifest splitting, batch construction, circular deps)
- Unit tests for DAG construction (linear, diamond, parallel, orphan patterns) - All existing tests pass — zero regressions
- Unit tests for circular dependency detection
- Unit tests for annotation parsing ## Commits
- Integration test with chart fixtures
```
**Files:** 01fdc96b feat(chart): add DependsOn field and DAG engine for HIP-0025
- `pkg/chart/v2/util/dag_test.go` c8a23f04 feat(kube): add OrderedStrategy WaitStrategy for HIP-0025
- `pkg/chart/v2/util/sequencing_test.go` 1e79330b feat(action): implement ordered subchart install for HIP-0025
- `pkg/chart/v2/dependency_test.go` (extend existing) 7550e729 feat(release): store sequencing metadata in Release
## Verification
```bash
make test-unit # Full unit test suite
go test ./pkg/chart/v2/... # Chart v2 tests
go test ./pkg/chart/v2/util/... # DAG + sequencing tests
go test ./internal/chart/v3/... # Chart v3 tests
make test-style # Linting
``` ```
## Remaining (future worktrees)
- Resource-group sequencing (within single chart)
- Custom readiness evaluation (helm.sh/readiness-success/failure + JSONPath)
- Upgrade ordered sequencing
- Uninstall/rollback reverse-order logic
- `helm template` ordered output with START/END resource-group comments
- Readiness timeout flag (--readiness-timeout)
## bd Issues ## bd Issues
| ID | Phase | Status | | ID | Phase | Status |
|----|-------|--------| |----|-------|--------|
| helm-btq | Phase 2: Chart Metadata | in-progress | | helm-btq | Phase 2: Chart Metadata | done |
| helm-ed3 | Phase 3: DAG Construction | blocked-by helm-btq | | helm-ed3 | Phase 3: DAG Construction | done |
| helm-40n | Phase 4: WaitStrategy | future worktree | | helm-40n | Phase 4: WaitStrategy | done |
| helm-fby | Phase 5: Action System | future worktree | | helm-fby | Phase 5: Action System | done |
| helm-0d5 | Phase 6: CLI | future worktree | | helm-0d5 | Phase 6: CLI | done |
| helm-7an | Phase 7: Release Storage | future worktree | | helm-7an | Phase 7: Release Storage | done |

Loading…
Cancel
Save