From 02174146e5d8aea521c198e163347c4cda1be297 Mon Sep 17 00:00:00 2001 From: "Moises Lopez - https://www.vauxoo.com/" Date: Fri, 29 Jul 2016 16:49:58 -0500 Subject: [PATCH] [REF] runbot: Support repository name with dot http://github.com/owner/repository.name.git to sent github statuses (#91) --- runbot/runbot.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/runbot/runbot.py b/runbot/runbot.py index 8c4629ad..3a2c6ed0 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -252,7 +252,7 @@ def github(self, cr, uid, ids, url, payload=None, ignore_errors=False, context=N if not repo.token: return try: - match_object = re.search('([^/]+)/([^/]+)/([^/.]+(.git)?)', repo.base) + match_object = re.search('([^/]+)/([^/]+)/([^/]+)', repo.base) if match_object: url = url.replace(':owner', match_object.group(2)) url = url.replace(':repo', match_object.group(3)) @@ -584,9 +584,9 @@ def create(self, cr, uid, values, context=None): # detect duplicate domain = [ - ('repo_id','=',build.repo_id.duplicate_id.id), - ('name', '=', build.name), - ('duplicate_id', '=', False), + ('repo_id','=',build.repo_id.duplicate_id.id), + ('name', '=', build.name), + ('duplicate_id', '=', False), '|', ('result', '=', False), ('result', '!=', 'skipped') ] duplicate_ids = self.search(cr, uid, domain, context=context) @@ -1209,7 +1209,7 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post): repo_ids = repo_obj.search(cr, uid, []) repos = repo_obj.browse(cr, uid, repo_ids) if not repo and repos: - repo = repos[0] + repo = repos[0] context = { 'repos': repos, @@ -1243,20 +1243,20 @@ def repo(self, repo=None, search='', limit='100', refresh='', **post): branch_ids = uniq_list(sticky_branch_ids + [br[0] for br in cr.fetchall()]) build_query = """ - SELECT - branch_id, + SELECT + branch_id, max(case when br_bu.row = 1 then br_bu.build_id end), max(case when br_bu.row = 2 then br_bu.build_id end), max(case when br_bu.row = 3 then br_bu.build_id end), max(case when br_bu.row = 4 then br_bu.build_id end) FROM ( - SELECT - br.id AS branch_id, + SELECT + br.id AS branch_id, bu.id AS build_id, row_number() OVER (PARTITION BY branch_id) AS row - FROM - runbot_branch br INNER JOIN runbot_build bu ON br.id=bu.branch_id - WHERE + FROM + runbot_branch br INNER JOIN runbot_build bu ON br.id=bu.branch_id + WHERE br.id in %s GROUP BY br.id, bu.id ORDER BY br.id, bu.id DESC