Skip to content

Commit 38bc959

Browse files
committed
batches/ui: add verbose logging to pre-execution phases
Add verbose logging to TUI for batch changes pre-execution steps: - Namespace resolution: show resolved namespace ID - Container images: log successful preparation - Workspace resolution: show workspace/repo counts and unsupported/ignored counts - Cache check: show cached specs and tasks to execute
1 parent d90e43a commit 38bc959

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

internal/batches/ui/tui.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ func (ui *TUI) ResolvingNamespace() {
6363
ui.pending = batchCreatePending(ui.Out, "Resolving namespace")
6464
}
6565

66-
func (ui *TUI) ResolvingNamespaceSuccess(_namespace string) {
66+
func (ui *TUI) ResolvingNamespaceSuccess(namespace string) {
6767
batchCompletePending(ui.pending, "Resolving namespace")
68+
ui.Out.Verbosef("Resolved namespace: %s", namespace)
6869
}
6970

7071
func (ui *TUI) PreparingContainerImages() {
@@ -80,6 +81,7 @@ func (ui *TUI) PreparingContainerImagesProgress(done, total int) {
8081

8182
func (ui *TUI) PreparingContainerImagesSuccess() {
8283
ui.progress.Complete()
84+
ui.Out.Verbosef("Container images prepared successfully")
8385
}
8486

8587
func (ui *TUI) DeterminingWorkspaceCreatorType() {
@@ -104,13 +106,16 @@ func (ui *TUI) DeterminingWorkspaces() {
104106
func (ui *TUI) DeterminingWorkspacesSuccess(workspacesCount, reposCount int, unsupported batches.UnsupportedRepoSet, ignored batches.IgnoredRepoSet) {
105107
batchCompletePending(ui.pending, fmt.Sprintf("Resolved %d workspaces from %d repositories", workspacesCount, reposCount))
106108

109+
ui.Out.Verbosef("Workspace resolution: %d workspaces across %d repositories", workspacesCount, reposCount)
107110
if len(unsupported) != 0 {
111+
ui.Out.Verbosef("Unsupported repositories: %d", len(unsupported))
108112
block := ui.Out.Block(output.Line(" ", output.StyleWarning, "Some repositories are hosted on unsupported code hosts and will be skipped. Use the -allow-unsupported flag to avoid skipping them."))
109113
for repo := range unsupported {
110114
block.Write(repo.Name)
111115
}
112116
block.Close()
113117
} else if len(ignored) != 0 {
118+
ui.Out.Verbosef("Ignored repositories (have .batchignore): %d", len(ignored))
114119
block := ui.Out.Block(output.Line(" ", output.StyleWarning, "The repositories listed below contain .batchignore files and will be skipped. Use the -force-override-ignore flag to avoid skipping them."))
115120
for repo := range ignored {
116121
block.Write(repo.Name)
@@ -163,6 +168,7 @@ func (ui *TUI) CheckingCacheSuccess(cachedSpecsFound int, uncachedTasks int) {
163168
default:
164169
batchCompletePending(ui.pending, fmt.Sprintf("%s; %d tasks need to be executed", specsFoundMessage, uncachedTasks))
165170
}
171+
ui.Out.Verbosef("Cache check: %d cached specs found, %d tasks to execute", cachedSpecsFound, uncachedTasks)
166172
}
167173

168174
func (ui *TUI) ExecutingTasks(verbose bool, parallelism int) executor.TaskExecutionUI {

0 commit comments

Comments
 (0)