Skip to content
Closed
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
51 changes: 51 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"extends": ["eslint:recommended"],
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2022
},
"env": {
"browser": true,
"es6": true
},
"rules": {
"no-undef": ["error"],
"no-restricted-globals": ["error", "event", "self"],
"no-const-assign": ["error"],
"no-debugger": ["error"],
"no-dupe-class-members": ["error"],
"no-dupe-keys": ["error"],
"no-dupe-args": ["error"],
"no-dupe-else-if": ["error"],
"no-unsafe-negation": ["error"],
"no-duplicate-imports": ["error"],
"valid-typeof": ["error"],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }],
"curly": ["error", "all"],
"no-restricted-syntax": ["error", "PrivateIdentifier"],
"prefer-const": ["error", {
"destructuring": "all",
"ignoreReadBeforeAssign": true
}],
"no-console": ["warn"],
"no-var": ["error"],
"arrow-body-style": ["error", "as-needed"],
"arrow-parens": ["error"],
"brace-style": ["error"],
"object-curly-spacing": ["error", "always"],
"array-bracket-spacing": ["error"],
"comma-dangle": ["error", "always-multiline"],
"semi": ["error", "always"],
"quotes": ["error", "double"],
"indent": ["error", 4, { "SwitchCase": 1 }],
"eol-last": ["error"],
"no-multiple-empty-lines": ["error"],
"no-trailing-spaces": ["error"]
},
"globals": {
"diff_match_patch": "readonly",
"$": "readonly",
"jQuery": "readonly",
"Chart": "readonly"
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ runbot/static/nginx
runbot/static/databases
runbot/static/docker
runbot/static/docker-registry
# npm files
node_modules
package-lock.json
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"devDependencies": {
"eslint": "^8.27.0"
}
}
50 changes: 47 additions & 3 deletions runbot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,58 @@
'runbot/static/src/js/components/*',
],
'runbot.assets_frontend': [
'web/static/lib/odoo_ui_icons/style.css',
'web/static/lib/odoo_ui_icons/style.css', # because website.pager

# 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