Skip to content

Commit 0e9c0c7

Browse files
sjarmakclaude
andcommitted
fix: promote_run.py handle Harbor Layout v3 (ccb_suite_task_config dirs)
find_task_dirs() only recognized Layout v1 (task__hash) and Layout v2 (timestamp/task__hash). Harbor also creates Layout v3 where task dirs are nested under ccb_suite_taskname_configname/ directories. This caused promote to report 0 tasks for recent Daytona-launched batches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 44045f1 commit 0e9c0c7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

scripts/promote_run.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ def should_skip(name: str) -> bool:
101101

102102

103103
def find_task_dirs(config_path: Path) -> list[Path]:
104-
"""Find task directories, handling both layouts.
104+
"""Find task directories, handling all Harbor layouts.
105105
106106
Layout v1: config/task_name__hash/result.json
107107
Layout v2: config/batch_timestamp/task_name__hash/result.json
108+
Layout v3: config/ccb_suite_taskname_configname/task_name__hash/result.json
108109
"""
109110
task_dirs = []
110111
if not config_path.is_dir():
@@ -116,14 +117,19 @@ def find_task_dirs(config_path: Path) -> list[Path]:
116117
if not entry.is_dir() or should_skip(entry.name):
117118
continue
118119

119-
if batch_ts_re.match(entry.name):
120+
if "__" in entry.name:
121+
# Layout v1: direct task dir (task_name__hash)
122+
task_dirs.append(entry)
123+
elif batch_ts_re.match(entry.name):
120124
# Layout v2: batch timestamp dir — look inside for task dirs
121125
for sub in sorted(entry.iterdir()):
122126
if sub.is_dir() and "__" in sub.name and not should_skip(sub.name):
123127
task_dirs.append(sub)
124-
elif "__" in entry.name:
125-
# Layout v1: direct task dir
126-
task_dirs.append(entry)
128+
else:
129+
# Layout v3: Harbor batch dir (ccb_suite_task_config) — look inside
130+
for sub in sorted(entry.iterdir()):
131+
if sub.is_dir() and "__" in sub.name and not should_skip(sub.name):
132+
task_dirs.append(sub)
127133

128134
return task_dirs
129135

0 commit comments

Comments
 (0)