refactor(flow): Track current operation run phase#3458
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (20)
🚧 Files skipped from review as they are similar to previous changes (18)
Summary by CodeRabbit
WalkthroughOperation runs now persist ChangesPhase-aware operation runs
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Dispatcher
participant PostgresStore
participant TargetPhaseSummary
Dispatcher->>PostgresStore: LockOperationRunTargets(runID, currentPhaseIndex)
Dispatcher->>PostgresStore: GetTargetPhaseAggregate(runID, currentPhaseIndex)
PostgresStore-->>Dispatcher: Current-phase targets and completed-phase aggregate
Dispatcher->>TargetPhaseSummary: NewTargetPhaseSummary(currentPhaseIndex, aggregate, targets)
TargetPhaseSummary-->>Dispatcher: Phase terminality and status counts
Dispatcher->>PostgresStore: UpdateRunState(CurrentPhaseIndex)
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-07-13 23:07:34 UTC | Commit: de804c9 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rest-api/flow/internal/operationrun/manager/dispatcher/reconciliation.go (1)
36-59: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueDrop the unused reconciliation summary
reconcileTargetsnever populatesreconciliationSummary;preparedDispatch.summaryis assembled later fromGetTargetPhaseAggregate, so this return value is dead weight. Returning only the error would make the ownership clearer.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rest-api/flow/internal/operationrun/manager/dispatcher/reconciliation.go` around lines 36 - 59, Update reconcileTargets to stop creating and returning the unused reconciliationSummary; change its return contract to only report errors, and adjust its callers such as preparedDispatch to remove summary handling while preserving the existing GetTargetPhaseAggregate-based summary assembly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@rest-api/flow/internal/operationrun/manager/dispatcher/reconciliation.go`:
- Around line 36-59: Update reconcileTargets to stop creating and returning the
unused reconciliationSummary; change its return contract to only report errors,
and adjust its callers such as preparedDispatch to remove summary handling while
preserving the existing GetTargetPhaseAggregate-based summary assembly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 4b0b1eb5-54ea-4b7f-a072-3cfd422368a6
📒 Files selected for processing (20)
rest-api/flow/internal/converter/dao/converter.gorest-api/flow/internal/db/migrations/20260713000000_operation_run_current_phase_index.down.sqlrest-api/flow/internal/db/migrations/20260713000000_operation_run_current_phase_index.up.sqlrest-api/flow/internal/db/model/operation_run.gorest-api/flow/internal/operationrun/manager/dispatcher/decision.gorest-api/flow/internal/operationrun/manager/dispatcher/dependencies.gorest-api/flow/internal/operationrun/manager/dispatcher/dispatcher_test.gorest-api/flow/internal/operationrun/manager/dispatcher/phase.gorest-api/flow/internal/operationrun/manager/dispatcher/preparation.gorest-api/flow/internal/operationrun/manager/dispatcher/reconciliation.gorest-api/flow/internal/operationrun/manager/manager_test.gorest-api/flow/internal/operationrun/manager/manual_controls.gorest-api/flow/internal/operationrun/manager/store.gorest-api/flow/internal/operationrun/manager/store/dispatch.gorest-api/flow/internal/operationrun/manager/store/store.gorest-api/flow/internal/operationrun/manager/store/store_test.gorest-api/flow/internal/operationrun/operationrun.gorest-api/flow/internal/operationrun/progress.gorest-api/flow/internal/operationrun/progress_test.gorest-api/flow/internal/operationrun/stats.go
- Track current operation run phase index in operation run table so that the dipatcher needs to lock the targets in the current phase only.
de804c9 to
230d598
Compare
|
🌿 Preview your docs: https://nvidia-preview-pull-request-3458.docs.buildwithfern.com/infra-controller |
Related issues
Type of Change
Breaking Changes
Testing
Additional Notes