Start recording the commit sha and other metadata about github triggered builds. We'll eventually show this information in the UI
This commit is contained in:
parent
4cf18c4591
commit
7c81d90cda
5 changed files with 22 additions and 9 deletions
|
@ -2276,7 +2276,7 @@ class FakeBuildTrigger(BuildTriggerBase):
|
|||
return [auth_token, 'foo', 'bar', config['somevalue']]
|
||||
|
||||
def handle_trigger_request(self, request, auth_token, config):
|
||||
return ('foo', ['bar'], 'build-name', 'subdir')
|
||||
return ('foo', ['bar'], 'build-name', 'subdir', {'foo': 'bar'})
|
||||
|
||||
def is_active(self, config):
|
||||
return 'active' in config and config['active']
|
||||
|
@ -2290,7 +2290,7 @@ class FakeBuildTrigger(BuildTriggerBase):
|
|||
return config
|
||||
|
||||
def manual_start(self, auth_token, config, run_parameters=None):
|
||||
return ('foo', ['bar'], 'build-name', 'subdir')
|
||||
return ('foo', ['bar'], 'build-name', 'subdir', {'foo': 'bar'})
|
||||
|
||||
def dockerfile_url(self, auth_token, config):
|
||||
return 'http://some/url'
|
||||
|
@ -2501,6 +2501,9 @@ class TestBuildTriggers(ApiTestCase):
|
|||
self.assertEquals("build-name", start_json['display_name'])
|
||||
self.assertEquals(['bar'], start_json['job_config']['docker_tags'])
|
||||
|
||||
# Verify the metadata was added.
|
||||
build_obj = database.RepositoryBuild.get(database.RepositoryBuild.uuid == start_json['id'])
|
||||
self.assertEquals('bar', py_json.loads(build_obj.job_config)['trigger_metadata']['foo'])
|
||||
|
||||
def test_invalid_robot_account(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
|
Reference in a new issue