From 8dc33214a13fe50f938c9f893897b78040f3d07c Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 4 Dec 2023 12:47:20 +0100 Subject: [PATCH 1/3] Initial commit --- commands.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/commands.py b/commands.py index adf3e5a..1abe1b5 100644 --- a/commands.py +++ b/commands.py @@ -118,7 +118,7 @@ def get_pull_commit_hash(repo: str, pull_id: str): return result['head']['sha'] -def build(repo: str, reply_url: str, html_url: str, build_type: str, build_id: str, username: str, package: bool, platform_args: Sequence[str]): +def build(repo: str, reply_url: str, html_url: str, build_type: str, build_id: str, build_config: str, username: str, package: bool, platform_args: Sequence[str]): """ Build blender on the buildbot. """ @@ -132,7 +132,7 @@ def build(repo: str, reply_url: str, html_url: str, build_type: str, build_id: s params = {"needs_package_delivery": package, "platform_architectures": platforms, - "build_configuration": "release"} + "build_configuration": build_config} elif repo == "blender/blender-manual": coordinator_prefix = "vexp-doc-manual" @@ -233,14 +233,16 @@ def comment_event(data: Dict[str, Any]): tokens = line[len(prefix):].strip().split() command = tokens[0] args = tokens[1:] - if command == "build" and is_pull: - build(repo, reply_url, html_url, 'patch_id', issue_number, username, False, args) + if command == "build" and is_pull and len(args) == 0: + build(repo, reply_url, html_url, 'patch_id', "release", issue_number, username, False, args) + elif command == "build" and is_pull and len(args) == 1: + build(repo, reply_url, html_url, 'patch_id', args[0], issue_number, username, False, args) elif command == "build-branch" and len(args) >= 1: - build(repo, reply_url, html_url, 'override_branch_id', args[0], username, False, args[1:]) + build(repo, reply_url, html_url, 'override_branch_id', "release", args[0], username, False, args[1:]) elif command == "package" and is_pull: - build(repo, reply_url, html_url, 'patch_id', issue_number, username, True, args) + build(repo, reply_url, html_url, 'patch_id', "release", issue_number, username, True, args) elif command == "package-branch" and len(args) >= 1: - build(repo, reply_url, html_url, 'override_branch_id', args[0], username, True, args[1:]) + build(repo, reply_url, html_url, 'override_branch_id', "release", args[0], username, True, args[1:]) elif command == "ping": post_comment(reply_url, "pong") else: -- 2.30.2 From 60fd6c872a0177f4778e0f2f24c2092738b46050 Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 4 Dec 2023 13:20:30 +0100 Subject: [PATCH 2/3] Fix build command --- commands.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands.py b/commands.py index 1abe1b5..552bf36 100644 --- a/commands.py +++ b/commands.py @@ -233,10 +233,11 @@ def comment_event(data: Dict[str, Any]): tokens = line[len(prefix):].strip().split() command = tokens[0] args = tokens[1:] - if command == "build" and is_pull and len(args) == 0: - build(repo, reply_url, html_url, 'patch_id', "release", issue_number, username, False, args) - elif command == "build" and is_pull and len(args) == 1: - build(repo, reply_url, html_url, 'patch_id', args[0], issue_number, username, False, args) + if command == "build" and is_pull: + if len(args) >= 1 and args[0] in {"release", "debug"}: + build(repo, reply_url, html_url, 'patch_id', args[0], issue_number, username, False, args[1:]) + else: + build(repo, reply_url, html_url, 'patch_id', "release", issue_number, username, False, args) elif command == "build-branch" and len(args) >= 1: build(repo, reply_url, html_url, 'override_branch_id', "release", args[0], username, False, args[1:]) elif command == "package" and is_pull: -- 2.30.2 From ca6a94c7a721fe0b0c8a3a798c2899add932e10e Mon Sep 17 00:00:00 2001 From: Falk David Date: Mon, 4 Dec 2023 13:20:38 +0100 Subject: [PATCH 3/3] Update README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ece853..7180dc5 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,15 @@ Blender developers with commit access can start builds by typing commands in comments on projects.blender.org. -* `@blender-bot build [platform]`: build current pull request. A notification about the build progress / result is shown in the list of commits that make up this pull request. +* `@blender-bot build [config] [platform]`: build current pull request. A notification about the build progress / result is shown in the list of commits that make up this pull request. * `@blender-bot package [platform]`: build current pull request and make package for download. The bot will post the link in a comment on the pull request. * `@blender-bot build-branch branch [platform]`: build the given branch. The bot will post a link to the build in a comment on the issue / pull request. * `@blender-bot package-branch branch [platform]`: build branch and make package for download. The bot will post the link in a comment on the issue / pull request. +`[config]` is optional. Possible values: +* `release` (default) +* `debug`: Builds in debug mode + `[platform]` is optional, and used to build for just one platform. Possible values: * `windows` `macos` `linux` (for brevity) * `windows-amd64` `macos-x86_64` `macos-arm64` `linux-x86_64` (to be specific) -- 2.30.2