Skip to content

Commit

Permalink
Revert "[REF] runbot: Support repository name with dot http://github.…
Browse files Browse the repository at this point in the history
…com/owner/repository.name.git to sent github statuses" (odoo#93)

Reverts Vauxoo#91

Final solution was change the repository of name removing dots
  • Loading branch information
moylop260 authored Feb 13, 2017
1 parent 0217414 commit 2e048e2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions runbot/runbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('([^/]+)/([^/]+)/([^/]+)', repo.base)
match_object = re.search('([^/]+)/([^/]+)/([^/.]+(.git)?)', repo.base)
if match_object:
url = url.replace(':owner', match_object.group(2))
url = url.replace(':repo', match_object.group(3))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2e048e2

Please sign in to comment.