Showing with 24 additions and 10 deletions.
  1. +2 −1 .py3.notworking.txt
  2. +22 −9 master/buildbot/reporters/gitlab.py
@@ -29,7 +29,8 @@ buildbot.test.unit.test_db_pool.BasicWithDebug.test_do_error
buildbot.test.unit.test_db_pool.BasicWithDebug.test_do_exception
buildbot.test.unit.test_pbmanager.TestPBManager.test_register_unregister
buildbot.test.unit.test_process_buildstep.TestBuildStep.testcheckWorkerHasCommandTooOld
buildbot.test.unit.test_reporter_gitlab.TestGitLabStatusPush.test_basic
buildbot.test.unit.test_process_users_manual.TestCommandlineUserManagerPerspective.test_perspective_commandline_get_format
buildbot.test.unit.test_reporter_github.TestGitHubStatusPush.test_basic
buildbot.test.unit.test_reporters_irc.TestIrcStatusBot.test_chat
buildbot.test.unit.test_reporters_irc.TestIrcStatusBot.test_groupChat
buildbot.test.unit.test_reporters_words.TestContactChannel.test_command_notify0
@@ -31,6 +31,7 @@
from buildbot.process.results import SUCCESS
from buildbot.process.results import WARNINGS
from buildbot.reporters import http
from buildbot.util import bytes2NativeString
from buildbot.util import httpclientservice

HOSTED_BASE_URL = 'https://gitlab.com'
@@ -129,9 +130,9 @@ def send(self, build):

# retrieve project id via cache
self.project_ids
project_full_name = "%s%%2F%s" % (
repoOwner.encode('utf-8'),
repoName.encode('utf-8'))
project_full_name = "%s%%2F%s" % (repoOwner, repoName)
project_full_name = project_full_name.encode("utf-8")
project_full_name = bytes2NativeString(project_full_name)

if project_full_name not in self.project_ids:
proj = yield self._http.get('/api/v3/projects/%s' % (project_full_name))
@@ -142,14 +143,26 @@ def send(self, build):
for sourcestamp in sourcestamps:
sha = sourcestamp['revision']
try:
branch = branch.encode('utf-8')
branch = bytes2NativeString(branch, encoding='utf-8')
sha = sha.encode('utf-8')
sha = bytes2NativeString(sha, encoding='utf-8')
state = state.encode('utf-8')
state = bytes2NativeString(state, encoding='utf-8')
target_url = build['url'].encode('utf-8')
target_url = bytes2NativeString(target_url, encoding='utf-8')
context = context.encode('utf-8')
context = bytes2NativeString(context, encoding='utf-8')
description = description.encode('utf-8')
description = bytes2NativeString(description, encoding='utf-8')
res = yield self.createStatus(
project_id=proj_id,
branch=branch.encode('utf-8'),
sha=sha.encode('utf-8'),
state=state.encode('utf-8'),
target_url=build['url'].encode('utf-8'),
context=context.encode('utf-8'),
description=description.encode('utf-8')
branch=branch,
sha=sha,
state=state,
target_url=target_url,
context=context,
description=description
)
if res.code not in (200, 201, 204):
message = yield res.json()