Skip to content

feat: send untouched resource info to legacy progress reporter - #664

Open
dmmordvi wants to merge 15 commits into
mainfrom
feat/send-unmodified-resources-to-reporter
Open

feat: send untouched resource info to legacy progress reporter#664
dmmordvi wants to merge 15 commits into
mainfrom
feat/send-unmodified-resources-to-reporter

Conversation

@dmmordvi

@dmmordvi dmmordvi commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review in cubic

dmmordvi added 10 commits July 21, 2026 23:27
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
…kipped

Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>

@dmmordvi dmmordvi left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review (3 findings, all MINOR — no blockers). The PR is correct and ready to merge; the two potentially serious points below are accepted as deliberate.

Findings not anchorable to the diff:
pkg/plan/legacy_progress_reporter_ai_test.go:— No test covers the real main→failure/rollback scenario where the full instResInfos is re-passed as untouched into a second StartStage; only the nil-untouched case is covered by TestAI_StartStage_UntouchedScopedToStageAndFrozen. Recommend adding a scenario test that pins the expected re-emission behavior so regressions become visible. (generated by pi-pi)

Comment thread pkg/action/common.go
LegacyProgressReporter: opts.LegacyProgressReporter,
TrackingOptions: opts.TrackingOptions,
NetworkParallelism: opts.NetworkParallelism,
InstallableResourceInfos: installableInfos,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The full original installableInfos is passed into the failure plan, so every install resource still present in the cluster is re-emitted as NoOp/Completed in a stage where it is not an operation of that plan. This diverges from the StageReport doc contract ("ALL operations in the plan"). If this is intended (giving the consumer the full picture), consider clarifying the StageReport doc comment to mention these NoOp pseudo-operations.
(generated by pi-pi)

Comment thread pkg/legacy/progrep/progress_report.go
dmmordvi added 3 commits July 23, 2026 10:22
Add TestAI_StartStage_UntouchedReemittedAcrossStages, which drives startStage
twice with the same non-empty untouched inventory (modeling the full
instResInfos passed into a second stage on main→failure/rollback). Verifies the
unchanged resource is re-emitted as Completed/NoOp in the new active stage,
retained in the frozen prior stage, and not duplicated when its ObjectRef
matches a plan operation of the second stage.

Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
… skipped

Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>

@dmmordvi dmmordvi left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review pass (pi-pi). One new MINOR finding below. A prior review already flagged the OperationTypeNoOp wire-compatibility concern on pkg/legacy/progrep/progress_report.go:16, so it is not re-posted here.

})
}

for _, info := range untouched {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A resource with real drift can reach this NoOp/Completed branch. resourceInstallType() returns ResourceInstallTypeNone not only when the live and dry-apply states match, but also when a resource policy (skip-update / skip-create / skip-recreate) forces None despite an actual diff (skippedByPolicy=true). Such a resource produces no plan operation (and mustTrackReadiness is false), so it flows into this loop and is reported as NoOp/Completed. That reads as "unchanged" to the user even though the resource actually differs from the desired state and was only skipped by policy. This is display-only in the legacy progress reporter (deploy behavior is unaffected), but the label is misleading; consider distinguishing "skipped by policy" from "unchanged".
(generated by pi-pi)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We return NoOp type, so it is enough

dmmordvi added 2 commits July 23, 2026 12:16
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
Signed-off-by: Dmitry Mordvinov <dmitry.mordvinov@flant.com>
@dmmordvi
dmmordvi requested a review from ilya-lesikov July 23, 2026 09:37
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