Skip to content

Commit

Permalink
ci(gitlab logs): Prevent breaking the collapsed sections in gitlab lo…
Browse files Browse the repository at this point in the history
…gs (#32776)
  • Loading branch information
chouetz authored Jan 8, 2025
1 parent 153a1f3 commit 832149a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tasks/libs/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,16 @@ def gitlab_section(section_name, collapsed=False, echo=False):
try:
if in_ci:
collapsed = '[collapsed=true]' if collapsed else ''
print(f"\033[0Ksection_start:{int(time.time())}:{section_id}{collapsed}\r\033[0K{section_name + '...'}")
print(
f"\033[0Ksection_start:{int(time.time())}:{section_id}{collapsed}\r\033[0K{section_name + '...'}",
flush=True,
)
elif echo:
print(color_message(f"> {section_name}...", 'bold'))
yield
finally:
if in_ci:
print(f"\033[0Ksection_end:{int(time.time())}:{section_id}\r\033[0K")
print(f"\033[0Ksection_end:{int(time.time())}:{section_id}\r\033[0K", flush=True)


def retry_function(action_name_fmt, max_retries=2, retry_delay=1):
Expand Down

0 comments on commit 832149a

Please sign in to comment.