From b843fee8d90844535d7f3e1cf4eff18b22f1dcd9 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Tue, 27 Jul 2021 15:53:31 +0200 Subject: [PATCH] [FIX] runbot: adapt routes and licenses --- forwardport/__manifest__.py | 1 + runbot/__manifest__.py | 1 + runbot/controllers/badge.py | 2 +- runbot/controllers/frontend.py | 22 +++++++++++----------- runbot_cla/__manifest__.py | 1 + runbot_merge/__manifest__.py | 1 + 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/forwardport/__manifest__.py b/forwardport/__manifest__.py index f308a55e..185f8256 100644 --- a/forwardport/__manifest__.py +++ b/forwardport/__manifest__.py @@ -9,4 +9,5 @@ 'data/crons.xml', 'data/views.xml', ], + 'license': 'LGPL-3', } diff --git a/runbot/__manifest__.py b/runbot/__manifest__.py index 9f80fa05..7641d9be 100644 --- a/runbot/__manifest__.py +++ b/runbot/__manifest__.py @@ -55,4 +55,5 @@ 'wizards/mutli_build_wizard_views.xml', 'wizards/stat_regex_wizard_views.xml', ], + 'license': 'LGPL-3', } diff --git a/runbot/controllers/badge.py b/runbot/controllers/badge.py index 5396f90e..b5de642d 100644 --- a/runbot/controllers/badge.py +++ b/runbot/controllers/badge.py @@ -15,7 +15,7 @@ class RunbotBadge(Controller): '/runbot/badge/trigger//.svg', '/runbot/badge///.svg', '/runbot/badge/trigger///.svg', - ], type="http", auth="public", methods=['GET', 'HEAD']) + ], type="http", auth="public", methods=['GET', 'HEAD'], sitemap=False) def badge(self, name, repo_id=False, trigger_id=False, theme='default'): # Sudo is used here to allow the badge to be returned for projects # which have restricted permissions. diff --git a/runbot/controllers/frontend.py b/runbot/controllers/frontend.py index f8986dc3..17b72dc3 100644 --- a/runbot/controllers/frontend.py +++ b/runbot/controllers/frontend.py @@ -179,7 +179,7 @@ class Runbot(Controller): @route([ '/runbot/bundle/', '/runbot/bundle//page/' - ], website=True, auth='public', type='http') + ], website=True, auth='public', type='http', sitemap=False) def bundle(self, bundle=None, page=1, limit=50, **kwargs): domain = [('bundle_id', '=', bundle.id), ('hidden', '=', False)] batch_count = request.env['runbot.batch'].search_count(domain) @@ -212,7 +212,7 @@ class Runbot(Controller): batch._prepare(auto_rebase) return werkzeug.utils.redirect('/runbot/batch/%s' % batch.id) - @route(['/runbot/batch/'], website=True, auth='public', type='http') + @route(['/runbot/batch/'], website=True, auth='public', type='http', sitemap=False) def batch(self, batch_id=None, **kwargs): batch = request.env['runbot.batch'].browse(batch_id) context = { @@ -227,7 +227,7 @@ class Runbot(Controller): build = slot.sudo()._create_missing_build() return werkzeug.utils.redirect('/runbot/build/%s' % build.id) - @route(['/runbot/commit/'], website=True, auth='public', type='http') + @route(['/runbot/commit/'], website=True, auth='public', type='http', sitemap=False) def commit(self, commit=None, **kwargs): status_list = request.env['runbot.commit.status'].search([('commit_id', '=', commit.id)], order='id desc') last_status_by_context = dict() @@ -275,7 +275,7 @@ class Runbot(Controller): return werkzeug.utils.redirect(build.build_url) - @route(['/runbot/build/'], type='http', auth="public", website=True) + @route(['/runbot/build/'], type='http', auth="public", website=True, sitemap=False) def build(self, build_id, search=None, **post): """Events/Logs""" @@ -295,7 +295,7 @@ class Runbot(Controller): @route([ '/runbot/branch/', - ], website=True, auth='public', type='http') + ], website=True, auth='public', type='http', sitemap=False) def branch(self, branch=None, **kwargs): pr_branch = branch.bundle_id.branch_ids.filtered(lambda rec: not rec.is_pr and rec.id != branch.id and rec.remote_id.repo_id == branch.remote_id.repo_id)[:1] branch_pr = branch.bundle_id.branch_ids.filtered(lambda rec: rec.is_pr and rec.id != branch.id and rec.remote_id.repo_id == branch.remote_id.repo_id)[:1] @@ -312,7 +312,7 @@ class Runbot(Controller): @route([ '/runbot/glances', '/runbot/glances/' - ], type='http', auth='public', website=True) + ], type='http', auth='public', website=True, sitemap=False) def glances(self, project_id=None, **kwargs): project_ids = [project_id] if project_id else request.env['runbot.project'].search([]).ids # search for access rights bundles = request.env['runbot.bundle'].search([('sticky', '=', True), ('project_id', 'in', project_ids)]) @@ -327,7 +327,7 @@ class Runbot(Controller): @route(['/runbot/monitoring', '/runbot/monitoring/', - '/runbot/monitoring//'], type='http', auth='user', website=True) + '/runbot/monitoring//'], type='http', auth='user', website=True, sitemap=False) def monitoring(self, category_id=None, view_id=None, **kwargs): pending = self._pending() hosts_data = request.env['runbot.host'].search([]) @@ -353,7 +353,7 @@ class Runbot(Controller): return request.render(view_id if view_id else "runbot.monitoring", qctx) @route(['/runbot/errors', - '/runbot/errors/page/'], type='http', auth='user', website=True) + '/runbot/errors/page/'], type='http', auth='user', website=True, sitemap=False) def build_errors(self, error_id=None, sort=None, page=1, limit=20, **kwargs): sort_order_choices = { 'last_seen_date desc': 'Last seen date: Newer First', @@ -387,7 +387,7 @@ class Runbot(Controller): } return request.render('runbot.build_error', qctx) - @route(['/runbot/build/stats/'], type='http', auth="public", website=True) + @route(['/runbot/build/stats/'], type='http', auth="public", website=True, sitemap=False) def build_stats(self, build_id, search=None, **post): """Build statistics""" @@ -413,7 +413,7 @@ class Runbot(Controller): return request.render("runbot.build_stats", context) - @route(['/runbot/stats/'], type='json', auth="public", website=False) + @route(['/runbot/stats/'], type='json', auth="public", website=False, sitemap=False) def stats_json(self, bundle_id=False, trigger_id=False, key_category='', center_build_id=False, limit=100, search=None, **post): """ Json stats """ trigger_id = trigger_id and int(trigger_id) @@ -445,7 +445,7 @@ class Runbot(Controller): res.setdefault(builds_id, {})[key.split('.')[1]] = value return res - @route(['/runbot/stats//'], type='http', auth="public", website=True) + @route(['/runbot/stats//'], type='http', auth="public", website=True, sitemap=False) def modules_stats(self, bundle, trigger, search=None, **post): """Modules statistics""" diff --git a/runbot_cla/__manifest__.py b/runbot_cla/__manifest__.py index a7cbd624..0f393fc2 100644 --- a/runbot_cla/__manifest__.py +++ b/runbot_cla/__manifest__.py @@ -9,4 +9,5 @@ 'data': [ 'data/runbot_build_config_data.xml', ], + 'license': 'LGPL-3', } diff --git a/runbot_merge/__manifest__.py b/runbot_merge/__manifest__.py index f990e6d1..2677ad40 100644 --- a/runbot_merge/__manifest__.py +++ b/runbot_merge/__manifest__.py @@ -13,4 +13,5 @@ ], 'post_load': 'enable_sentry', 'pre_init_hook': '_check_citext', + 'license': 'LGPL-3', }