Skip to content

Commit e725ae0

Browse files
committed
(alpha update) fix make run logic in merge
Alpha update will now run the make targets ONLY if the merge is completed without conflicts.
1 parent 83e9ed7 commit e725ae0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pkg/cli/alpha/internal/update/update.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,18 +346,20 @@ func (opts *Update) mergeOriginalToUpgrade() error {
346346
return fmt.Errorf("merge stopped due to conflicts")
347347
}
348348
log.Warn("Merge completed with conflicts. Conflict markers will be committed.")
349+
log.Warn("After resolving the conflicts, run the following command:")
350+
log.Warn(" make manifests generate fmt vet lint-fix")
351+
log.Warn("This ensures manifests and generated files are up to date, and the project layout remains consistent.")
349352
} else {
350353
return fmt.Errorf("merge failed unexpectedly: %w", err)
351354
}
352355
}
353356

354357
if !hasConflicts {
355358
log.Info("Merge happened without conflicts.")
359+
// Best effort to run make targets to ensure the project is in a good state
360+
runMakeTargets()
356361
}
357362

358-
// Best effort to run make targets to ensure the project is in a good state
359-
runMakeTargets()
360-
361363
// Step 4: Stage and commit
362364
if err := exec.Command("git", "add", "--all").Run(); err != nil {
363365
return fmt.Errorf("failed to stage merge results: %w", err)

0 commit comments

Comments
 (0)