-
Notifications
You must be signed in to change notification settings - Fork 6
fix(OPENFRAM-007): CU-86akbhhau 5 review findings across 4 files #379
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?
Changes from all commits
5744850
9f14fcc
3accfdc
58ebfeb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,9 @@ func (a *AppOfApps) Install(ctx context.Context, config config.ChartInstallConfi | |
| // wording read as if it reflected the cluster's current ref, which made a | ||
| // dry-run against a cluster on another ref confusing (verification report, | ||
| // minor observation). | ||
| pterm.Info.Printf("Deploying ref '%s'...\n", appConfig.GitHubBranch) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π AppOfApps.Install uses pterm.Info.Printf directly instead of a silence-aware wrapper for the ref message In AppOfApps.Install (internal/chart/services/appofapps.go), wrapped the π€ Prompt for AI agentsfix confidence: π΄ 55 low β review closely β react π/π to teach the reviewer |
||
| if !config.Silent { | ||
| pterm.Info.Printf("Deploying ref '%s'...\n", appConfig.GitHubBranch) | ||
| } | ||
|
|
||
| // Clone the repository to a temporary directory. On a cold cache this is a | ||
| // full clone over the network and used to run without any indicator. | ||
|
|
@@ -120,3 +122,4 @@ func (a *AppOfApps) IsInstalled(ctx context.Context, namespace string) (bool, er | |
| func (a *AppOfApps) GetStatus(ctx context.Context, namespace string) (models.ChartInfo, error) { | ||
| return a.helmManager.GetChartStatus(ctx, "app-of-apps", namespace) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ import ( | |
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/pterm/pterm" | ||
|
|
||
| sharedconfig "github.com/flamingo-stack/openframe-cli/internal/shared/config" | ||
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| "k8s.io/client-go/kubernetes" | ||
|
|
@@ -46,7 +48,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| } | ||
|
|
||
| if m.verbose { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π verify.go uses raw fmt.Printf/fmt.Println for user-facing verbose output instead of pterm/ui helpers Replaced raw fmt.Printf/fmt.Println calls in verifyClusterReachable (lines with context switch confirmation, TLS bypass notice, host:port extraction warning, and the node-readiness retry loop) with pterm.Success/pterm.Info/pterm.Warning printers (pterm.Success.Printfln, pterm.Info.Printfln, pterm.Warning.Printfln, etc.), all still gated by π€ Prompt for AI agentsfix confidence: π‘ 60 medium β react π/π to teach the reviewer |
||
| fmt.Printf("β Switched kubectl context to %s\n", contextName) | ||
| pterm.Success.Printfln("Switched kubectl context to %s", contextName) | ||
| } | ||
|
|
||
| // Build rest.Config from the loaded Kubeconfig | ||
|
|
@@ -66,7 +68,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| restConfig = sharedconfig.ApplyInsecureTLSConfig(restConfig) | ||
|
|
||
| if m.verbose { | ||
| fmt.Println("β TLS verification bypassed for local k3d cluster (Insecure=true, auth preserved)") | ||
| pterm.Success.Println("TLS verification bypassed for local k3d cluster (Insecure=true, auth preserved)") | ||
| } | ||
|
|
||
| // --- PHASE 2: Verify Network Connectivity and Update Endpoint --- | ||
|
|
@@ -75,7 +77,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| host, port, err := extractHostPort(restConfig.Host) | ||
| if err != nil { | ||
| if m.verbose { | ||
| fmt.Printf("Warning: Could not extract host:port from %s: %v\n", restConfig.Host, err) | ||
| pterm.Warning.Printfln("Could not extract host:port from %s: %v", restConfig.Host, err) | ||
| } | ||
| // Default to 127.0.0.1:6550 for k3d | ||
| host = "127.0.0.1" | ||
|
|
@@ -105,7 +107,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| var lastErr error | ||
|
|
||
| if m.verbose { | ||
| fmt.Println("Waiting for cluster API and nodes to be reachable...") | ||
| pterm.Info.Println("Waiting for cluster API and nodes to be reachable...") | ||
| } | ||
|
|
||
| for i := 0; i < maxRetries; i++ { | ||
|
|
@@ -123,7 +125,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| if isTemporaryError(err) { | ||
| lastErr = err | ||
| if m.verbose { | ||
| fmt.Printf(" Cluster not ready yet (attempt %d/%d): %v\n", i+1, maxRetries, err) | ||
| pterm.Info.Printfln(" Cluster not ready yet (attempt %d/%d): %v", i+1, maxRetries, err) | ||
| } | ||
| time.Sleep(retryDelay) | ||
| continue | ||
|
|
@@ -136,7 +138,7 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| if len(nodes.Items) == 0 { | ||
| lastErr = fmt.Errorf("no nodes found in cluster") | ||
| if m.verbose { | ||
| fmt.Printf(" No nodes found yet (attempt %d/%d), waiting...\n", i+1, maxRetries) | ||
| pterm.Info.Printfln(" No nodes found yet (attempt %d/%d), waiting...", i+1, maxRetries) | ||
| } | ||
| time.Sleep(retryDelay) | ||
| continue | ||
|
|
@@ -157,15 +159,15 @@ func (m *K3dManager) verifyClusterReachable(ctx context.Context, clusterName str | |
| // Success condition: Nodes exist and at least one is ready | ||
| if readyCount > 0 { | ||
| if m.verbose { | ||
| fmt.Printf(" Found %d ready node(s) out of %d total\n", readyCount, len(nodes.Items)) | ||
| fmt.Println("β Cluster API and nodes are ready.") | ||
| pterm.Info.Printfln(" Found %d ready node(s) out of %d total", readyCount, len(nodes.Items)) | ||
| pterm.Success.Println("Cluster API and nodes are ready.") | ||
| } | ||
| return restConfig, nil | ||
| } | ||
|
|
||
| lastErr = fmt.Errorf("no nodes in Ready state (found %d nodes, 0 ready)", len(nodes.Items)) | ||
| if m.verbose { | ||
| fmt.Printf(" Nodes exist but none are Ready yet (attempt %d/%d), waiting...\n", i+1, maxRetries) | ||
| pterm.Info.Printfln(" Nodes exist but none are Ready yet (attempt %d/%d), waiting...", i+1, maxRetries) | ||
| } | ||
| time.Sleep(retryDelay) | ||
| } | ||
|
|
@@ -194,7 +196,7 @@ func (m *K3dManager) waitForTCPPort(ctx context.Context, host string, port strin | |
| address := net.JoinHostPort(host, port) | ||
|
|
||
| if m.verbose { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π waitForTCPPort emits raw fmt.Printf for progress instead of using pterm Replaced fmt.Printf calls in waitForTCPPort (the "Waiting for TCP port..." message, the "TCP port %s is open" success message, and the retry-attempt message) with pterm.Info.Printfln and pterm.Success.Printfln, preserving the existing π€ Prompt for AI agentsfix confidence: π‘ 60 medium β react π/π to teach the reviewer |
||
| fmt.Printf("Waiting for TCP port %s to be available...\n", address) | ||
| pterm.Info.Printfln("Waiting for TCP port %s to be available...", address) | ||
| } | ||
|
|
||
| var lastErr error | ||
|
|
@@ -212,14 +214,14 @@ func (m *K3dManager) waitForTCPPort(ctx context.Context, host string, port strin | |
| if err == nil { | ||
| _ = conn.Close() | ||
| if m.verbose { | ||
| fmt.Printf("β TCP port %s is open\n", address) | ||
| pterm.Success.Printfln("TCP port %s is open", address) | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| lastErr = err | ||
| if m.verbose { | ||
| fmt.Printf(" TCP port not ready yet (attempt %d/%d): %v\n", i+1, maxRetries, err) | ||
| pterm.Info.Printfln(" TCP port not ready yet (attempt %d/%d): %v", i+1, maxRetries, err) | ||
| } | ||
| time.Sleep(retryDelay) | ||
| } | ||
|
|
@@ -301,8 +303,9 @@ func (m *K3dManager) cleanupStaleLockFiles(ctx context.Context) error { | |
| } | ||
|
|
||
| if m.verbose { | ||
| fmt.Println("β Cleaned up stale kubeconfig lock files") | ||
| pterm.Success.Println("Cleaned up stale kubeconfig lock files") | ||
| } | ||
|
|
||
| return nil | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,7 +274,7 @@ func (ws *WizardSteps) ConfirmConfiguration(config models.ClusterConfig) (bool, | |
| if i == 0 { | ||
| continue // Skip header | ||
| } | ||
| println(row[0] + ": " + row[1]) | ||
| pterm.Info.Printf("%s: %s\n", row[0], row[1]) | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
274
to
280
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 𦩠π Raw println() used as fallback instead of pterm-based output Replaced the raw π€ Prompt for AI agentsfix confidence: π’ 95 high β react π/π to teach the reviewer |
||
|
|
||
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.
𦩠π Raw pterm.Info.Println/Printf calls bypass silent-mode gating in HelmManager
In
InstallArgoCDWithProgress(internal/chart/providers/helm/manager.go), changed theelsebranch that unconditionally calledpterm.Info.Println("Installing ArgoCD...")toelse if !config.Silent, so the message is now only printed in non-interactive-but-not-silent mode, and fully suppressed whenconfig.Silentis true β matching the suggested fix exactly and respecting the --silent flag per OPENFRAM-007.π€ Prompt for AI agents
fix confidence: π’ 90 high β react π/π to teach the reviewer