mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[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:
parent
bce0836aa9
commit
0e087e7433
@ -1 +1,2 @@
|
|||||||
from . import models
|
from . import models
|
||||||
|
from . import controllers
|
||||||
|
1
forwardport/changelog/2021-09/authorship-dedup.md
Normal file
1
forwardport/changelog/2021-09/authorship-dedup.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: the deduplication of authorship in case of conflicts in multi-commit PRs
|
1
forwardport/changelog/2021-09/authorship.md
Normal file
1
forwardport/changelog/2021-09/authorship.md
Normal 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
|
1
forwardport/changelog/2021-09/conflict-view.md
Normal file
1
forwardport/changelog/2021-09/conflict-view.md
Normal 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
|
1
forwardport/changelog/2021-09/draft.md
Normal file
1
forwardport/changelog/2021-09/draft.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
REM: creation of forward ports in draft mode
|
1
forwardport/changelog/2021-09/feedback-missing-login.md
Normal file
1
forwardport/changelog/2021-09/feedback-missing-login.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: some feedback messages didn't correctly ping the person being replied to
|
1
forwardport/changelog/2021-09/followup-conflict.md
Normal file
1
forwardport/changelog/2021-09/followup-conflict.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: properly notify the user when an update to a pull request causes a conflict when impacted on the followup
|
1
forwardport/changelog/2021-09/fp-remote-view.md
Normal file
1
forwardport/changelog/2021-09/fp-remote-view.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: add the forward-port remote to the repository view, so it can be set via the UI
|
1
forwardport/changelog/2021-09/fwbot-rplus-error.md
Normal file
1
forwardport/changelog/2021-09/fwbot-rplus-error.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: error messages when trying to `@fw-bot r+` on pull requests not under its purview
|
1
forwardport/changelog/2021-09/outstanding.md
Normal file
1
forwardport/changelog/2021-09/outstanding.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
ADD: list of outstanding forward-ports
|
1
forwardport/changelog/2021-10/delegate-followup.md
Normal file
1
forwardport/changelog/2021-10/delegate-followup.md
Normal 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)
|
1
forwardport/changelog/2021-10/followupdate-race.md
Normal file
1
forwardport/changelog/2021-10/followupdate-race.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: rare condition where updating a forwardport would then require all followups to be individually approved
|
1
forwardport/changelog/2021-10/fw-reapproval.md
Normal file
1
forwardport/changelog/2021-10/fw-reapproval.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: don't trigger an error message when using `fw-bot r+` and some of the PRs were already approved
|
1
forwardport/changelog/2021-10/outstanding-layout.md
Normal file
1
forwardport/changelog/2021-10/outstanding-layout.md
Normal 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
|
15
forwardport/controllers.py
Normal file
15
forwardport/controllers.py
Normal 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()
|
||||||
|
]
|
||||||
|
|
@ -13,7 +13,7 @@
|
|||||||
('source_id', '!=', False),
|
('source_id', '!=', False),
|
||||||
('state', 'not in', ['merged', 'closed']),
|
('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">
|
<a href="/forwardport/outstanding">
|
||||||
<t t-esc="outstanding"/> outstanding forward-ports
|
<t t-esc="outstanding"/> outstanding forward-ports
|
||||||
</a>
|
</a>
|
||||||
|
1
runbot_merge/changelog/2021-09/conflict_authorship.md
Normal file
1
runbot_merge/changelog/2021-09/conflict_authorship.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
ADD: refuse merging commits without an email set, this is mostly to be used by the forwardport-bot
|
1
runbot_merge/changelog/2021-09/different_project_link.md
Normal file
1
runbot_merge/changelog/2021-09/different_project_link.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: two PRs with the same label in different projects should not be considered linked anymore
|
1
runbot_merge/changelog/2021-09/drafts.md
Normal file
1
runbot_merge/changelog/2021-09/drafts.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
ADD: mergebot should not accept merging draft PR anymore
|
1
runbot_merge/changelog/2021-09/fetch_closed.md
Normal file
1
runbot_merge/changelog/2021-09/fetch_closed.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: when fetching an unknown PR and it's closed, don't lose that information
|
1
runbot_merge/changelog/2021-09/persistent_linked_prs.md
Normal file
1
runbot_merge/changelog/2021-09/persistent_linked_prs.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: keep showing linked PRs after a PR has been merged
|
1
runbot_merge/changelog/2021-09/rebase_tagging.md
Normal file
1
runbot_merge/changelog/2021-09/rebase_tagging.md
Normal 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
|
@ -0,0 +1 @@
|
|||||||
|
FIX: when a PR fails at staging, link the correct status in the message posted on the PR
|
1
runbot_merge/changelog/2021-09/timestamps.md
Normal file
1
runbot_merge/changelog/2021-09/timestamps.md
Normal 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
|
1
runbot_merge/changelog/2021-10/changelog.md
Normal file
1
runbot_merge/changelog/2021-10/changelog.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
ADD: a changelog feature you can now see here
|
1
runbot_merge/changelog/2021-10/commit-title-edition.md
Normal file
1
runbot_merge/changelog/2021-10/commit-title-edition.md
Normal 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
|
@ -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
|
1
runbot_merge/changelog/2021-10/pr_errors.md
Normal file
1
runbot_merge/changelog/2021-10/pr_errors.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
FIX: correctly display the error message when a PR is in error
|
1
runbot_merge/changelog/2021-10/pr_page.md
Normal file
1
runbot_merge/changelog/2021-10/pr_page.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: add reviewer and direct link to backend in PR pages
|
1
runbot_merge/changelog/2021-10/review-without-email.md
Normal file
1
runbot_merge/changelog/2021-10/review-without-email.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
CHG: reject reviewers without an email configured, the fallback to `@users.noreply.github.com` turns out to be confusing
|
1
runbot_merge/changelog/2021-10/reviewer-merge-methods.md
Normal file
1
runbot_merge/changelog/2021-10/reviewer-merge-methods.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
IMP: allow delegate reviewers to set merge methods
|
1
runbot_merge/changelog/2021-10/squash.md
Normal file
1
runbot_merge/changelog/2021-10/squash.md
Normal 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
|
@ -1,10 +1,17 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
import collections
|
||||||
import json
|
import json
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
import markdown
|
||||||
|
import markupsafe
|
||||||
import werkzeug.exceptions
|
import werkzeug.exceptions
|
||||||
|
from lxml import etree
|
||||||
|
from lxml.builder import ElementMaker
|
||||||
|
|
||||||
from odoo.http import Controller, route, request
|
from odoo.http import Controller, route, request
|
||||||
|
|
||||||
|
A = ElementMaker(namespace="http://www.w3.org/2005/Atom")
|
||||||
LIMIT = 20
|
LIMIT = 20
|
||||||
class MergebotDashboard(Controller):
|
class MergebotDashboard(Controller):
|
||||||
@route('/runbot_merge', auth="public", type="http", website=True)
|
@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,
|
'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)
|
@route('/<org>/<repo>/pull/<int(min=1):pr>', auth='public', type='http', website=True)
|
||||||
def pr(self, org, repo, pr):
|
def pr(self, org, repo, pr):
|
||||||
pr_id = request.env['runbot_merge.pull_requests'].sudo().search([
|
pr_id = request.env['runbot_merge.pull_requests'].sudo().search([
|
||||||
|
@ -14,12 +14,15 @@
|
|||||||
<t t-call="website.layout">
|
<t t-call="website.layout">
|
||||||
<div id="wrap"><div class="container-fluid">
|
<div id="wrap"><div class="container-fluid">
|
||||||
<div id="alerts" class="row text-center">
|
<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')"/>
|
<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.
|
Staging is disabled, "ready" pull requests will not be staged.
|
||||||
</div>
|
</div>
|
||||||
<t t-set="mergecron" t-value="env(user=1).ref('runbot_merge.merge_cron')"/>
|
<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.
|
Merging is disabled, stagings will not be disabled.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -300,6 +303,21 @@
|
|||||||
</div></div>
|
</div></div>
|
||||||
</t>
|
</t>
|
||||||
</template>
|
</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">
|
<template id="view_pull_request_info_merged">
|
||||||
<div class="alert alert-success">
|
<div class="alert alert-success">
|
||||||
|
Loading…
Reference in New Issue
Block a user