Skip to content

Commit

Permalink
Merge branch 'master' into nine
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Jun 5, 2013
2 parents 20d4af7 + 1b52566 commit 210a963
Show file tree
Hide file tree
Showing 89 changed files with 28,309 additions and 72 deletions.
3 changes: 2 additions & 1 deletion master/buildbot/__init__.py
Expand Up @@ -37,7 +37,8 @@

try:
dir = os.path.dirname(os.path.abspath(__file__))
p = Popen(['git', 'describe', '--tags', '--always'], cwd=dir, stdout=PIPE, stderr=PIPE)
p = Popen(['git', 'describe', '--tags', '--always'], cwd=dir,
stdout=PIPE, stderr=PIPE)
out = p.communicate()[0]

if (not p.returncode) and out:
Expand Down
74 changes: 57 additions & 17 deletions master/buildbot/status/web/base.py
Expand Up @@ -425,30 +425,70 @@ def abbreviate_age(age):
class BuildLineMixin:
LINE_TIME_FORMAT = "%b %d %H:%M"

def get_rev_list(self, build):
ss_list = build.getSourceStamps()
all_got_revision = build.getAllGotRevisions() or {}

if not ss_list:
return [{
'repo': 'unknown, no information in build',
'codebase': '',
'rev': 'unknown'
}]

if len(ss_list)==1:
return [{
'repo': ss_list[0].repository,
'codebase': ss_list[0].codebase,
'rev': all_got_revision.get(ss_list[0].codebase, "??")
}]

# multiple-codebase configuration
rev_list = []
for ss in ss_list:
# skip codebases with no sourcestamp spec
if not ss.branch and not ss.revision and not ss.patch and not ss.changes:
continue

rev = {
'repo': ss.repository,
'codebase': ss.codebase
}

# show the most descriptive thing we can
if ss.branch:
rev['rev'] = ss.branch
elif ss.codebase in all_got_revision:
rev['rev'] = all_got_revision[ss.codebase]
elif ss.revision:
rev['rev'] = ss.revision
else:
rev['rev'] = '??'

rev_list.append(rev)

# if all sourcestamps were empty, then this is a "most recent" kind of build
if not rev_list:
rev_list = [{
'repo': 'unknown, no information in build',
'codebase': '',
'rev': 'most recent'
}]

return rev_list

def get_line_values(self, req, build, include_builder=True):
'''
Collect the data needed for each line display
'''
builder_name = build.getBuilder().getName()
results = build.getResults()
text = build.getText()
all_got_revision = build.getAllGotRevisions()
css_class = css_classes.get(results, "")
ss_list = build.getSourceStamps()
if ss_list:
repo = ss_list[0].repository
if all_got_revision:
if len(ss_list) == 1:
rev = all_got_revision.get(ss_list[0].codebase, "??")
else:
rev = "multiple rev."
else:
rev = "??"
else:
repo = 'unknown, no information in build'
rev = 'unknown'

rev_list = self.get_rev_list(build)

if type(text) == list:
if isinstance(text, list):
text = " ".join(text)

values = {'class': css_class,
Expand All @@ -458,8 +498,8 @@ def get_line_values(self, req, build, include_builder=True):
'text': " ".join(build.getText()),
'buildurl': path_to_build(req, build),
'builderurl': path_to_builder(req, build.getBuilder()),
'rev': rev,
'rev_repo' : repo,
'rev_list': rev_list,
'multiple_revs': (len(rev_list) > 1),
'time': time.strftime(self.LINE_TIME_FORMAT,
time.localtime(build.getTimes()[0])),
'text': text,
Expand Down
13 changes: 11 additions & 2 deletions master/buildbot/status/web/templates/build_line.html
@@ -1,6 +1,10 @@
{% macro build_line(b, include_builder=False) %}
<small>({{ b.time }})</small>
Rev: {{ b.rev|shortrev(b.rev_repo) }}
Rev: {% if b.multiple_revs -%}
multiple rev
{%- else -%}
{{ b.rev_list[0]['rev']|shortrev(b.rev_list[0]['repo']) }}
{%- endif %}
<span class="{{ b.class }}">{{ b.results }}</span>
{% if include_builder %}
<a href="{{ b.builderurl }}">{{ b.builder_name }}</a>
Expand All @@ -12,7 +16,12 @@
{% macro build_tr(b, include_builder=False, loop=None) %}
<tr class="{{ loop.cycle('alt', '') if loop }}">
<td>{{ b.time }}</td>
<td>{{ b.rev|shortrev(b.rev_repo) }}</td>
<td>{%- for rev in b.rev_list -%}
{%- if not loop.first %}<br/>{% endif -%}
{%- if rev.get('codebase', '') %}<span class='codebase'>{{ rev['codebase'] }}</span>:&nbsp;{% endif -%}
{{ rev['rev']|shortrev(rev['repo']) }}
{%- endfor -%}
</td>
<td class="{{ b.class }}">{{ b.results }}</td>
{%- if include_builder %}
<td><a href="{{ b.builderurl }}">{{ b.builder_name }}</a></td>
Expand Down
2 changes: 1 addition & 1 deletion master/buildbot/test/unit/test_status_mail.py
Expand Up @@ -251,7 +251,7 @@ def fakeGetBuilder(buildername):
@d.addCallback
def check(_):
fakeBuildMessage.assert_called_with(
"Buildset Complete: testReason",
"(whole buildset)",
[build1, build2], SUCCESS)
return d

Expand Down
10 changes: 10 additions & 0 deletions master/docs/relnotes/index.rst
Expand Up @@ -99,6 +99,9 @@ Features
Depends on txgithub package.
See :bb:status:`GitHubStatus` and `GitHub Commit Status <https://github.com/blog/1227-commit-status-api>`_.

* The web UI now shows sourcestamp information for builders that use multiple codebases (instead of the generic
"multiple rev" placeholder that was shown before).

Deprecations, Removals, and Non-Compatible Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -111,6 +114,13 @@ Slave
Features
~~~~~~~~

Fixes
~~~~~

* Fixed an issue when buildstep stop() was raising an exception incorrectly if timeout for
buildstep wasn't set or was None (see :bb:pull:`753`) thus keeping watched logfiles open
(this prevented their removal on Windows in subsequent builds).

Deprecations, Removals, and Non-Compatible Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 210a963

Please sign in to comment.