[ADD] mergebot, forwardbot: changelog

* Adds a changelog page, linked from the main, with content
  automatically loaded from the source. To avoid conflicts, each entry
  is its own file and entries are grouped by the month during which
  the update will (probably) be deployed
* The last group (most likely "last update") doesn't have a title, the
  rest do.
* Add changelog entries from the last update so it's not too empty.
* Also update the layout for the alerts a bit: remove bottom margin to
  reduce loss of whitespace.
This commit is contained in:
Xavier Morel 2021-10-20 14:28:29 +02:00
parent bce0836aa9
commit 0e087e7433
34 changed files with 96 additions and 3 deletions

View File

@ -1 +1,2 @@
from . import models
from . import controllers

View File

@ -0,0 +1 @@
FIX: the deduplication of authorship in case of conflicts in multi-commit PRs

View File

@ -0,0 +1 @@
FIX: loss of authorship on conflicts in multi-commit PRs, such conflicts now generate a commit with no authorship information, which can not be merged

View File

@ -0,0 +1 @@
ADD: better localisation of conflicts in multi-PR commits, list all the commits in the comment and add an arrow pointing to the one which broke

View File

@ -0,0 +1 @@
REM: creation of forward ports in draft mode

View File

@ -0,0 +1 @@
FIX: some feedback messages didn't correctly ping the person being replied to

View File

@ -0,0 +1 @@
IMP: properly notify the user when an update to a pull request causes a conflict when impacted on the followup

View File

@ -0,0 +1 @@
IMP: add the forward-port remote to the repository view, so it can be set via the UI

View File

@ -0,0 +1 @@
IMP: error messages when trying to `@fw-bot r+` on pull requests not under its purview

View File

@ -0,0 +1 @@
ADD: list of outstanding forward-ports

View File

@ -0,0 +1 @@
FIX: allow delegate reviewers *on forward ports* to approve the followups, it worked fine for delegates on the original pull request but a delegation on a forward port would only work for that specific PR (note: only works if the followups don't already exist)

View File

@ -0,0 +1 @@
FIX: rare condition where updating a forwardport would then require all followups to be individually approved

View File

@ -0,0 +1 @@
FIX: don't trigger an error message when using `fw-bot r+` and some of the PRs were already approved

View File

@ -0,0 +1 @@
IMP: layout and features of the "outstanding forward port" page, show the oldest-merged PRs first and allow filtering by reviewer

View File

@ -0,0 +1,15 @@
import pathlib
from odoo.addons.runbot_merge.controllers.dashboard import MergebotDashboard
class Dashboard(MergebotDashboard):
def _entries(self):
changelog = pathlib.Path(__file__).parent / 'changelog'
if not changelog.is_dir():
return super()._entries()
return super()._entries() + [
(d.name, [f.read_text(encoding='utf-8') for f in d.iterdir() if f.is_file()])
for d in changelog.iterdir()
]

View File

@ -13,7 +13,7 @@
('source_id', '!=', False),
('state', 'not in', ['merged', 'closed']),
])"/>
<div t-if="outstanding != 0" class="alert col-md-12 bg-warning">
<div t-if="outstanding != 0" class="alert col-md-12 alert-warning mb-0">
<a href="/forwardport/outstanding">
<t t-esc="outstanding"/> outstanding forward-ports
</a>

View File

@ -0,0 +1 @@
ADD: refuse merging commits without an email set, this is mostly to be used by the forwardport-bot

View File

@ -0,0 +1 @@
FIX: two PRs with the same label in different projects should not be considered linked anymore

View File

@ -0,0 +1 @@
ADD: mergebot should not accept merging draft PR anymore

View File

@ -0,0 +1 @@
FIX: when fetching an unknown PR and it's closed, don't lose that information

View File

@ -0,0 +1 @@
IMP: keep showing linked PRs after a PR has been merged

View File

@ -0,0 +1 @@
ADD: when integrating a PR via rebasing, tag all the commits with the source PR so they're easier to find

View File

@ -0,0 +1 @@
FIX: when a PR fails at staging, link the correct status in the message posted on the PR

View File

@ -0,0 +1 @@
IMP: cleanup timestamp displays, always show the tzoffset, UTC on hover in the main page (easier to relate to logs), local in the per-branch listing

View File

@ -0,0 +1 @@
ADD: a changelog feature you can now see here

View File

@ -0,0 +1 @@
FIX: don't rewrite commit titles, this can lead to odd effects when it's incorrectly formatted and interpreted as a pseudo-header

View File

@ -0,0 +1 @@
FIX: ensure the merge message matches the up-to-date PR descriptions, the two could desync if we'd missed an update

View File

@ -0,0 +1 @@
FIX: correctly display the error message when a PR is in error

View File

@ -0,0 +1 @@
IMP: add reviewer and direct link to backend in PR pages

View File

@ -0,0 +1 @@
CHG: reject reviewers without an email configured, the fallback to `@users.noreply.github.com` turns out to be confusing

View File

@ -0,0 +1 @@
IMP: allow delegate reviewers to set merge methods

View File

@ -0,0 +1 @@
ADD: squash-mode, currently only for single-commit PRs to make it easier to edit commit messages when they're incorrectly formatted

View File

@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
import collections
import json
import pathlib
import markdown
import markupsafe
import werkzeug.exceptions
from lxml import etree
from lxml.builder import ElementMaker
from odoo.http import Controller, route, request
A = ElementMaker(namespace="http://www.w3.org/2005/Atom")
LIMIT = 20
class MergebotDashboard(Controller):
@route('/runbot_merge', auth="public", type="http", website=True)
@ -26,6 +33,29 @@ class MergebotDashboard(Controller):
'next': stagings[-1].staged_at if len(stagings) > LIMIT else None,
})
def _entries(self):
changelog = pathlib.Path(__file__).parent.parent / 'changelog'
if changelog.is_dir():
return [
(d.name, [f.read_text(encoding='utf-8') for f in d.iterdir() if f.is_file()])
for d in changelog.iterdir()
]
return []
def entries(self, item_converter):
entries = collections.OrderedDict()
for key, items in sorted(self._entries(), reverse=True):
entries.setdefault(key, []).extend(map(item_converter, items))
return entries
@route('/runbot_merge/changelog', auth='public', type='http', website=True)
def changelog(self):
md = markdown.Markdown(extensions=['nl2br'], output_format='html5')
entries = self.entries(lambda t: markupsafe.Markup(md.convert(t)))
return request.render('runbot_merge.changelog', {
'entries': entries,
})
@route('/<org>/<repo>/pull/<int(min=1):pr>', auth='public', type='http', website=True)
def pr(self, org, repo, pr):
pr_id = request.env['runbot_merge.pull_requests'].sudo().search([

View File

@ -14,12 +14,15 @@
<t t-call="website.layout">
<div id="wrap"><div class="container-fluid">
<div id="alerts" class="row text-center">
<div class="alert alert-light col-md-12 h6 mb-0">
<a href="/runbot_merge/changelog">Changelog</a>
</div>
<t t-set="stagingcron" t-value="env(user=1).ref('runbot_merge.staging_cron')"/>
<div t-if="not stagingcron.active" class="alert alert-warning col-12" role="alert">
<div t-if="not stagingcron.active" class="alert alert-warning col-12 mb-0" role="alert">
Staging is disabled, "ready" pull requests will not be staged.
</div>
<t t-set="mergecron" t-value="env(user=1).ref('runbot_merge.merge_cron')"/>
<div t-if="not mergecron.active" class="alert alert-warning col-12" role="alert">
<div t-if="not mergecron.active" class="alert alert-warning col-12 mb-0" role="alert">
Merging is disabled, stagings will not be disabled.
</div>
</div>
@ -300,6 +303,21 @@
</div></div>
</t>
</template>
<template id="changelog" name="mergebot changelog">
<t t-call="website.layout">
<div id="wrap"><div class="container-fluid">
<h1>Changelog</h1>
<section t-foreach="entries" t-as="entry">
<h3 t-if="not entry_first" t-esc="entry"/>
<ul>
<li t-foreach="sorted(entry_value)" t-as="item">
<t t-raw="item"/>
</li>
</ul>
</section>
</div></div>
</t>
</template>
<template id="view_pull_request_info_merged">
<div class="alert alert-success">