Merge remote-tracking branch 'upstream/v2-phase4' into python-registry-v2
This commit is contained in:
commit
e7a6176594
105 changed files with 4439 additions and 2074 deletions
Binary file not shown.
|
@ -162,6 +162,9 @@ class RegistryTestCaseMixin(LiveServerTestCase):
|
|||
self.csrf_token = ''
|
||||
self.csrf_token = self.conduct('GET', '/__test/csrf').text
|
||||
|
||||
def do_tag(self, namespace, repository, tag, image_id, expected_code=200):
|
||||
self.conduct('PUT', '/v1/repositories/%s/%s/tags/%s' % (namespace, repository, tag),
|
||||
data='"%s"' % image_id, expected_code=expected_code, auth='sig')
|
||||
|
||||
def conduct_api_login(self, username, password):
|
||||
self.conduct('POST', '/api/v1/signin',
|
||||
|
@ -218,7 +221,7 @@ class V1RegistryMixin(BaseRegistryMixin):
|
|||
|
||||
|
||||
class V1RegistryPushMixin(V1RegistryMixin):
|
||||
def do_push(self, namespace, repository, username, password, images=None):
|
||||
def do_push(self, namespace, repository, username, password, images=None, expected_code=201):
|
||||
images = images or self._get_default_images()
|
||||
auth = (username, password)
|
||||
|
||||
|
@ -228,7 +231,10 @@ class V1RegistryPushMixin(V1RegistryMixin):
|
|||
# PUT /v1/repositories/{namespace}/{repository}/
|
||||
self.conduct('PUT', '/v1/repositories/%s/%s' % (namespace, repository),
|
||||
data=json.dumps(images), auth=auth,
|
||||
expected_code=201)
|
||||
expected_code=expected_code)
|
||||
|
||||
if expected_code != 201:
|
||||
return
|
||||
|
||||
last_image_id = None
|
||||
for image_data in images:
|
||||
|
@ -264,9 +270,7 @@ class V1RegistryPushMixin(V1RegistryMixin):
|
|||
|
||||
|
||||
# PUT /v1/repositories/{namespace}/{repository}/tags/latest
|
||||
self.conduct('PUT', '/v1/repositories/%s/%s/tags/latest' % (namespace, repository),
|
||||
data='"' + last_image_id + '"',
|
||||
auth='sig')
|
||||
self.do_tag(namespace, repository, 'latest', images[0]['id'])
|
||||
|
||||
# PUT /v1/repositories/{namespace}/{repository}/images
|
||||
self.conduct('PUT', '/v1/repositories/%s/%s/images' % (namespace, repository),
|
||||
|
@ -680,11 +684,39 @@ class RegistryTestsMixin(object):
|
|||
class V1RegistryTests(V1RegistryPullMixin, V1RegistryPushMixin, RegistryTestsMixin,
|
||||
RegistryTestCaseMixin, LiveServerTestCase):
|
||||
""" Tests for V1 registry. """
|
||||
def test_push_reponame_with_slashes(self):
|
||||
# Attempt to add a repository name with slashes. This should fail as we do not support it.
|
||||
images = [{
|
||||
'id': 'onlyimagehere'
|
||||
}]
|
||||
self.do_push('public', 'newrepo/somesubrepo', 'public', 'password', images, expected_code=400)
|
||||
|
||||
def test_tag_validation(self):
|
||||
image_id = 'onlyimagehere'
|
||||
images = [{
|
||||
'id': image_id
|
||||
}]
|
||||
self.do_push('public', 'newrepo', 'public', 'password', images)
|
||||
self.do_tag('public', 'newrepo', '1', image_id)
|
||||
self.do_tag('public', 'newrepo', 'x' * 128, image_id)
|
||||
self.do_tag('public', 'newrepo', '', image_id, expected_code=400)
|
||||
self.do_tag('public', 'newrepo', 'x' * 129, image_id, expected_code=400)
|
||||
self.do_tag('public', 'newrepo', '.fail', image_id, expected_code=400)
|
||||
self.do_tag('public', 'newrepo', '-fail', image_id, expected_code=400)
|
||||
|
||||
|
||||
class V2RegistryTests(V2RegistryPullMixin, V2RegistryPushMixin, RegistryTestsMixin,
|
||||
RegistryTestCaseMixin, LiveServerTestCase):
|
||||
""" Tests for V2 registry. """
|
||||
|
||||
def test_push_reponame_with_slashes(self):
|
||||
# Attempt to add a repository name with slashes. This should fail as we do not support it.
|
||||
images = [{
|
||||
'id': 'onlyimagehere'
|
||||
}]
|
||||
self.do_push('public', 'newrepo/somesubrepo', 'devtable', 'password', images,
|
||||
expected_auth_code=400)
|
||||
|
||||
def test_invalid_push(self):
|
||||
self.do_push('devtable', 'newrepo', 'devtable', 'password', invalid=True)
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ from endpoints.api import api_bp, api
|
|||
|
||||
from endpoints.api.team import TeamMember, TeamMemberList, OrganizationTeam, TeamMemberInvite
|
||||
from endpoints.api.tag import RepositoryTagImages, RepositoryTag, ListRepositoryTags, RevertTag
|
||||
from endpoints.api.search import FindRepositories, EntitySearch
|
||||
from endpoints.api.search import EntitySearch
|
||||
from endpoints.api.image import RepositoryImageChanges, RepositoryImage, RepositoryImageList
|
||||
from endpoints.api.build import (FileDropResource, RepositoryBuildStatus, RepositoryBuildLogs,
|
||||
RepositoryBuildList, RepositoryBuildResource)
|
||||
|
@ -118,25 +118,6 @@ class ApiTestCase(unittest.TestCase):
|
|||
finished_database_for_testing(self)
|
||||
|
||||
|
||||
class TestFindRepositories(ApiTestCase):
|
||||
def setUp(self):
|
||||
ApiTestCase.setUp(self)
|
||||
self._set_url(FindRepositories)
|
||||
|
||||
def test_get_anonymous(self):
|
||||
self._run_test('GET', 200, None, None)
|
||||
|
||||
def test_get_freshuser(self):
|
||||
self._run_test('GET', 200, 'freshuser', None)
|
||||
|
||||
def test_get_reader(self):
|
||||
self._run_test('GET', 200, 'reader', None)
|
||||
|
||||
def test_get_devtable(self):
|
||||
self._run_test('GET', 200, 'devtable', None)
|
||||
|
||||
|
||||
|
||||
class TestUserStarredRepositoryList(ApiTestCase):
|
||||
def setUp(self):
|
||||
ApiTestCase.setUp(self)
|
||||
|
@ -397,16 +378,16 @@ class TestRepositoryList(ApiTestCase):
|
|||
self._set_url(RepositoryList)
|
||||
|
||||
def test_get_anonymous(self):
|
||||
self._run_test('GET', 200, None, None)
|
||||
self._run_test('GET', 400, None, None)
|
||||
|
||||
def test_get_freshuser(self):
|
||||
self._run_test('GET', 200, 'freshuser', None)
|
||||
self._run_test('GET', 400, 'freshuser', None)
|
||||
|
||||
def test_get_reader(self):
|
||||
self._run_test('GET', 200, 'reader', None)
|
||||
self._run_test('GET', 400, 'reader', None)
|
||||
|
||||
def test_get_devtable(self):
|
||||
self._run_test('GET', 200, 'devtable', None)
|
||||
self._run_test('GET', 400, 'devtable', None)
|
||||
|
||||
def test_post_anonymous(self):
|
||||
self._run_test('POST', 400, None, {u'visibility': u'public', u'repository': 'XZGB',
|
||||
|
|
|
@ -12,15 +12,15 @@ from playhouse.test_utils import assert_query_count
|
|||
from endpoints.api import api_bp, api
|
||||
from endpoints.building import PreparedBuild
|
||||
from endpoints.webhooks import webhooks
|
||||
from endpoints.trigger import BuildTriggerHandler
|
||||
from app import app
|
||||
from buildtrigger.basehandler import BuildTriggerHandler
|
||||
from initdb import setup_database_for_testing, finished_database_for_testing
|
||||
from data import database, model
|
||||
from data.database import RepositoryActionCount
|
||||
|
||||
from endpoints.api.team import TeamMember, TeamMemberList, TeamMemberInvite, OrganizationTeam
|
||||
from endpoints.api.tag import RepositoryTagImages, RepositoryTag, RevertTag, ListRepositoryTags
|
||||
from endpoints.api.search import FindRepositories, EntitySearch, ConductSearch
|
||||
from endpoints.api.search import EntitySearch, ConductSearch
|
||||
from endpoints.api.image import RepositoryImage, RepositoryImageList
|
||||
from endpoints.api.build import (RepositoryBuildStatus, RepositoryBuildLogs, RepositoryBuildList,
|
||||
RepositoryBuildResource)
|
||||
|
@ -1272,6 +1272,17 @@ class TestDeleteOrganizationTeamMember(ApiTestCase):
|
|||
|
||||
|
||||
class TestCreateRepo(ApiTestCase):
|
||||
def test_invalidreponame(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
json = self.postJsonResponse(RepositoryList,
|
||||
data=dict(repository='some/repo',
|
||||
visibility='public',
|
||||
description=''),
|
||||
expected_code=400)
|
||||
|
||||
self.assertEquals('Invalid repository name', json['error_description'])
|
||||
|
||||
def test_duplicaterepo(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
|
@ -1312,30 +1323,6 @@ class TestCreateRepo(ApiTestCase):
|
|||
self.assertEquals('newrepo', json['name'])
|
||||
|
||||
|
||||
class TestFindRepos(ApiTestCase):
|
||||
def test_findrepos_asguest(self):
|
||||
json = self.getJsonResponse(FindRepositories, params=dict(query='p'))
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
self.assertEquals(json['repositories'][0]['namespace'], 'public')
|
||||
self.assertEquals(json['repositories'][0]['name'], 'publicrepo')
|
||||
|
||||
def test_findrepos_asuser(self):
|
||||
self.login(NO_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse(FindRepositories, params=dict(query='p'))
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
self.assertEquals(json['repositories'][0]['namespace'], 'public')
|
||||
self.assertEquals(json['repositories'][0]['name'], 'publicrepo')
|
||||
|
||||
def test_findrepos_orgmember(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
||||
json = self.getJsonResponse(FindRepositories, params=dict(query='p'))
|
||||
self.assertGreater(len(json['repositories']), 1)
|
||||
|
||||
|
||||
class TestListRepos(ApiTestCase):
|
||||
def test_listrepos_asguest(self):
|
||||
# Queries: Base + the list query
|
||||
|
@ -1344,14 +1331,14 @@ class TestListRepos(ApiTestCase):
|
|||
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_orgmember(self):
|
||||
def test_listrepos_asorgmember(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
||||
# Queries: Base + the list query
|
||||
with assert_query_count(BASE_LOGGEDIN_QUERY_COUNT + 1):
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(public=True))
|
||||
|
||||
self.assertGreater(len(json['repositories']), 1)
|
||||
self.assertGreater(len(json['repositories']), 0)
|
||||
|
||||
def test_listrepos_filter(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
|
@ -1366,7 +1353,7 @@ class TestListRepos(ApiTestCase):
|
|||
|
||||
def test_listrepos_limit(self):
|
||||
self.login(READ_ACCESS_USER)
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(limit=1))
|
||||
json = self.getJsonResponse(RepositoryList, params=dict(limit=1, public=True))
|
||||
self.assertEquals(len(json['repositories']), 1)
|
||||
|
||||
def test_listrepos_allparams(self):
|
||||
|
@ -2177,6 +2164,12 @@ class TestListAndDeleteTag(ApiTestCase):
|
|||
|
||||
self.assertEquals(staging_images, json['images'])
|
||||
|
||||
# Require a valid tag name.
|
||||
self.putResponse(RepositoryTag,
|
||||
params=dict(repository=ADMIN_ACCESS_USER + '/complex', tag='-fail'),
|
||||
data=dict(image=staging_images[0]['id']),
|
||||
expected_code=400)
|
||||
|
||||
# Add a new tag to the staging image.
|
||||
self.putResponse(RepositoryTag,
|
||||
params=dict(repository=ADMIN_ACCESS_USER + '/complex', tag='sometag'),
|
||||
|
|
|
@ -217,3 +217,7 @@ class TestImageSharing(unittest.TestCase):
|
|||
still_uploading.save()
|
||||
|
||||
self.assertDifferentStorage('an-image', still_uploading)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
271
test/test_prepare_trigger.py
Normal file
271
test/test_prepare_trigger.py
Normal file
|
@ -0,0 +1,271 @@
|
|||
import unittest
|
||||
import json
|
||||
|
||||
from jsonschema import validate, ValidationError
|
||||
from buildtrigger.basehandler import METADATA_SCHEMA
|
||||
from buildtrigger.bitbuckethandler import get_transformed_webhook_payload as bb_webhook
|
||||
from buildtrigger.bitbuckethandler import get_transformed_commit_info as bb_commit
|
||||
from buildtrigger.githubhandler import get_transformed_webhook_payload as gh_webhook
|
||||
from buildtrigger.gitlabhandler import get_transformed_webhook_payload as gl_webhook
|
||||
|
||||
class TestPrepareTrigger(unittest.TestCase):
|
||||
def assertSchema(self, filename, expected, processor, *args, **kwargs):
|
||||
with open('test/triggerjson/%s.json' % filename) as f:
|
||||
payload = json.loads(f.read())
|
||||
|
||||
nargs = [payload]
|
||||
nargs.extend(args)
|
||||
|
||||
created = processor(*nargs, **kwargs)
|
||||
self.assertEquals(expected, created)
|
||||
validate(created, METADATA_SCHEMA)
|
||||
|
||||
|
||||
def test_bitbucket_customer_payload_noauthor(self):
|
||||
expected = {
|
||||
"commit": "a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"ref": "refs/heads/master",
|
||||
"git_url": "git@bitbucket.org:lightsidelabs/svc-identity.git",
|
||||
"commit_info": {
|
||||
"url": "https://bitbucket.org/lightsidelabs/svc-identity/commits/a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"date": "2015-09-25T00:55:08+00:00",
|
||||
"message": "Update version.py to 0.1.2 [skip ci]\n\n(by utilitybelt/scripts/autotag_version.py)\n",
|
||||
"committer": {
|
||||
"username": "LightSide_CodeShip",
|
||||
"url": "https://bitbucket.org/LightSide_CodeShip/",
|
||||
"avatar_url": "https://bitbucket.org/account/LightSide_CodeShip/avatar/32/",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('bitbucket_customer_example_noauthor', expected, bb_webhook)
|
||||
|
||||
|
||||
def test_bitbucket_customer_payload_tag(self):
|
||||
expected = {
|
||||
"commit": "a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"ref": "refs/tags/0.1.2",
|
||||
"git_url": "git@bitbucket.org:lightsidelabs/svc-identity.git",
|
||||
"commit_info": {
|
||||
"url": "https://bitbucket.org/lightsidelabs/svc-identity/commits/a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"date": "2015-09-25T00:55:08+00:00",
|
||||
"message": "Update version.py to 0.1.2 [skip ci]\n\n(by utilitybelt/scripts/autotag_version.py)\n",
|
||||
"committer": {
|
||||
"username": "LightSide_CodeShip",
|
||||
"url": "https://bitbucket.org/LightSide_CodeShip/",
|
||||
"avatar_url": "https://bitbucket.org/account/LightSide_CodeShip/avatar/32/",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('bitbucket_customer_example_tag', expected, bb_webhook)
|
||||
|
||||
|
||||
def test_bitbucket_commit(self):
|
||||
ref = 'refs/heads/somebranch'
|
||||
default_branch = 'somebranch'
|
||||
repository_name = 'foo/bar'
|
||||
|
||||
def lookup_author(_):
|
||||
return {
|
||||
'user': {
|
||||
'username': 'cooluser',
|
||||
'avatar': 'http://some/avatar/url'
|
||||
}
|
||||
}
|
||||
|
||||
expected = {
|
||||
"commit": u"abdeaf1b2b4a6b9ddf742c1e1754236380435a62",
|
||||
"ref": u"refs/heads/somebranch",
|
||||
"git_url": u"git@bitbucket.org:foo/bar.git",
|
||||
"default_branch": u"somebranch",
|
||||
"commit_info": {
|
||||
"url": u"https://bitbucket.org/foo/bar/commits/abdeaf1b2b4a6b9ddf742c1e1754236380435a62",
|
||||
"date": u"2012-07-24 00:26:36",
|
||||
"message": u"making some changes\n",
|
||||
"author": {
|
||||
"url": u"https://bitbucket.org/cooluser/",
|
||||
"avatar_url": u"http://some/avatar/url",
|
||||
"username": u"cooluser",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.assertSchema('bitbucket_commit', expected, bb_commit, ref, default_branch,
|
||||
repository_name, lookup_author)
|
||||
|
||||
def test_bitbucket_webhook_payload(self):
|
||||
expected = {
|
||||
"commit": u"af64ae7188685f8424040b4735ad12941b980d75",
|
||||
"ref": u"refs/heads/master",
|
||||
"git_url": u"git@bitbucket.org:jscoreos/another-repo.git",
|
||||
"commit_info": {
|
||||
"url": u"https://bitbucket.org/jscoreos/another-repo/commits/af64ae7188685f8424040b4735ad12941b980d75",
|
||||
"date": u"2015-09-10T20:40:54+00:00",
|
||||
"message": u"Dockerfile edited online with Bitbucket",
|
||||
"author": {
|
||||
"username": u"jscoreos",
|
||||
"url": u"https://bitbucket.org/jscoreos/",
|
||||
"avatar_url": u"https://bitbucket.org/account/jscoreos/avatar/32/",
|
||||
},
|
||||
"committer": {
|
||||
"username": u"jscoreos",
|
||||
"url": u"https://bitbucket.org/jscoreos/",
|
||||
"avatar_url": u"https://bitbucket.org/account/jscoreos/avatar/32/",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('bitbucket_webhook', expected, bb_webhook)
|
||||
|
||||
|
||||
def test_github_webhook_payload(self):
|
||||
expected = {
|
||||
'commit': u'410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@github.com:josephschorr/anothertest.git',
|
||||
'commit_info': {
|
||||
'url': u'https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'date': u'2015-09-11T14:26:16-04:00',
|
||||
'message': u'Update Dockerfile',
|
||||
'committer': {
|
||||
'username': u'josephschorr',
|
||||
},
|
||||
'author': {
|
||||
'username': u'josephschorr',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('github_webhook', expected, gh_webhook)
|
||||
|
||||
|
||||
def test_github_webhook_payload_with_lookup(self):
|
||||
expected = {
|
||||
'commit': u'410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@github.com:josephschorr/anothertest.git',
|
||||
'commit_info': {
|
||||
'url': u'https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'date': u'2015-09-11T14:26:16-04:00',
|
||||
'message': u'Update Dockerfile',
|
||||
'committer': {
|
||||
'username': u'josephschorr',
|
||||
'url': u'http://github.com/josephschorr',
|
||||
'avatar_url': u'http://some/avatar/url',
|
||||
},
|
||||
'author': {
|
||||
'username': u'josephschorr',
|
||||
'url': u'http://github.com/josephschorr',
|
||||
'avatar_url': u'http://some/avatar/url',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def lookup_user(_):
|
||||
return {
|
||||
'html_url': 'http://github.com/josephschorr',
|
||||
'avatar_url': 'http://some/avatar/url'
|
||||
}
|
||||
|
||||
self.assertSchema('github_webhook', expected, gh_webhook, lookup_user=lookup_user)
|
||||
|
||||
|
||||
def test_github_webhook_payload_missing_fields_with_lookup(self):
|
||||
expected = {
|
||||
'commit': u'410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@github.com:josephschorr/anothertest.git',
|
||||
'commit_info': {
|
||||
'url': u'https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'date': u'2015-09-11T14:26:16-04:00',
|
||||
'message': u'Update Dockerfile'
|
||||
},
|
||||
}
|
||||
|
||||
def lookup_user(username):
|
||||
if not username:
|
||||
raise Exception('Fail!')
|
||||
|
||||
return {
|
||||
'html_url': 'http://github.com/josephschorr',
|
||||
'avatar_url': 'http://some/avatar/url'
|
||||
}
|
||||
|
||||
self.assertSchema('github_webhook_missing', expected, gh_webhook, lookup_user=lookup_user)
|
||||
|
||||
|
||||
def test_gitlab_webhook_payload(self):
|
||||
expected = {
|
||||
'commit': u'fb88379ee45de28a0a4590fddcbd8eff8b36026e',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@gitlab.com:jzelinskie/www-gitlab-com.git',
|
||||
'commit_info': {
|
||||
'url': u'https://gitlab.com/jzelinskie/www-gitlab-com/commit/fb88379ee45de28a0a4590fddcbd8eff8b36026e',
|
||||
'date': u'2015-08-13T19:33:18+00:00',
|
||||
'message': u'Fix link\n',
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('gitlab_webhook', expected, gl_webhook)
|
||||
|
||||
|
||||
def test_github_webhook_payload_known_issue(self):
|
||||
expected = {
|
||||
"commit": "118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"ref": "refs/heads/master",
|
||||
"git_url": "git@github.com:silas/docker-test.git",
|
||||
"commit_info": {
|
||||
"url": "https://github.com/silas/docker-test/commit/118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"date": "2015-09-25T14:55:11-04:00",
|
||||
"message": "Fail",
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('github_webhook_noname', expected, gh_webhook)
|
||||
|
||||
|
||||
def test_github_webhook_payload_missing_fields(self):
|
||||
expected = {
|
||||
'commit': u'410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@github.com:josephschorr/anothertest.git',
|
||||
'commit_info': {
|
||||
'url': u'https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c',
|
||||
'date': u'2015-09-11T14:26:16-04:00',
|
||||
'message': u'Update Dockerfile'
|
||||
},
|
||||
}
|
||||
|
||||
self.assertSchema('github_webhook_missing', expected, gh_webhook)
|
||||
|
||||
|
||||
def test_gitlab_webhook_payload_with_lookup(self):
|
||||
expected = {
|
||||
'commit': u'fb88379ee45de28a0a4590fddcbd8eff8b36026e',
|
||||
'ref': u'refs/heads/master',
|
||||
'git_url': u'git@gitlab.com:jzelinskie/www-gitlab-com.git',
|
||||
'commit_info': {
|
||||
'url': u'https://gitlab.com/jzelinskie/www-gitlab-com/commit/fb88379ee45de28a0a4590fddcbd8eff8b36026e',
|
||||
'date': u'2015-08-13T19:33:18+00:00',
|
||||
'message': u'Fix link\n',
|
||||
'author': {
|
||||
'username': 'jzelinskie',
|
||||
'url': 'http://gitlab.com/jzelinskie',
|
||||
'avatar_url': 'http://some/avatar/url',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
def lookup_user(_):
|
||||
return {
|
||||
'username': 'jzelinskie',
|
||||
'html_url': 'http://gitlab.com/jzelinskie',
|
||||
'avatar_url': 'http://some/avatar/url',
|
||||
}
|
||||
|
||||
self.assertSchema('gitlab_webhook', expected, gl_webhook, lookup_user=lookup_user)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
|
@ -1,7 +1,9 @@
|
|||
import unittest
|
||||
import re
|
||||
|
||||
from endpoints.trigger import matches_ref
|
||||
from buildtrigger.triggerutil import matches_ref, raise_if_skipped_build
|
||||
from buildtrigger.triggerutil import SkipRequestException
|
||||
from endpoints.building import PreparedBuild
|
||||
|
||||
class TestRegex(unittest.TestCase):
|
||||
def assertDoesNotMatch(self, ref, filt):
|
||||
|
@ -25,5 +27,55 @@ class TestRegex(unittest.TestCase):
|
|||
|
||||
self.assertDoesNotMatch('ref/heads/delta', '(((heads/alpha)|(heads/beta))|(heads/gamma))|(heads/master)')
|
||||
|
||||
|
||||
class TestSkipBuild(unittest.TestCase):
|
||||
def testSkipNoMetadata(self):
|
||||
prepared = PreparedBuild()
|
||||
prepared.metadata = {}
|
||||
config = {}
|
||||
|
||||
self.assertRaises(SkipRequestException, raise_if_skipped_build, prepared, config)
|
||||
|
||||
def testSkipByBranchtagRegex(self):
|
||||
prepared = PreparedBuild()
|
||||
prepared.metadata = {
|
||||
'ref': 'ref/heads/master',
|
||||
}
|
||||
|
||||
config = {
|
||||
'branchtag_regex': 'nothing'
|
||||
}
|
||||
self.assertRaises(SkipRequestException, raise_if_skipped_build, prepared, config)
|
||||
|
||||
def testSkipByMessage(self):
|
||||
prepared = PreparedBuild()
|
||||
prepared.metadata = {
|
||||
'ref': 'ref/heads/master',
|
||||
'commit_info': {
|
||||
'message': '[skip build]',
|
||||
},
|
||||
}
|
||||
|
||||
config = {}
|
||||
|
||||
self.assertRaises(SkipRequestException, raise_if_skipped_build, prepared, config)
|
||||
|
||||
|
||||
def testDoesNotSkip(self):
|
||||
prepared = PreparedBuild()
|
||||
prepared.metadata = {
|
||||
'ref': 'ref/heads/master',
|
||||
'commit_info': {
|
||||
'message': 'some cool message',
|
||||
},
|
||||
}
|
||||
|
||||
config = {
|
||||
'branchtag_regex': '(master)|(heads/master)',
|
||||
}
|
||||
|
||||
raise_if_skipped_build(prepared, config)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -83,15 +83,24 @@ class TestUsernameGenerator(unittest.TestCase):
|
|||
def test_basic_ascii_names(self):
|
||||
self.assert_generated_output('jake', 'jake')
|
||||
self.assert_generated_output('frank', 'frank')
|
||||
self.assert_generated_output('fra-nk', 'fra_nk')
|
||||
|
||||
def test_names_with_caps(self):
|
||||
self.assert_generated_output('Jake', 'jake')
|
||||
self.assert_generated_output('FranK', 'frank')
|
||||
|
||||
def test_multiple_underscores(self):
|
||||
self.assert_generated_output('ja__ke', 'ja_ke')
|
||||
self.assert_generated_output('ja___ke', 'ja_ke')
|
||||
|
||||
def test_trailing_underscores(self):
|
||||
self.assert_generated_output('ja__', 'ja00')
|
||||
self.assert_generated_output('jake__', 'jake')
|
||||
|
||||
def test_short_names(self):
|
||||
self.assert_generated_output('a', 'a___')
|
||||
self.assert_generated_output('ab', 'ab__')
|
||||
self.assert_generated_output('abc', 'abc_')
|
||||
self.assert_generated_output('a', 'a000')
|
||||
self.assert_generated_output('ab', 'ab00')
|
||||
self.assert_generated_output('abc', 'abc0')
|
||||
|
||||
def test_long_names(self):
|
||||
self.assert_generated_output('abcdefghijklmnopqrstuvwxyz1234567890',
|
||||
|
@ -108,16 +117,18 @@ class TestUsernameGenerator(unittest.TestCase):
|
|||
self.assert_generated_output(u'\u0985\u09ad\u09bf\u099c\u09c0\u09a4', 'abhijiit')
|
||||
self.assert_generated_output(u'\u0d05\u0d2d\u0d3f\u0d1c\u0d40\u0d24', 'abhijiit')
|
||||
self.assert_generated_output(u'\u0d2e\u0d32\u0d2f\u0d3e\u0d32\u0d2e\u0d4d', 'mlyaalm')
|
||||
self.assert_generated_output(u'\ue000', '____')
|
||||
self.assert_generated_output(u'\u03ff', '____')
|
||||
self.assert_generated_output(u'\ue000', '0000')
|
||||
self.assert_generated_output(u'\u03ff', '0000')
|
||||
|
||||
self.assert_generated_output(u'\u0d2e\u0d32\u03ff\u03ff\u0d2e\u0d32', 'mlml')
|
||||
|
||||
def test_multiple_suggestions(self):
|
||||
name_gen = generate_valid_usernames('a')
|
||||
generated_output = list(islice(name_gen, 4))
|
||||
self.assertEquals('a___', generated_output[0])
|
||||
self.assertEquals('a__0', generated_output[1])
|
||||
self.assertEquals('a__1', generated_output[2])
|
||||
self.assertEquals('a__2', generated_output[3])
|
||||
self.assertEquals('a000', generated_output[0])
|
||||
self.assertEquals('a001', generated_output[1])
|
||||
self.assertEquals('a002', generated_output[2])
|
||||
self.assertEquals('a003', generated_output[3])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
98
test/test_visible_repos.py
Normal file
98
test/test_visible_repos.py
Normal file
|
@ -0,0 +1,98 @@
|
|||
import unittest
|
||||
|
||||
from app import app
|
||||
from initdb import setup_database_for_testing, finished_database_for_testing
|
||||
from data import model
|
||||
|
||||
NO_ACCESS_USER = 'freshuser'
|
||||
READ_ACCESS_USER = 'reader'
|
||||
ADMIN_ACCESS_USER = 'devtable'
|
||||
PUBLIC_USER = 'public'
|
||||
RANDOM_USER = 'randomuser'
|
||||
OUTSIDE_ORG_USER = 'outsideorg'
|
||||
|
||||
ADMIN_ROBOT_USER = 'devtable+dtrobot'
|
||||
|
||||
ORGANIZATION = 'buynlarge'
|
||||
|
||||
SIMPLE_REPO = 'simple'
|
||||
PUBLIC_REPO = 'publicrepo'
|
||||
RANDOM_REPO = 'randomrepo'
|
||||
|
||||
OUTSIDE_ORG_REPO = 'coolrepo'
|
||||
|
||||
ORG_REPO = 'orgrepo'
|
||||
ANOTHER_ORG_REPO = 'anotherorgrepo'
|
||||
|
||||
# Note: The shared repo has devtable as admin, public as a writer and reader as a reader.
|
||||
SHARED_REPO = 'shared'
|
||||
|
||||
class TestVisibleRepositories(unittest.TestCase):
|
||||
def setUp(self):
|
||||
setup_database_for_testing(self)
|
||||
self.app = app.test_client()
|
||||
self.ctx = app.test_request_context()
|
||||
self.ctx.__enter__()
|
||||
|
||||
def tearDown(self):
|
||||
finished_database_for_testing(self)
|
||||
self.ctx.__exit__(True, None, None)
|
||||
|
||||
def assertDoesNotHaveRepo(self, username, name):
|
||||
repos = list(model.repository.get_visible_repositories(username))
|
||||
names = [repo.name for repo in repos]
|
||||
self.assertNotIn(name, names)
|
||||
|
||||
def assertHasRepo(self, username, name):
|
||||
repos = list(model.repository.get_visible_repositories(username))
|
||||
names = [repo.name for repo in repos]
|
||||
self.assertIn(name, names)
|
||||
|
||||
def test_noaccess(self):
|
||||
repos = list(model.repository.get_visible_repositories(NO_ACCESS_USER))
|
||||
names = [repo.name for repo in repos]
|
||||
self.assertEquals(0, len(names))
|
||||
|
||||
# Try retrieving public repos now.
|
||||
repos = list(model.repository.get_visible_repositories(NO_ACCESS_USER, include_public=True))
|
||||
names = [repo.name for repo in repos]
|
||||
self.assertIn(PUBLIC_REPO, names)
|
||||
|
||||
|
||||
def test_public(self):
|
||||
self.assertHasRepo(PUBLIC_USER, PUBLIC_REPO)
|
||||
self.assertHasRepo(PUBLIC_USER, SHARED_REPO)
|
||||
|
||||
self.assertDoesNotHaveRepo(PUBLIC_USER, SIMPLE_REPO)
|
||||
self.assertDoesNotHaveRepo(PUBLIC_USER, RANDOM_REPO)
|
||||
self.assertDoesNotHaveRepo(PUBLIC_USER, OUTSIDE_ORG_REPO)
|
||||
|
||||
def test_reader(self):
|
||||
self.assertHasRepo(READ_ACCESS_USER, SHARED_REPO)
|
||||
self.assertHasRepo(READ_ACCESS_USER, ORG_REPO)
|
||||
|
||||
self.assertDoesNotHaveRepo(READ_ACCESS_USER, SIMPLE_REPO)
|
||||
self.assertDoesNotHaveRepo(READ_ACCESS_USER, RANDOM_REPO)
|
||||
self.assertDoesNotHaveRepo(READ_ACCESS_USER, OUTSIDE_ORG_REPO)
|
||||
self.assertDoesNotHaveRepo(READ_ACCESS_USER, PUBLIC_REPO)
|
||||
|
||||
def test_random(self):
|
||||
self.assertHasRepo(RANDOM_USER, RANDOM_REPO)
|
||||
|
||||
self.assertDoesNotHaveRepo(RANDOM_USER, SIMPLE_REPO)
|
||||
self.assertDoesNotHaveRepo(RANDOM_USER, SHARED_REPO)
|
||||
self.assertDoesNotHaveRepo(RANDOM_USER, ORG_REPO)
|
||||
self.assertDoesNotHaveRepo(RANDOM_USER, ANOTHER_ORG_REPO)
|
||||
self.assertDoesNotHaveRepo(RANDOM_USER, PUBLIC_REPO)
|
||||
|
||||
def test_admin(self):
|
||||
self.assertHasRepo(ADMIN_ACCESS_USER, SIMPLE_REPO)
|
||||
self.assertHasRepo(ADMIN_ACCESS_USER, SHARED_REPO)
|
||||
|
||||
self.assertHasRepo(ADMIN_ACCESS_USER, ORG_REPO)
|
||||
self.assertHasRepo(ADMIN_ACCESS_USER, ANOTHER_ORG_REPO)
|
||||
|
||||
self.assertDoesNotHaveRepo(ADMIN_ACCESS_USER, OUTSIDE_ORG_REPO)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
24
test/triggerjson/bitbucket_commit.json
Normal file
24
test/triggerjson/bitbucket_commit.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"files": [
|
||||
{
|
||||
"type": "added",
|
||||
"file": "AnotherFile.txt"
|
||||
},
|
||||
{
|
||||
"type": "modified",
|
||||
"file": "Readme"
|
||||
}
|
||||
],
|
||||
"raw_author": "Mary Anthony <manthony@172-28-13-105.staff.sf.atlassian.com>",
|
||||
"utctimestamp": "2012-07-23 22:26:36+00:00",
|
||||
"author": "Mary Anthony",
|
||||
"timestamp": "2012-07-24 00:26:36",
|
||||
"node": "abdeaf1b2b4a6b9ddf742c1e1754236380435a62",
|
||||
"parents": [
|
||||
"86432202a2d5"
|
||||
],
|
||||
"branch": "master",
|
||||
"message": "making some changes\n",
|
||||
"revision": null,
|
||||
"size": -1
|
||||
}
|
215
test/triggerjson/bitbucket_customer_example_noauthor.json
Normal file
215
test/triggerjson/bitbucket_customer_example_noauthor.json
Normal file
|
@ -0,0 +1,215 @@
|
|||
{
|
||||
"actor": {
|
||||
"username": "LightSide_CodeShip",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/LightSide_CodeShip"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/LightSide_CodeShip/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/LightSide_CodeShip/"
|
||||
}
|
||||
},
|
||||
"uuid": "{d009ab20-b8b8-4840-9491-bfe72fbf666e}",
|
||||
"type": "user",
|
||||
"display_name": "CodeShip Tagging"
|
||||
},
|
||||
"repository": {
|
||||
"full_name": "lightsidelabs/svc-identity",
|
||||
"name": "svc-identity",
|
||||
"scm": "git",
|
||||
"type": "repository",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/avatar/16/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity"
|
||||
}
|
||||
},
|
||||
"is_private": true,
|
||||
"uuid": "{3400bed9-5cde-45b9-8d86-c1dac5d5e610}",
|
||||
"owner": {
|
||||
"username": "lightsidelabs",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/teams/lightsidelabs"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/lightsidelabs/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/"
|
||||
}
|
||||
},
|
||||
"uuid": "{456c5f28-7338-4d89-9506-c7b889ba2d11}",
|
||||
"type": "team",
|
||||
"display_name": "LightSIDE Labs"
|
||||
}
|
||||
},
|
||||
"push": {
|
||||
"changes": [
|
||||
{
|
||||
"commits": [
|
||||
{
|
||||
"hash": "a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"raw": "scripts/autotag_version.py <utilitybelt@lightside>"
|
||||
},
|
||||
"type": "commit",
|
||||
"message": "Update version.py to 0.1.2 [skip ci]\n\n(by utilitybelt/scripts/autotag_version.py)\n"
|
||||
}
|
||||
],
|
||||
"created": false,
|
||||
"forced": false,
|
||||
"old": {
|
||||
"target": {
|
||||
"parents": [
|
||||
{
|
||||
"hash": "bd749165b0c50c65c15fc4df526b8e9df26eff10",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/bd749165b0c50c65c15fc4df526b8e9df26eff10"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/bd749165b0c50c65c15fc4df526b8e9df26eff10"
|
||||
}
|
||||
},
|
||||
"type": "commit"
|
||||
},
|
||||
{
|
||||
"hash": "910b5624b74190dfaa51938d851563a4c5254926",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/910b5624b74190dfaa51938d851563a4c5254926"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/910b5624b74190dfaa51938d851563a4c5254926"
|
||||
}
|
||||
},
|
||||
"type": "commit"
|
||||
}
|
||||
],
|
||||
"date": "2015-09-25T00:54:41+00:00",
|
||||
"type": "commit",
|
||||
"message": "Merged in create-update-user (pull request #3)\n\nCreate + update identity\n",
|
||||
"hash": "263736ecc250113fad56a93f83b712093554ad42",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/263736ecc250113fad56a93f83b712093554ad42"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/263736ecc250113fad56a93f83b712093554ad42"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"raw": "Chris Winters <chris@cwinters.com>",
|
||||
"user": {
|
||||
"username": "cwinters",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/cwinters"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/cwinters/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/cwinters/"
|
||||
}
|
||||
},
|
||||
"uuid": "{a6209615-6d75-4294-8181-dbf96d40fc6b}",
|
||||
"type": "user",
|
||||
"display_name": "Chris Winters"
|
||||
}
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/refs/branches/master"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commits/master"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/branch/master"
|
||||
}
|
||||
},
|
||||
"name": "master",
|
||||
"type": "branch"
|
||||
},
|
||||
"links": {
|
||||
"diff": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/diff/a0ec139843b2bb281ab21a433266ddc498e605dc..263736ecc250113fad56a93f83b712093554ad42"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commits?include=a0ec139843b2bb281ab21a433266ddc498e605dc&exclude=263736ecc250113fad56a93f83b712093554ad42"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/branches/compare/a0ec139843b2bb281ab21a433266ddc498e605dc..263736ecc250113fad56a93f83b712093554ad42"
|
||||
}
|
||||
},
|
||||
"new": {
|
||||
"target": {
|
||||
"parents": [
|
||||
{
|
||||
"hash": "263736ecc250113fad56a93f83b712093554ad42",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/263736ecc250113fad56a93f83b712093554ad42"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/263736ecc250113fad56a93f83b712093554ad42"
|
||||
}
|
||||
},
|
||||
"type": "commit"
|
||||
}
|
||||
],
|
||||
"date": "2015-09-25T00:55:08+00:00",
|
||||
"type": "commit",
|
||||
"message": "Update version.py to 0.1.2 [skip ci]\n\n(by utilitybelt/scripts/autotag_version.py)\n",
|
||||
"hash": "a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"raw": "scripts/autotag_version.py <utilitybelt@lightside>"
|
||||
}
|
||||
},
|
||||
"links": {
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/refs/branches/master"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commits/master"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/branch/master"
|
||||
}
|
||||
},
|
||||
"name": "master",
|
||||
"type": "branch"
|
||||
},
|
||||
"closed": false,
|
||||
"truncated": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
117
test/triggerjson/bitbucket_customer_example_tag.json
Normal file
117
test/triggerjson/bitbucket_customer_example_tag.json
Normal file
|
@ -0,0 +1,117 @@
|
|||
{
|
||||
"push": {
|
||||
"changes": [
|
||||
{
|
||||
"links": {
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commits?include=a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
}
|
||||
},
|
||||
"closed": false,
|
||||
"new": {
|
||||
"target": {
|
||||
"date": "2015-09-25T00:55:08+00:00",
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/a0ec139843b2bb281ab21a433266ddc498e605dc"
|
||||
}
|
||||
},
|
||||
"message": "Update version.py to 0.1.2 [skip ci]\n\n(by utilitybelt/scripts/autotag_version.py)\n",
|
||||
"type": "commit",
|
||||
"parents": [
|
||||
{
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/263736ecc250113fad56a93f83b712093554ad42"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commit/263736ecc250113fad56a93f83b712093554ad42"
|
||||
}
|
||||
},
|
||||
"hash": "263736ecc250113fad56a93f83b712093554ad42",
|
||||
"type": "commit"
|
||||
}
|
||||
],
|
||||
"hash": "a0ec139843b2bb281ab21a433266ddc498e605dc",
|
||||
"author": {
|
||||
"raw": "scripts/autotag_version.py <utilitybelt@lightside>"
|
||||
}
|
||||
},
|
||||
"name": "0.1.2",
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/commits/tag/0.1.2"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/refs/tags/0.1.2"
|
||||
},
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity/commits/0.1.2"
|
||||
}
|
||||
},
|
||||
"type": "tag"
|
||||
},
|
||||
"truncated": false,
|
||||
"created": true,
|
||||
"old": null,
|
||||
"forced": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"name": "svc-identity",
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/lightsidelabs/svc-identity"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/svc-identity/avatar/16/"
|
||||
}
|
||||
},
|
||||
"is_private": true,
|
||||
"type": "repository",
|
||||
"scm": "git",
|
||||
"owner": {
|
||||
"username": "lightsidelabs",
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/lightsidelabs/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/teams/lightsidelabs"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/lightsidelabs/avatar/32/"
|
||||
}
|
||||
},
|
||||
"display_name": "LightSIDE Labs",
|
||||
"uuid": "{456c5f28-7338-4d89-9506-c7b889ba2d11}",
|
||||
"type": "team"
|
||||
},
|
||||
"full_name": "lightsidelabs/svc-identity",
|
||||
"uuid": "{3400bed9-5cde-45b9-8d86-c1dac5d5e610}"
|
||||
},
|
||||
"actor": {
|
||||
"username": "LightSide_CodeShip",
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/LightSide_CodeShip/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/LightSide_CodeShip"
|
||||
},
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/LightSide_CodeShip/avatar/32/"
|
||||
}
|
||||
},
|
||||
"display_name": "CodeShip Tagging",
|
||||
"uuid": "{d009ab20-b8b8-4840-9491-bfe72fbf666e}",
|
||||
"type": "user"
|
||||
}
|
||||
}
|
237
test/triggerjson/bitbucket_webhook.json
Normal file
237
test/triggerjson/bitbucket_webhook.json
Normal file
|
@ -0,0 +1,237 @@
|
|||
{
|
||||
"push": {
|
||||
"changes": [
|
||||
{
|
||||
"links": {
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commits?include=af64ae7188685f8424040b4735ad12941b980d75&exclude=1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
},
|
||||
"diff": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/diff/af64ae7188685f8424040b4735ad12941b980d75..1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/branches/compare/af64ae7188685f8424040b4735ad12941b980d75..1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
}
|
||||
},
|
||||
"old": {
|
||||
"name": "master",
|
||||
"links": {
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commits/master"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/branch/master"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/refs/branches/master"
|
||||
}
|
||||
},
|
||||
"type": "branch",
|
||||
"target": {
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/commits/1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commit/1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"user": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/jscoreos/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/jscoreos"
|
||||
}
|
||||
},
|
||||
"uuid": "{2fa27577-f361-45bb-999a-f4450c546b73}",
|
||||
"type": "user",
|
||||
"display_name": "Joseph Schorr",
|
||||
"username": "jscoreos"
|
||||
},
|
||||
"raw": "Joseph Schorr <joseph.schorr@coreos.com>"
|
||||
},
|
||||
"date": "2015-09-10T20:37:54+00:00",
|
||||
"parents": [
|
||||
{
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/commits/5329daa0961ec968de9ef36f30024bfa0da73103"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commit/5329daa0961ec968de9ef36f30024bfa0da73103"
|
||||
}
|
||||
},
|
||||
"type": "commit",
|
||||
"hash": "5329daa0961ec968de9ef36f30024bfa0da73103"
|
||||
}
|
||||
],
|
||||
"type": "commit",
|
||||
"message": "Dockerfile edited online with Bitbucket",
|
||||
"hash": "1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
}
|
||||
},
|
||||
"forced": false,
|
||||
"truncated": false,
|
||||
"commits": [
|
||||
{
|
||||
"author": {
|
||||
"user": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/jscoreos/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/jscoreos"
|
||||
}
|
||||
},
|
||||
"uuid": "{2fa27577-f361-45bb-999a-f4450c546b73}",
|
||||
"type": "user",
|
||||
"display_name": "Joseph Schorr",
|
||||
"username": "jscoreos"
|
||||
},
|
||||
"raw": "Joseph Schorr <joseph.schorr@coreos.com>"
|
||||
},
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/commits/af64ae7188685f8424040b4735ad12941b980d75"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commit/af64ae7188685f8424040b4735ad12941b980d75"
|
||||
}
|
||||
},
|
||||
"message": "Dockerfile edited online with Bitbucket",
|
||||
"type": "commit",
|
||||
"hash": "af64ae7188685f8424040b4735ad12941b980d75"
|
||||
}
|
||||
],
|
||||
"new": {
|
||||
"name": "master",
|
||||
"links": {
|
||||
"commits": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commits/master"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/branch/master"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/refs/branches/master"
|
||||
}
|
||||
},
|
||||
"type": "branch",
|
||||
"target": {
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/commits/af64ae7188685f8424040b4735ad12941b980d75"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commit/af64ae7188685f8424040b4735ad12941b980d75"
|
||||
}
|
||||
},
|
||||
"author": {
|
||||
"user": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/jscoreos/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/jscoreos"
|
||||
}
|
||||
},
|
||||
"uuid": "{2fa27577-f361-45bb-999a-f4450c546b73}",
|
||||
"type": "user",
|
||||
"display_name": "Joseph Schorr",
|
||||
"username": "jscoreos"
|
||||
},
|
||||
"raw": "Joseph Schorr <joseph.schorr@coreos.com>"
|
||||
},
|
||||
"date": "2015-09-10T20:40:54+00:00",
|
||||
"parents": [
|
||||
{
|
||||
"links": {
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/commits/1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo/commit/1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
}
|
||||
},
|
||||
"type": "commit",
|
||||
"hash": "1784139225279a587e0afb151bed1f9ba3dd509e"
|
||||
}
|
||||
],
|
||||
"type": "commit",
|
||||
"message": "Dockerfile edited online with Bitbucket",
|
||||
"hash": "af64ae7188685f8424040b4735ad12941b980d75"
|
||||
}
|
||||
},
|
||||
"closed": false,
|
||||
"created": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo/avatar/16/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/another-repo"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/repositories/jscoreos/another-repo"
|
||||
}
|
||||
},
|
||||
"full_name": "jscoreos/another-repo",
|
||||
"uuid": "{b3459203-3e58-497b-8059-ad087b6b01de}",
|
||||
"type": "repository",
|
||||
"is_private": true,
|
||||
"name": "Another Repo",
|
||||
"owner": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/jscoreos/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/jscoreos"
|
||||
}
|
||||
},
|
||||
"uuid": "{2fa27577-f361-45bb-999a-f4450c546b73}",
|
||||
"type": "user",
|
||||
"display_name": "Joseph Schorr",
|
||||
"username": "jscoreos"
|
||||
},
|
||||
"scm": "git"
|
||||
},
|
||||
"actor": {
|
||||
"links": {
|
||||
"avatar": {
|
||||
"href": "https://bitbucket.org/account/jscoreos/avatar/32/"
|
||||
},
|
||||
"html": {
|
||||
"href": "https://bitbucket.org/jscoreos/"
|
||||
},
|
||||
"self": {
|
||||
"href": "https://api.bitbucket.org/2.0/users/jscoreos"
|
||||
}
|
||||
},
|
||||
"uuid": "{2fa27577-f361-45bb-999a-f4450c546b73}",
|
||||
"type": "user",
|
||||
"display_name": "Joseph Schorr",
|
||||
"username": "jscoreos"
|
||||
}
|
||||
}
|
153
test/triggerjson/github_webhook.json
Normal file
153
test/triggerjson/github_webhook.json
Normal file
|
@ -0,0 +1,153 @@
|
|||
{
|
||||
"ref": "refs/heads/master",
|
||||
"before": "9ea43cab474709d4a61afb7e3340de1ffc405b41",
|
||||
"after": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"created": false,
|
||||
"deleted": false,
|
||||
"forced": false,
|
||||
"base_ref": null,
|
||||
"compare": "https://github.com/josephschorr/anothertest/compare/9ea43cab4747...410f4cdf8ff0",
|
||||
"commits": [
|
||||
{
|
||||
"id": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"distinct": true,
|
||||
"message": "Update Dockerfile",
|
||||
"timestamp": "2015-09-11T14:26:16-04:00",
|
||||
"url": "https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"author": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com",
|
||||
"username": "josephschorr"
|
||||
},
|
||||
"committer": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com",
|
||||
"username": "josephschorr"
|
||||
},
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"Dockerfile"
|
||||
]
|
||||
}
|
||||
],
|
||||
"head_commit": {
|
||||
"id": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"distinct": true,
|
||||
"message": "Update Dockerfile",
|
||||
"timestamp": "2015-09-11T14:26:16-04:00",
|
||||
"url": "https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"author": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com",
|
||||
"username": "josephschorr"
|
||||
},
|
||||
"committer": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com",
|
||||
"username": "josephschorr"
|
||||
},
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"Dockerfile"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"id": 34876107,
|
||||
"name": "anothertest",
|
||||
"full_name": "josephschorr/anothertest",
|
||||
"owner": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com"
|
||||
},
|
||||
"private": false,
|
||||
"html_url": "https://github.com/josephschorr/anothertest",
|
||||
"description": "",
|
||||
"fork": false,
|
||||
"url": "https://github.com/josephschorr/anothertest",
|
||||
"forks_url": "https://api.github.com/repos/josephschorr/anothertest/forks",
|
||||
"keys_url": "https://api.github.com/repos/josephschorr/anothertest/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/josephschorr/anothertest/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/josephschorr/anothertest/teams",
|
||||
"hooks_url": "https://api.github.com/repos/josephschorr/anothertest/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/josephschorr/anothertest/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/josephschorr/anothertest/events",
|
||||
"assignees_url": "https://api.github.com/repos/josephschorr/anothertest/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/josephschorr/anothertest/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/josephschorr/anothertest/tags",
|
||||
"blobs_url": "https://api.github.com/repos/josephschorr/anothertest/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/josephschorr/anothertest/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/josephschorr/anothertest/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/josephschorr/anothertest/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/josephschorr/anothertest/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/josephschorr/anothertest/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/josephschorr/anothertest/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/josephschorr/anothertest/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/josephschorr/anothertest/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/josephschorr/anothertest/subscription",
|
||||
"commits_url": "https://api.github.com/repos/josephschorr/anothertest/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/josephschorr/anothertest/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/josephschorr/anothertest/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/josephschorr/anothertest/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/josephschorr/anothertest/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/josephschorr/anothertest/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/josephschorr/anothertest/merges",
|
||||
"archive_url": "https://api.github.com/repos/josephschorr/anothertest/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/josephschorr/anothertest/downloads",
|
||||
"issues_url": "https://api.github.com/repos/josephschorr/anothertest/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/josephschorr/anothertest/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/josephschorr/anothertest/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/josephschorr/anothertest/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/josephschorr/anothertest/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/josephschorr/anothertest/releases{/id}",
|
||||
"created_at": 1430426945,
|
||||
"updated_at": "2015-04-30T20:49:05Z",
|
||||
"pushed_at": 1441995976,
|
||||
"git_url": "git://github.com/josephschorr/anothertest.git",
|
||||
"ssh_url": "git@github.com:josephschorr/anothertest.git",
|
||||
"clone_url": "https://github.com/josephschorr/anothertest.git",
|
||||
"svn_url": "https://github.com/josephschorr/anothertest",
|
||||
"homepage": null,
|
||||
"size": 144,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"open_issues_count": 0,
|
||||
"forks": 0,
|
||||
"open_issues": 0,
|
||||
"watchers": 0,
|
||||
"default_branch": "master",
|
||||
"stargazers": 0,
|
||||
"master_branch": "master"
|
||||
},
|
||||
"pusher": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com"
|
||||
},
|
||||
"sender": {
|
||||
"login": "josephschorr",
|
||||
"id": 4073002,
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4073002?v=3",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/josephschorr",
|
||||
"html_url": "https://github.com/josephschorr",
|
||||
"followers_url": "https://api.github.com/users/josephschorr/followers",
|
||||
"following_url": "https://api.github.com/users/josephschorr/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/josephschorr/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/josephschorr/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/josephschorr/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/josephschorr/orgs",
|
||||
"repos_url": "https://api.github.com/users/josephschorr/repos",
|
||||
"events_url": "https://api.github.com/users/josephschorr/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/josephschorr/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
}
|
||||
}
|
133
test/triggerjson/github_webhook_missing.json
Normal file
133
test/triggerjson/github_webhook_missing.json
Normal file
|
@ -0,0 +1,133 @@
|
|||
{
|
||||
"ref": "refs/heads/master",
|
||||
"before": "9ea43cab474709d4a61afb7e3340de1ffc405b41",
|
||||
"after": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"created": false,
|
||||
"deleted": false,
|
||||
"forced": false,
|
||||
"base_ref": null,
|
||||
"compare": "https://github.com/josephschorr/anothertest/compare/9ea43cab4747...410f4cdf8ff0",
|
||||
"commits": [
|
||||
{
|
||||
"id": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"distinct": true,
|
||||
"message": "Update Dockerfile",
|
||||
"timestamp": "2015-09-11T14:26:16-04:00",
|
||||
"url": "https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"Dockerfile"
|
||||
]
|
||||
}
|
||||
],
|
||||
"head_commit": {
|
||||
"id": "410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"distinct": true,
|
||||
"message": "Update Dockerfile",
|
||||
"timestamp": "2015-09-11T14:26:16-04:00",
|
||||
"url": "https://github.com/josephschorr/anothertest/commit/410f4cdf8ff09b87f245b13845e8497f90b90a4c",
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"Dockerfile"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"id": 34876107,
|
||||
"name": "anothertest",
|
||||
"full_name": "josephschorr/anothertest",
|
||||
"owner": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com"
|
||||
},
|
||||
"private": false,
|
||||
"html_url": "https://github.com/josephschorr/anothertest",
|
||||
"description": "",
|
||||
"fork": false,
|
||||
"url": "https://github.com/josephschorr/anothertest",
|
||||
"forks_url": "https://api.github.com/repos/josephschorr/anothertest/forks",
|
||||
"keys_url": "https://api.github.com/repos/josephschorr/anothertest/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/josephschorr/anothertest/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/josephschorr/anothertest/teams",
|
||||
"hooks_url": "https://api.github.com/repos/josephschorr/anothertest/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/josephschorr/anothertest/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/josephschorr/anothertest/events",
|
||||
"assignees_url": "https://api.github.com/repos/josephschorr/anothertest/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/josephschorr/anothertest/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/josephschorr/anothertest/tags",
|
||||
"blobs_url": "https://api.github.com/repos/josephschorr/anothertest/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/josephschorr/anothertest/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/josephschorr/anothertest/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/josephschorr/anothertest/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/josephschorr/anothertest/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/josephschorr/anothertest/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/josephschorr/anothertest/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/josephschorr/anothertest/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/josephschorr/anothertest/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/josephschorr/anothertest/subscription",
|
||||
"commits_url": "https://api.github.com/repos/josephschorr/anothertest/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/josephschorr/anothertest/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/josephschorr/anothertest/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/josephschorr/anothertest/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/josephschorr/anothertest/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/josephschorr/anothertest/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/josephschorr/anothertest/merges",
|
||||
"archive_url": "https://api.github.com/repos/josephschorr/anothertest/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/josephschorr/anothertest/downloads",
|
||||
"issues_url": "https://api.github.com/repos/josephschorr/anothertest/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/josephschorr/anothertest/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/josephschorr/anothertest/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/josephschorr/anothertest/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/josephschorr/anothertest/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/josephschorr/anothertest/releases{/id}",
|
||||
"created_at": 1430426945,
|
||||
"updated_at": "2015-04-30T20:49:05Z",
|
||||
"pushed_at": 1441995976,
|
||||
"git_url": "git://github.com/josephschorr/anothertest.git",
|
||||
"ssh_url": "git@github.com:josephschorr/anothertest.git",
|
||||
"clone_url": "https://github.com/josephschorr/anothertest.git",
|
||||
"svn_url": "https://github.com/josephschorr/anothertest",
|
||||
"homepage": null,
|
||||
"size": 144,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"open_issues_count": 0,
|
||||
"forks": 0,
|
||||
"open_issues": 0,
|
||||
"watchers": 0,
|
||||
"default_branch": "master",
|
||||
"stargazers": 0,
|
||||
"master_branch": "master"
|
||||
},
|
||||
"pusher": {
|
||||
"name": "josephschorr",
|
||||
"email": "josephschorr@users.noreply.github.com"
|
||||
},
|
||||
"sender": {
|
||||
"login": "josephschorr",
|
||||
"id": 4073002,
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/4073002?v=3",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/josephschorr",
|
||||
"html_url": "https://github.com/josephschorr",
|
||||
"followers_url": "https://api.github.com/users/josephschorr/followers",
|
||||
"following_url": "https://api.github.com/users/josephschorr/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/josephschorr/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/josephschorr/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/josephschorr/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/josephschorr/orgs",
|
||||
"repos_url": "https://api.github.com/users/josephschorr/repos",
|
||||
"events_url": "https://api.github.com/users/josephschorr/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/josephschorr/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
}
|
||||
}
|
149
test/triggerjson/github_webhook_noname.json
Normal file
149
test/triggerjson/github_webhook_noname.json
Normal file
|
@ -0,0 +1,149 @@
|
|||
{
|
||||
"ref": "refs/heads/master",
|
||||
"before": "9716b516939221dc754a056e0f9ddf599e71d4b8",
|
||||
"after": "118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"created": false,
|
||||
"deleted": false,
|
||||
"forced": false,
|
||||
"base_ref": null,
|
||||
"compare": "https://github.com/silas/docker-test/compare/9716b5169392...118b07121695",
|
||||
"commits": [
|
||||
{
|
||||
"id": "118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"distinct": true,
|
||||
"message": "Fail",
|
||||
"timestamp": "2015-09-25T14:55:11-04:00",
|
||||
"url": "https://github.com/silas/docker-test/commit/118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"author": {
|
||||
"name": "Silas Sewell",
|
||||
"email": "silas@sewell-fail.org"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Silas Sewell",
|
||||
"email": "silas@sewell-fail.org"
|
||||
},
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
],
|
||||
"head_commit": {
|
||||
"id": "118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"distinct": true,
|
||||
"message": "Fail",
|
||||
"timestamp": "2015-09-25T14:55:11-04:00",
|
||||
"url": "https://github.com/silas/docker-test/commit/118b07121695d9f2e40a5ff264fdcc2917680870",
|
||||
"author": {
|
||||
"name": "Silas Sewell",
|
||||
"email": "silas@sewell-fail.org"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Silas Sewell",
|
||||
"email": "silas@sewell-fail.org"
|
||||
},
|
||||
"added": [],
|
||||
"removed": [],
|
||||
"modified": [
|
||||
"README.md"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"id": 42467431,
|
||||
"name": "docker-test",
|
||||
"full_name": "silas/docker-test",
|
||||
"owner": {
|
||||
"name": "silas",
|
||||
"email": "silas@sewell.org"
|
||||
},
|
||||
"private": false,
|
||||
"html_url": "https://github.com/silas/docker-test",
|
||||
"description": "",
|
||||
"fork": false,
|
||||
"url": "https://github.com/silas/docker-test",
|
||||
"forks_url": "https://api.github.com/repos/silas/docker-test/forks",
|
||||
"keys_url": "https://api.github.com/repos/silas/docker-test/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/silas/docker-test/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/silas/docker-test/teams",
|
||||
"hooks_url": "https://api.github.com/repos/silas/docker-test/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/silas/docker-test/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/silas/docker-test/events",
|
||||
"assignees_url": "https://api.github.com/repos/silas/docker-test/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/silas/docker-test/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/silas/docker-test/tags",
|
||||
"blobs_url": "https://api.github.com/repos/silas/docker-test/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/silas/docker-test/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/silas/docker-test/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/silas/docker-test/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/silas/docker-test/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/silas/docker-test/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/silas/docker-test/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/silas/docker-test/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/silas/docker-test/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/silas/docker-test/subscription",
|
||||
"commits_url": "https://api.github.com/repos/silas/docker-test/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/silas/docker-test/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/silas/docker-test/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/silas/docker-test/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/silas/docker-test/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/silas/docker-test/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/silas/docker-test/merges",
|
||||
"archive_url": "https://api.github.com/repos/silas/docker-test/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/silas/docker-test/downloads",
|
||||
"issues_url": "https://api.github.com/repos/silas/docker-test/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/silas/docker-test/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/silas/docker-test/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/silas/docker-test/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/silas/docker-test/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/silas/docker-test/releases{/id}",
|
||||
"created_at": 1442254053,
|
||||
"updated_at": "2015-09-14T18:07:33Z",
|
||||
"pushed_at": 1443207315,
|
||||
"git_url": "git://github.com/silas/docker-test.git",
|
||||
"ssh_url": "git@github.com:silas/docker-test.git",
|
||||
"clone_url": "https://github.com/silas/docker-test.git",
|
||||
"svn_url": "https://github.com/silas/docker-test",
|
||||
"homepage": null,
|
||||
"size": 108,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"open_issues_count": 0,
|
||||
"forks": 0,
|
||||
"open_issues": 0,
|
||||
"watchers": 0,
|
||||
"default_branch": "master",
|
||||
"stargazers": 0,
|
||||
"master_branch": "master"
|
||||
},
|
||||
"pusher": {
|
||||
"name": "silas",
|
||||
"email": "silas@sewell.org"
|
||||
},
|
||||
"sender": {
|
||||
"login": "silas",
|
||||
"id": 18528,
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/18528?v=3",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/silas",
|
||||
"html_url": "https://github.com/silas",
|
||||
"followers_url": "https://api.github.com/users/silas/followers",
|
||||
"following_url": "https://api.github.com/users/silas/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/silas/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/silas/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/silas/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/silas/orgs",
|
||||
"repos_url": "https://api.github.com/users/silas/repos",
|
||||
"events_url": "https://api.github.com/users/silas/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/silas/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
}
|
||||
}
|
54
test/triggerjson/gitlab_webhook.json
Normal file
54
test/triggerjson/gitlab_webhook.json
Normal file
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"object_kind": "push",
|
||||
"before": "11fcaca195e8b17ca7e3dc47d9608d5b6b892f45",
|
||||
"after": "fb88379ee45de28a0a4590fddcbd8eff8b36026e",
|
||||
"ref": "refs/heads/master",
|
||||
"checkout_sha": "fb88379ee45de28a0a4590fddcbd8eff8b36026e",
|
||||
"message": null,
|
||||
"user_id": 95973,
|
||||
"user_name": "Jimmy Zelinskie",
|
||||
"user_email": "jimmyzelinskie@gmail.com",
|
||||
"project_id": 406414,
|
||||
"repository": {
|
||||
"name": "www-gitlab-com",
|
||||
"url": "git@gitlab.com:jzelinskie/www-gitlab-com.git",
|
||||
"description": "",
|
||||
"homepage": "https://gitlab.com/jzelinskie/www-gitlab-com",
|
||||
"git_http_url": "https://gitlab.com/jzelinskie/www-gitlab-com.git",
|
||||
"git_ssh_url": "git@gitlab.com:jzelinskie/www-gitlab-com.git",
|
||||
"visibility_level": 20
|
||||
},
|
||||
"commits": [
|
||||
{
|
||||
"id": "fb88379ee45de28a0a4590fddcbd8eff8b36026e",
|
||||
"message": "Fix link\n",
|
||||
"timestamp": "2015-08-13T19:33:18+00:00",
|
||||
"url": "https://gitlab.com/jzelinskie/www-gitlab-com/commit/fb88379ee45de28a0a4590fddcbd8eff8b36026e",
|
||||
"author": {
|
||||
"name": "Sytse Sijbrandij",
|
||||
"email": "sytse@gitlab.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "4ca166bc0b511f21fa331873f260f1a7cb38d723",
|
||||
"message": "Merge branch 'git-lfs' into 'master'\n\nGit lfs\n\n@JobV @dzaporozhets @DouweM please review the tone of this\n\nSee merge request !899\n",
|
||||
"timestamp": "2015-08-13T15:52:15+00:00",
|
||||
"url": "https://gitlab.com/jzelinskie/www-gitlab-com/commit/4ca166bc0b511f21fa331873f260f1a7cb38d723",
|
||||
"author": {
|
||||
"name": "Sytse Sijbrandij",
|
||||
"email": "sytse@gitlab.com"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "11fcaca195e8b17ca7e3dc47d9608d5b6b892f45",
|
||||
"message": "Merge branch 'release-7-3-5' into 'master'\n\n7-13-5 Release post.\n\nSee merge request !900\n",
|
||||
"timestamp": "2015-08-13T09:31:47+00:00",
|
||||
"url": "https://gitlab.com/jzelinskie/www-gitlab-com/commit/11fcaca195e8b17ca7e3dc47d9608d5b6b892f45",
|
||||
"author": {
|
||||
"name": "Valery Sizov",
|
||||
"email": "valery@gitlab.com"
|
||||
}
|
||||
}
|
||||
],
|
||||
"total_commits_count": 3
|
||||
}
|
Reference in a new issue