Skip to content

Commit

Permalink
Add support for showing in-progress builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
cboos committed Apr 27, 2010
1 parent 7079024 commit e17bc42
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions HudsonTrac/HudsonTracPlugin.py
Expand Up @@ -61,6 +61,8 @@ class HudsonTracPlugin(Component):
Whether to display the build descriptions for each build
instead of the canned "Build finished successfully etc."
messages.""")
display_building = BoolOption('hudson', 'display_building', False,
'Also show in-progress builds (pulsating green ball)')

def __init__(self):
api_url = unicode_quote(self.job_url, '/%:@')
Expand Down Expand Up @@ -184,21 +186,26 @@ def get_number(parent, child):
for entry in info.documentElement.getElementsByTagName("build"):
# ignore builds that are still running
if get_string(entry, 'building') == 'true':
continue
if not self.display_building:
continue
else:
result = 'INPROGRESS'
else:
result = get_string(entry, 'result')

# create timeline entry
started = get_number(entry, 'timestamp')
completed = started + get_number(entry, 'duration')
started /= 1000
completed /= 1000

result = get_string(entry, 'result')
message, kind = {
'SUCCESS': ('Build finished successfully',
('build-successful',
'build-successful-alt')[self.alt_succ]),
'UNSTABLE': ('Build unstable', 'build-unstable'),
'ABORTED': ('Build aborted', 'build-aborted'),
'INPROGRESS': ('Build in progress', 'build-inprogress'),
}.get(result, ('Build failed', 'build-failed'))

if self.use_desc:
Expand Down
1 change: 1 addition & 0 deletions HudsonTrac/htdocs/hudsontrac.css
Expand Up @@ -3,3 +3,4 @@ dt.build-successful-alt a { background-image: url(success-alt.gif) !important }
dt.build-failed a { background-image: url(failed.gif) !important }
dt.build-aborted a { background-image: url(aborted.gif) !important }
dt.build-unstable a { background-image: url(unstable.gif) !important }
dt.build-inprogress a { background-image: url(inprogress.gif) !important }
Binary file added HudsonTrac/htdocs/inprogress.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e17bc42

Please sign in to comment.