Skip to content

Commit

Permalink
StashStatusPush: allow to use got_revision
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilioPeJu committed Jun 23, 2017
1 parent a755bbd commit 47e3e65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions master/buildbot/reporters/stash.py
Expand Up @@ -67,8 +67,22 @@ def send(self, build):
else:
status = STASH_INPROGRESS
description = self.startDescription

# got_revision could be a string, a dictionary or None
got_revision = props.getProperty('got_revision', None)
for sourcestamp in build['buildset']['sourcestamps']:
sha = sourcestamp['revision']

if sha is None:
if isinstance(got_revision, dict):
sha = got_revision[sourcestamp['codebase']]
else:
sha = got_revision

if sha is None:
log.error("Unable to get the commit hash")
continue

key = yield props.render(self.key)
payload = {
'state': status,
Expand Down

0 comments on commit 47e3e65

Please sign in to comment.