From 891d2d71e8f5ad12838c95da9e7fc1dc5ca93115 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Thu, 24 Nov 2022 15:56:21 +0100 Subject: [PATCH] [IMP] runbot: add draft detection form titl --- runbot/models/branch.py | 2 +- runbot/templates/branch.xml | 4 ++++ runbot/views/branch_views.xml | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runbot/models/branch.py b/runbot/models/branch.py index 7ad4db4e..66205ea8 100644 --- a/runbot/models/branch.py +++ b/runbot/models/branch.py @@ -113,11 +113,11 @@ class Branch(models.Model): pi = branch.is_pr and (pull_info or pull_info_dict.get((branch.remote_id, branch.name)) or branch._get_pull_info()) if pi: try: - branch.draft = pi.get('draft', False) branch.alive = pi.get('state', False) != 'closed' branch.target_branch_name = pi['base']['ref'] branch.pull_head_name = pi['head']['label'] branch.pr_title = pi['title'] + branch.draft = pi.get('draft', False) or branch.pr_title and (branch.pr_title.startswith('[DRAFT]') or branch.pr_title.startswith('[WIP]')) branch.pr_body = pi['body'] branch.pr_author = pi['user']['login'] pull_head_repo_name = False diff --git a/runbot/templates/branch.xml b/runbot/templates/branch.xml index e01809c9..34f32fc1 100644 --- a/runbot/templates/branch.xml +++ b/runbot/templates/branch.xml @@ -45,6 +45,10 @@ Target Branch + + Pr title + + diff --git a/runbot/views/branch_views.xml b/runbot/views/branch_views.xml index dcecc575..4a000ebf 100644 --- a/runbot/views/branch_views.xml +++ b/runbot/views/branch_views.xml @@ -19,6 +19,8 @@ + +