Replace file_suffix with file_name (but keep vairable name for backwards compatibility), Add path to Azure Blob, remove defaulted {workflow_run_id} (#3557)

This commit is contained in:
Shuchang Zheng
2025-09-29 19:30:21 -07:00
committed by GitHub
parent 7afb5190a6
commit 38a9ad2a6b
14 changed files with 113 additions and 26 deletions

View File

@@ -538,11 +538,14 @@ class ForgeAgent:
)
continue
random_file_id = "".join(random.choices(string.ascii_uppercase + string.digits, k=4))
random_file_name = f"download-{datetime.now().strftime('%Y%m%d%H%M%S%f')}-{random_file_id}"
if task_block.download_suffix:
random_file_name = f"{random_file_name}-{task_block.download_suffix}"
rename_file(os.path.join(workflow_download_directory, file), random_file_name + file_extension)
# Use download_suffix as the complete filename (without extension)
final_file_name = task_block.download_suffix
else:
# Fallback to random filename if no download_suffix provided
random_file_id = "".join(random.choices(string.ascii_uppercase + string.digits, k=4))
final_file_name = f"download-{datetime.now().strftime('%Y%m%d%H%M%S%f')}-{random_file_id}"
rename_file(os.path.join(workflow_download_directory, file), final_file_name + file_extension)
LOG.info(
"Task marked as completed due to download",