mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[FIX] *: fw=no reflection in the PR dashboard
Like limit, fw=no should restrict the table length, in this case to just the current branch (as we're not forward porting at all). Before this, `no` would not be applied as a limit visually, the table would still go up to the main branch which is very confusing. Fixes #962
This commit is contained in:
parent
2fea318830
commit
e7716f8b77
@ -1,3 +1,4 @@
|
||||
import lxml.html
|
||||
import pytest
|
||||
|
||||
from utils import seen, Commit, make_basic, to_pr
|
||||
@ -106,7 +107,7 @@ def test_ignore(env, config, make_repo, users):
|
||||
"should finally have created a forward port"
|
||||
|
||||
|
||||
def test_unignore(env, config, make_repo, users):
|
||||
def test_unignore(env, config, make_repo, users, page):
|
||||
env['res.partner'].create({'name': users['other'], 'github_login': users['other'], 'email': 'other@example.org'})
|
||||
|
||||
prod, _ = make_basic(env, config, make_repo, statuses="default")
|
||||
@ -121,11 +122,19 @@ def test_unignore(env, config, make_repo, users):
|
||||
pr_id = to_pr(env, pr)
|
||||
assert pr_id.batch_id.fw_policy == 'default'
|
||||
|
||||
doc = lxml.html.fromstring(page(f'/{prod.name}/pull/{pr.number}'))
|
||||
assert len(doc.cssselect("table > tbody > tr")) == 3, \
|
||||
"the overview table should have as many rows as there are tables"
|
||||
|
||||
with prod:
|
||||
pr.post_comment('hansen fw=no', token)
|
||||
env.run_crons(None)
|
||||
assert pr_id.batch_id.fw_policy == 'no'
|
||||
|
||||
doc = lxml.html.fromstring(page(f'/{prod.name}/pull/{pr.number}'))
|
||||
assert len(doc.cssselect("table > tbody > tr")) == 1, \
|
||||
"if fw=no, there should be just one row"
|
||||
|
||||
with prod:
|
||||
pr.post_comment('hansen fw=default', token)
|
||||
env.run_crons(None)
|
||||
|
@ -465,6 +465,8 @@ if not genealogy:
|
||||
repos = pr.repository
|
||||
elif all(p.state in ('merged', 'closed') for p in genealogy[-1].all_prs):
|
||||
branches = (project.branch_ids & targets)[::-1]
|
||||
elif pr.batch_id.fw_policy == 'no':
|
||||
branches = pr.target
|
||||
else:
|
||||
# if the tip of the genealogy is not closed, extend to the furthest limit,
|
||||
# keeping branches which are active or have an associated batch / PR
|
||||
|
Loading…
Reference in New Issue
Block a user