5
0
mirror of https://github.com/odoo/runbot.git synced 2025-03-21 18:35:45 +07:00
runbot/runbot_merge/views/runbot_merge_project.xml
Xavier Morel fec3d39d19 [ADD] *: per-repository webhook secret
Currently webhook secrets are configured per *project* which is an
issue both because different repositories may have different
administrators and thus creates safety concerns, and because multiple
repositories can feed into different projects (e.g. on mergebot,
odoo-dev/odoo is both an ancillary repository to the main RD project,
and the main repository to the minor / legacy master-wowl
project). This means it can be necessary to have multiple projects
share the same secret as well, this then mandates the secret for more
repositories per (1).

This is a pain in the ass, so just detach secrets from projects and
link them *only* to repositories, it's cleaner and easier to manage
and set up progressively.

This requires a lot of changes to the tests, as they all need to
correctly configure the signaling.

For `runbot_merge` there was *some* setup sharing already via the
module-level `repo` fixtures`, those were merged into a conftest-level
fixture which could handle the signaling setup. A few tests which
unnecessarily set up repositories ad-hoc were also moved to the
fixture. But for most of the ad-hoc setup in `runbot_merge`, as well
as `forwardport` where it's all ad-hoc, events sources setup was just
appended as is. This should probably be cleaned up at one point, with
the various requirements collected and organised into a small set of
fixtures doing the job more uniformly.

Fixes 
2024-06-06 11:07:57 +02:00

98 lines
4.7 KiB
XML

<odoo>
<record id="runbot_merge_form_project" model="ir.ui.view">
<field name="name">Project Form</field>
<field name="model">runbot_merge.project</field>
<field name="arch" type="xml">
<form>
<field name="freeze_id" invisible="1"/>
<header>
<button type="object" name="action_prepare_freeze"
string="Freeze"
attrs="{'invisible': [('freeze_id', '!=', False)]}"/>
<button type="object" name="action_prepare_freeze"
string="View Freeze" class="oe_highlight"
attrs="{'invisible': [('freeze_id', '=', False)]}"/>
</header>
<sheet>
<div class="oe_title">
<h1><field name="name" placeholder="Name"/></h1>
</div>
<group>
<group>
<field name="github_prefix" string="bot name"/>
</group>
</group>
<group>
<group>
<field name="github_token"/>
<field name="github_name" readonly="0"
help="Identity when creating new commits, defaults to github name, falls back to login."/>
<field name="github_email" readonly="0"
help="Identity when creating new commits, defaults to public email, falls back to primary email."/>
<span attrs="{'invisible': [
'|',
('staging_statuses', '=', False),
('staging_rpc', '=', False),
]}" class="alert alert-warning" role="alert">
Avoid overlaps between GH and RPC as the older
GH statuses may overwrite more recent RPC statuses.
</span>
<field name="staging_statuses" string="Validate via GH statuses"/>
<field name="staging_rpc" string="Validate via direct RPC"/>
</group>
<group>
<field name="staging_enabled" widget="boolean_toggle"/>
<field name="staging_priority"/>
<field name="uniquifier"/>
<field name="ci_timeout"/>
<field name="batch_limit"/>
</group>
</group>
<group class="oe_edit_only">
<group colspan="4">
<label for="freeze_reminder">
Reminder to show after freeze
</label>
<field colspan="4" name="freeze_reminder" nolabel="1"/>
</group>
</group>
<separator string="Repositories"/>
<field name="repo_ids">
<tree>
<field name="sequence" widget="handle"/>
<button type="object" name="get_formview_action" icon="fa-external-link"/>
<field name="name"/>
<field name="branch_filter"/>
<field name="status_ids" widget="many2many_tags"/>
</tree>
</field>
<separator string="Branches"/>
<field name="branch_ids">
<tree editable="bottom" decoration-muted="not active">
<field name="sequence" widget="handle" />
<button type="object" name="get_formview_action" icon="fa-external-link"/>
<field name="name"/>
<field name="active" widget="boolean_toggle"/>
<field name="staging_enabled" widget="boolean_toggle"/>
</tree>
</field>
</sheet>
</form>
</field>
</record>
<record id="project_freeze_reminder" model="ir.ui.view">
<field name="name">Project Form</field>
<field name="model">runbot_merge.project</field>
<field name="arch" type="xml">
<form>
<sheet>
<field name="freeze_reminder" nolabel="1" readonly="1"/>
</sheet>
</form>
</field>
</record>
</odoo>