Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent UnifiedTreeBuilder producing step names over 50 characters in length #293

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions zorg/buildbot/builders/UnifiedTreeBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,15 @@ def addNinjaSteps(
step_name = "build-{}unified-tree".format(step_name)
step_description.extend(["unified", "tree"])

# Helper to for use truncating step names to 50 chars, needed due to
# <https://github.com/buildbot/buildbot/issues/3414>.
def trunc50(name):
if len(name) > 50:
return name[:47] + "..."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to suggest f"{s:.47s}..." but this adds ... regardless of length, so don't do that.

Just mentioning that in case someone else was thinking of that.

return name

# Build the unified tree.
f.addStep(NinjaCommand(name=step_name,
f.addStep(NinjaCommand(name=trunc50(step_name),
haltOnFailure=True,
targets=targets,
description=step_description,
Expand All @@ -223,7 +230,7 @@ def addNinjaSteps(
check_env = env or {}

for check in checks:
f.addStep(LitTestCommand(name="test-%s-%s" % (step_name, check),
f.addStep(LitTestCommand(name=trunc50("test-%s-%s" % (step_name, check)),
command=['ninja', check],
description=[
"Test", "just", "built", "components", "for",
Expand All @@ -237,7 +244,7 @@ def addNinjaSteps(
# Install just built components
if install_dir:
# TODO: Run this step only if none of the prevous failed.
f.addStep(NinjaCommand(name="install-%sall" % step_name,
f.addStep(NinjaCommand(name=trunc50("install-%sall" % step_name),
targets=["install"],
description=["Install", "just", "built", "components"],
env=env or {},
Expand Down