Skip to content

Commit 2877ec4

Browse files
committed
Make maximum length values for the executable names which are used in
the Executable sidebar in the Changes, Timeline and Comparision views configurable. This comes handy in scenarios where longer executable names are used (in such scenarios, names might be truncated which makes executable indistinguishable at a glance).
1 parent b362022 commit 2877ec4

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

codespeed/settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@
7878
# ('myexe', '21df2423ra'),
7979
# ('myexe', 'L'),]
8080

81+
TIMELINE_EXECUTABLE_NAME_MAX_LEN = 22 # Maximum length of the executable name used in the
82+
# Changes and Timeline view. If the name is longer, the name
83+
# will be truncated and "..." will be added at the end.
84+
85+
COMPARISON_EXECUTABLE_NAME_MAX_LEN = 20 # Maximum length of the executable name used in the
86+
# Coomparison view. If the name is longer, the name
87+
8188
USE_MEDIAN_BANDS = True # True to enable median bands on Timeline view
8289

8390

codespeed/views_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def getbaselineexecutables():
5858
}]
5959
executables = Executable.objects.select_related('project')
6060
revs = Revision.objects.exclude(tag="").select_related('branch__project')
61-
maxlen = 22
61+
maxlen = getattr(settings, 'TIMELINE_EXECUTABLE_NAME_MAX_LEN', 20)
6262
for rev in revs:
6363
# Add executables that correspond to each tagged revision.
6464
for exe in [e for e in executables if e.project == rev.branch.project]:
@@ -116,7 +116,7 @@ def getcomparisonexes():
116116
for proj in Project.objects.all():
117117
executables = []
118118
executablekeys = []
119-
maxlen = 20
119+
maxlen = getattr(settings, 'COMPARISON_EXECUTABLE_NAME_MAX_LEN', 20)
120120
# add all tagged revs for any project
121121
for exe in baselines:
122122
if exe['key'] != "none" and exe['executable'].project == proj:

0 commit comments

Comments
 (0)