Merge pull request #330 from coreos-inc/additionalprop

Add missing JSON schema for 'refs' and 'branch_name'
This commit is contained in:
Jimmy Zelinskie 2015-08-07 13:05:46 -04:00
commit 3804c50338
2 changed files with 15 additions and 0 deletions

View file

@ -400,6 +400,14 @@ class ActivateBuildTrigger(RepositoryParamResource):
'commit_sha': { 'commit_sha': {
'type': 'string', 'type': 'string',
'description': '(Custom Only) If specified, the ref/SHA1 used to checkout a git repository.' 'description': '(Custom Only) If specified, the ref/SHA1 used to checkout a git repository.'
},
'refs': {
'type': 'array',
'description': '(SCM Only) If specified, the refs to build.'
},
'branch_name': {
'type': 'string',
'description': '(SCM Only) If specified, the branch to build.'
} }
}, },
'additionalProperties': False 'additionalProperties': False

View file

@ -2989,6 +2989,13 @@ class TestBuildTriggers(ApiTestCase):
build_obj = database.RepositoryBuild.get(database.RepositoryBuild.uuid == start_json['id']) build_obj = database.RepositoryBuild.get(database.RepositoryBuild.uuid == start_json['id'])
self.assertEquals('bar', py_json.loads(build_obj.job_config)['trigger_metadata']['foo']) self.assertEquals('bar', py_json.loads(build_obj.job_config)['trigger_metadata']['foo'])
# Start another manual build, with a ref.
start_json = self.postJsonResponse(ActivateBuildTrigger,
params=dict(repository=ADMIN_ACCESS_USER + '/simple',
trigger_uuid=trigger.uuid),
data=dict(refs=[{'kind': 'branch', 'name': 'foobar'}]),
expected_code=201)
def test_invalid_robot_account(self): def test_invalid_robot_account(self):
self.login(ADMIN_ACCESS_USER) self.login(ADMIN_ACCESS_USER)