mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:50:14 +01:00
This should detect when a PR has a dependency of another open PR and add a comment and label describing it. The comment will even do a best-effort to compute the best starting commit for review. Whenever PRs are closed, it will also scan the open depnedent PRs and try to either remove the PRs in the comment or if it reaches zero the label. It works to update a single comment on a PR rather than adding more comments. Assisted-by: Antigravity with Gemini
53 lines
1.2 KiB
Python
53 lines
1.2 KiB
Python
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
# Exceptions. See /LICENSE for license information.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
load("@py_deps//:requirements.bzl", "requirement")
|
|
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
|
|
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
|
|
|
|
py_library(
|
|
name = "github_helpers",
|
|
srcs = ["github_helpers.py"],
|
|
deps = [requirement("gql")],
|
|
)
|
|
|
|
compile_pip_requirements(
|
|
name = "requirements",
|
|
src = "requirements.in",
|
|
requirements_txt = "requirements.txt",
|
|
)
|
|
|
|
py_test(
|
|
name = "github_helpers_test",
|
|
size = "small",
|
|
srcs = ["github_helpers_test.py"],
|
|
deps = [":github_helpers"],
|
|
)
|
|
|
|
py_binary(
|
|
name = "check_dependent_pr",
|
|
srcs = ["check_dependent_pr.py"],
|
|
deps = [":github_helpers"],
|
|
)
|
|
|
|
py_binary(
|
|
name = "pr_comments",
|
|
srcs = ["pr_comments.py"],
|
|
deps = ["github_helpers"],
|
|
)
|
|
|
|
py_test(
|
|
name = "check_dependent_pr_test",
|
|
size = "small",
|
|
srcs = ["check_dependent_pr_test.py"],
|
|
deps = [":check_dependent_pr"],
|
|
)
|
|
|
|
py_test(
|
|
name = "pr_comments_test",
|
|
size = "small",
|
|
srcs = ["pr_comments_test.py"],
|
|
deps = [":pr_comments"],
|
|
)
|