[FIX] runbot_merge: avoid disappearing closed batches from stagings

This is only a temporary / partial fix (see #1100 for further issues)
but it solves the most obvious problem of a batch having a single PR,
being staged, the staging fails, the PR gets closed, and the batch
disappearing from the staging.

The issue remains that stagings don't actually reflect the state as of
the staging, since they link to the updated version of batches rather
than the version as of staging. That probably can't be fixed if we
want to keep track of everything *but* for documentary and display
purposes the staging should store the state of batches and
PRs (e.g. as JSON) as of its creation.

Fixes #1079
This commit is contained in:
Xavier Morel 2025-03-13 12:21:21 +01:00
parent d5996c4ae1
commit 884306428e

View File

@ -195,10 +195,18 @@
</t>
<li t-attf-class="staging {{stateclass.strip()}} {{decorationclass.strip()}}" t-att-title="title.strip() or None">
<ul class="list-unstyled">
<li t-foreach="staging.batch_ids" t-as="batch" class="batch">
<t t-esc="batch.prs[:1].label"/>
<t t-foreach="batch.prs" t-as="pr">
<t t-call="runbot_merge.link-pr"/>
<li t-foreach="staging.batch_ids" t-as="batch"
t-attf-class="batch {{'' if batch.active else 'text-decoration-line-through'}}">
<t t-esc="batch.name"/>
<t t-if="batch.active">
<t t-foreach="batch.prs" t-as="pr">
<t t-call="runbot_merge.link-pr"/>
</t>
</t>
<t t-else="">
<t t-foreach="batch.all_prs" t-as="pr">
<t t-call="runbot_merge.link-pr"/>
</t>
</t>
</li>
</ul>