Skip to content

Conversation

@drey
Copy link
Contributor

@drey drey commented Feb 2, 2026

Summary by Bito

This PR introduces plan freezing, a new feature that allows saving Helm release installation plans as JSON artifacts and reusing them for subsequent reproducible deployments, reducing computation overhead and ensuring consistent execution.

Detailed Changes
  • Introduces InstallPlanArtifact struct and functions in plan_artifact.go for serializing/deserializing installation plans, including DAG operations and resource changes.
  • Adds JSON tags to operation config structs in operation_config.go and related files to enable serialization, with special handling for regex fields in track-readiness operations.
  • Updates CLI commands in release_install.go and release_plan_install.go to add flags for specifying plan artifact file paths.
  • Integrates plan artifact loading and validation logic in release_install.go to use pre-built plans when provided, bypassing plan recalculation.
  • Adds plan saving functionality in release_plan_install.go and common.go to export computed plans as JSON artifacts.

Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@drey drey force-pushed the feat/nelm-plan-freezing branch from 9a817c3 to 02f1645 Compare February 2, 2026 09:39
@drey drey changed the title feat: plan freezing feat[WIP]: plan freezing Feb 2, 2026
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
@bito-code-review
Copy link

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted Summary
New Feature - Plan Freezing
Introduces plan freezing functionality to save and load installation plans as JSON artifacts for reproducible deployments.

@bito-code-review
Copy link

Interaction Diagram by Bito
sequenceDiagram
participant User
    participant CLI Parser
participant ReleaseInstallAction
participant ReleasePlanInstallAction
participant PlanArtifact
participant OperationConfig
participant FileSystem
alt Plan and Save Artifact
        User->>CLI Parser: nelm release plan install --out plan.json
        CLI Parser->>ReleasePlanInstallAction: Execute plan install with PlanArtifactPath
ReleasePlanInstallAction->>PlanArtifact: Create install plan artifact
PlanArtifact->>OperationConfig: Serialize operation configs with JSON tags
ReleasePlanInstallAction->>FileSystem: Save plan artifact to file
FileSystem-->>ReleasePlanInstallAction: Plan saved successfully
else Load and Execute Artifact
        User->>CLI Parser: nelm release install --plan-file plan.json
        CLI Parser->>ReleaseInstallAction: Execute install with PlanArtifactPath
ReleaseInstallAction->>FileSystem: Load plan artifact from file
FileSystem-->>ReleaseInstallAction: Return plan artifact data
ReleaseInstallAction->>PlanArtifact: Deserialize plan artifact
PlanArtifact->>OperationConfig: Deserialize operation configs from JSON
ReleaseInstallAction->>ReleaseInstallAction: Execute installation using deserialized plan
    end
Loading

Critical path: User -> CLI Parser -> ReleasePlanInstallAction -> PlanArtifact -> FileSystem

Note: The merge request adds support for saving and loading installation plan artifacts, enabling separation of planning and execution phases in CI/CD pipelines. New CLI flags (--plan-file for install, --out for plan install) allow users to persist plans to files and load pre-built plans for installation. Operation configuration structs now include JSON serialization tags to support artifact persistence and data transformation between internal representations and external storage formats.

If the interaction diagram doesn't appear, refresh the page to render it.

You can disable interaction diagrams by customizing agent settings. Refer to documentation.

Copy link

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #b43e67

Actionable Suggestions - 2
  • internal/plan/plan_artifact.go - 2
Additional Suggestions - 3
  • pkg/action/release_install.go - 1
    • Inconsistent debug logging placement · Line 416-420
      The debug log 'Build resource infos' was removed from before the BuildResourceInfos call (around line 418) and added after the plan artifact handling (line 471). This creates inconsistent logging: the log appears only when PlanArtifactPath is set, and in the wrong location. It looks like the log should consistently appear before building resource infos, regardless of the artifact path. If the intent was different, consider updating the log text to 'Use install plan from artifact' or similar.
  • pkg/action/common.go - 1
    • Inconsistent file permissions · Line 287-287
      The file permissions for os.WriteFile are set to 0o644, but other save functions in this file (saveReport and savePlanAsDot) use 0o600. For consistency and to restrict read access to the owner only, consider using 0o600 here as well.
      Code suggestion
       @@ -287,1 +287,1 @@
      -if err := os.WriteFile(path, jsonData, 0o644); err != nil {
      +if err := os.WriteFile(path, jsonData, 0o600); err != nil {
  • pkg/action/release_plan_install.go - 1
    • Documentation Reference Issue · Line 157-157
      The comment states the JSON schema is defined by ADR-0001, but this ADR does not appear in the repository or available documentation. If ADR-0001 exists elsewhere, please update the comment with the correct reference.
Review Details
  • Files reviewed - 11 · Commit Range: 02f1645..4b80e41
    • cmd/nelm/release_install.go
    • cmd/nelm/release_plan_install.go
    • internal/plan/operation_config.go
    • internal/plan/plan_artifact.go
    • internal/plan/planned_changes.go
    • internal/resource/spec/resource_meta.go
    • internal/resource/spec/resource_spec.go
    • pkg/action/common.go
    • pkg/action/release_install.go
    • pkg/action/release_plan_install.go
    • pkg/common/common.go
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Golangci-lint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at ilya.lesikov@flant.com.

Documentation & Help

AI Code Review powered by Bito Logo

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.

2 participants