[IMP] runbot_merge: add staging status to dashboard

The dashboard can be a bit unclear as to the state of a PR when
everything's gone well. Make it more clear / explicit that it's ready
or staged.

Fixes #888
This commit is contained in:
Xavier Morel 2024-06-07 15:51:26 +02:00
parent ceb2bd457e
commit f4035932e3
2 changed files with 10 additions and 1 deletions

View File

@ -287,10 +287,12 @@ def raster_render(pr):
'' if p['checked'] else 'unchecked', '' if p['checked'] else 'unchecked',
'' if p['reviewed'] else 'unreviewed', '' if p['reviewed'] else 'unreviewed',
'' if p['attached'] else 'detached', '' if p['attached'] else 'detached',
'staged' if p['pr'].staging_id else 'ready' if p['pr']._ready else ''
]): ]):
label = f' {attribute}' label = f' {attribute}'
color = SUCCESS if attribute in ('staged', 'ready') else ERROR
draw.text((offset, top), label, draw.text((offset, top), label,
fill=blend(ERROR, opacity, over=background), fill=blend(color, opacity, over=background),
font=supfont) font=supfont)
offset += supfont.getbbox(label)[2] offset += supfont.getbbox(label)[2]
offset += math.ceil(supfont.getlength(" ")) offset += math.ceil(supfont.getlength(" "))
@ -302,6 +304,7 @@ def raster_render(pr):
Color = Tuple[int, int, int] Color = Tuple[int, int, int]
TEXT: Color = (102, 102, 102) TEXT: Color = (102, 102, 102)
ERROR: Color = (220, 53, 69) ERROR: Color = (220, 53, 69)
SUCCESS: Color = (40, 167, 69)
BG: Mapping[str | None, Color] = collections.defaultdict(lambda: (255, 255, 255), { BG: Mapping[str | None, Color] = collections.defaultdict(lambda: (255, 255, 255), {
'info': (217, 237, 247), 'info': (217, 237, 247),
'success': (223, 240, 216), 'success': (223, 240, 216),

View File

@ -597,6 +597,12 @@ action = batches
<sup t-if="not p['attached']" <sup t-if="not p['attached']"
t-attf-title="detached: {{p['pr'].detach_reason}}" t-attf-title="detached: {{p['pr'].detach_reason}}"
class="text-warning fa fa-unlink"/> class="text-warning fa fa-unlink"/>
<sup t-if="p['pr'].staging_id" class="text-success">
staged
</sup>
<sup t-elif="p['pr']._ready" class="text-success">
ready
</sup>
</span> </span>
</td> </td>
<td t-else=""/> <td t-else=""/>