-
Notifications
You must be signed in to change notification settings - Fork 26
feat[WIP]: plan freezing #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
9a817c3 to
02f1645
Compare
Signed-off-by: Ilya Drey <ilya.drey@flant.com>
Changelist by BitoThis pull request implements the following key changes.
|
Interaction Diagram by BitosequenceDiagram
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
Critical path: User -> CLI Parser -> ReleasePlanInstallAction -> PlanArtifact -> FileSystem
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. |
There was a problem hiding this 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
- Resource Leak in File Handling · Line 380-381
- Incorrect error message arguments · Line 357-371
Additional Suggestions - 3
-
pkg/action/release_install.go - 1
-
Inconsistent debug logging placement · Line 416-420The 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-287The 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-157The 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
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