Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPD]runbot:add sequence field to help repository in order #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions runbot/runbot.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def local_pgadmin_cursor():

class runbot_repo(osv.osv):
_name = "runbot.repo"
_order = 'id'
_order = 'sequence'

def _get_path(self, cr, uid, ids, field_name, arg, context=None):
root = self.root(cr, uid)
Expand All @@ -193,6 +193,7 @@ def _get_base(self, cr, uid, ids, field_name, arg, context=None):

_columns = {
'name': fields.char('Repository', required=True),
'sequence': fields.integer('Sequence'),
'path': fields.function(_get_path, type='char', string='Directory', readonly=1),
'base': fields.function(_get_base, type='char', string='Base URL', readonly=1),
'nginx': fields.boolean('Nginx'),
Expand All @@ -219,6 +220,7 @@ def _get_base(self, cr, uid, ids, field_name, arg, context=None):
'mode': 'poll',
'modules_auto': 'repo',
'job_timeout': 30,
'sequence': 10,
}

def domain(self, cr, uid, context=None):
Expand Down Expand Up @@ -595,9 +597,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 @@ -1225,7 +1227,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
2 changes: 2 additions & 0 deletions runbot/runbot.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<button name="killall" type="object" string="Killall" groups="runbot.group_runbot_admin"/>
</div>
<group string="Params">
<field name="sequence"/>
<field name="mode"/>
<field name="nginx"/>
<field name="duplicate_id"/>
Expand All @@ -36,6 +37,7 @@
<field name="model">runbot.repo</field>
<field name="arch" type="xml">
<tree string="repos">
<field name="sequence"/>
<field name="name"/>
<field name="mode"/>
</tree>
Expand Down