Skip to content
Draft
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
49 changes: 47 additions & 2 deletions runbot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,59 @@
'runbot/static/src/js/components/*',
],
'runbot.assets_frontend': [
# used by website.pager
'web/static/lib/odoo_ui_icons/style.css',

# module loader
'web/static/src/module_loader.js',

# requirements for Interaction/InteractionService
'web/static/lib/owl/owl.js',
'web/static/lib/owl/odoo_module.js',
'web/static/lib/luxon/luxon.js',
'web/static/src/env.js',
'web/static/src/session.js',
'web/static/src/core/assets.js',
'web/static/src/core/templates.js',
'web/static/src/core/registry.js',
'web/static/src/core/template_inheritance.js',
'web/static/src/core/user.js',
'web/static/src/core/browser/feature_detection.js',
'web/static/src/core/browser/browser.js',
'web/static/src/core/browser/cookie.js',
'web/static/src/core/network/rpc.js',
'web/static/src/core/utils/arrays.js',
'web/static/src/core/utils/hooks.js',
'web/static/src/core/utils/cache.js',
'web/static/src/core/utils/concurrency.js',
'web/static/src/core/utils/functions.js',
'web/static/src/core/utils/html.js',
'web/static/src/core/utils/objects.js',
'web/static/src/core/utils/render.js',
'web/static/src/core/utils/timing.js',
'web/static/src/core/utils/ui.js',
'web/static/src/core/utils/urls.js',
'web/static/src/core/utils/strings.js',
'web/static/src/core/utils/indexed_db.js',
'web/static/src/core/l10n/translation.js',
'web/static/src/core/l10n/localization.js',
'web/static/src/core/l10n/dates.js',
'web/static/src/core/l10n/localization_service.js',
'web/static/src/core/l10n/utils.js',
'web/static/src/core/l10n/utils/format_list.js',
'web/static/src/core/l10n/utils/locales.js',
'web/static/src/core/l10n/utils/normalize.js',
'web/static/src/public/utils.js',
'web/static/src/public/colibri.js',
'web/static/src/public/interaction.js',
'web/static/src/public/interaction_service.js',

'runbot/static/lib/bootstrap/css/bootstrap.css',
'runbot/static/lib/fontawesome/css/font-awesome.css',
'runbot/static/src/css/runbot.css',

'runbot/static/lib/jquery/jquery.js',
'runbot/static/lib/bootstrap/js/bootstrap.bundle.js',
'runbot/static/src/js/runbot.js',
'runbot/static/src/public/**/*',
],
},
'post_load': 'runbot_post_load',
Expand Down
25 changes: 17 additions & 8 deletions runbot/controllers/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from odoo.http import Controller, Response, request
from odoo.http import route as o_route
from odoo.fields import Domain
from odoo.tools.json import json_default

from odoo.addons.website.controllers.main import QueryURL

Expand Down Expand Up @@ -63,6 +64,13 @@ def response_wrap(*args, **kwargs):
return response_wrap
return decorator


def json_default_set(obj):
if isinstance(obj, set):
return list(obj)
return json_default(obj)


class Runbot(Controller):

def _pending(self):
Expand Down Expand Up @@ -596,8 +604,7 @@ def modules_stats(self, bundle, search=None, **post):
all_builds |= bundle.with_context(category_id=request.env.ref('runbot.nightly_category').id).last_done_batch.slot_ids.build_id
all_builds = request.env['runbot.build'].search([('id', 'child_of', all_builds.ids)])
all_stats = all_builds.sudo().stat_ids
category_per_trigger = {}
step_per_trigger_category = {}
triggers_relations = {}
all_categories = set()
all_steps = set()
all_triggers = set()
Expand All @@ -608,18 +615,20 @@ def modules_stats(self, bundle, search=None, **post):
all_categories.add(stat.category)
all_steps.add(stat.dynamic_step_name or stat.config_step_id.name)
all_triggers.add(stat_trigger)
category_per_trigger.setdefault(stat_trigger, set()).add(stat.category)
step_per_trigger_category.setdefault((stat_trigger, stat.category), set()).add(stat.dynamic_step_name or stat.config_step_id.name)
triggers_relations.setdefault(stat_trigger.id, dict()).setdefault(stat.category, set()).add(stat.dynamic_step_name or stat.config_step_id.name)
all_triggers = sorted(all_triggers, key=lambda t: (t.category_id.id, t.sequence, t.id))
main_trigger = all_triggers[0] if all_triggers else None
context = {
'category_per_trigger': category_per_trigger,
'step_per_trigger_category': step_per_trigger_category,
'bundle': bundle,
'main_trigger': main_trigger,
'project': bundle.project_id,
'triggers_data': {
'bundle_id': bundle.id,
'trigger_id': all_triggers[0].id if all_triggers else None,
'relations': triggers_relations,
},
'all_categories': sorted(all_categories),
'all_steps': sorted(all_steps),
'all_triggers': all_triggers,
'json_default': json_default_set,
}
return request.render("runbot.modules_stats", context)

Expand Down
37 changes: 0 additions & 37 deletions runbot/static/lib/jquery/jquery.browser.js

This file was deleted.

Loading