SERVER-105218 bump bazel_rules_mongo to v0.1.6 (#36246)

GitOrigin-RevId: 571997689c5ad725dc91f24a7051302209054ab4
This commit is contained in:
Trevor Guidry
2025-05-22 15:57:08 -05:00
committed by MongoDB Bot
parent 81ea2f6ddf
commit fb536051c6
5 changed files with 43 additions and 32 deletions

View File

@@ -342,6 +342,9 @@ coverage --fission=no
# This is set in .bazelrc.evergreen:
# coverage --config=no-remote-exec
# code ownership configuration
common --define codeowners_add_auto_approve_user=True
# Don't detect the native toolchain on linux, only use the hermetic toolchains.
# Opt out of this by passing --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 on the command line.
common:linux --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1

View File

@@ -78,7 +78,7 @@ alias(
alias(
name = "codeowners",
actual = "@bazel_rules_mongo//codeowners:codeowners_add_auto_approver",
actual = "@bazel_rules_mongo//codeowners:codeowners",
)
alias(

View File

@@ -16,7 +16,17 @@ py_binary(
env = {
"CODEOWNERS_VALIDATOR_PATH": "$(execpath @codeowners_validator//:codeowners-validator)",
"CODEOWNERS_BINARY_PATH": "$(execpath @codeowners_binary//:codeowners)",
},
} | select({
":add_auto_approve_user": {
"ADD_AUTO_APPROVE_USER": "true",
},
"//conditions:default": {},
}) | select({
":dont_check_new_files": {
"CODEOWNERS_CHECK_NEW_FILES": "false",
},
"//conditions:default": {},
}),
main = "codeowners_generate.py",
visibility = ["//visibility:public"],
deps = [
@@ -29,32 +39,16 @@ py_binary(
],
)
py_binary(
name = "codeowners_add_auto_approver",
srcs = [
"codeowners_generate.py",
"parsers/owners_v1.py",
"parsers/owners_v2.py",
"validate_codeowners.py",
"//utils:evergreen_git.py",
],
data = [
"@codeowners_binary//:codeowners",
"@codeowners_validator//:codeowners-validator",
],
env = {
"CODEOWNERS_VALIDATOR_PATH": "$(execpath @codeowners_validator//:codeowners-validator)",
"CODEOWNERS_BINARY_PATH": "$(execpath @codeowners_binary//:codeowners)",
"ADD_AUTO_APPROVE_USER": "true",
config_setting(
name = "add_auto_approve_user",
define_values = {
"codeowners_add_auto_approve_user": "True",
},
)
config_setting(
name = "dont_check_new_files",
define_values = {
"codeowners_dont_check_new_files": "True",
},
main = "codeowners_generate.py",
visibility = ["//visibility:public"],
deps = [
dependency(
"pyyaml",
),
dependency(
"gitpython",
),
],
)

View File

@@ -298,6 +298,20 @@ def main():
with open(output_file, "r") as file:
old_contents = file.read()
# prioritize env var for check new file configuration
should_check_new_files = os.environ.get("CODEOWNERS_CHECK_NEW_FILES", None)
if should_check_new_files is not None:
if should_check_new_files.lower() == "false":
should_check_new_files = False
elif should_check_new_files.lower() == "true":
should_check_new_files = True
else:
raise RuntimeError(
f"Invalid value for CODEOWNERS_CHECK_NEW_FILES: {should_check_new_files}"
)
else:
should_check_new_files = args.check_new_files
new_contents = "\n".join(output_lines)
if check:
if new_contents != old_contents:
@@ -309,7 +323,7 @@ def main():
codeowners_validator_path,
args.run_validation,
codeowners_binary_path,
args.check_new_files,
should_check_new_files,
args.expansions_file,
args.branch,
output_file,
@@ -324,7 +338,7 @@ def main():
codeowners_validator_path,
args.run_validation,
codeowners_binary_path,
args.check_new_files,
should_check_new_files,
args.expansions_file,
args.branch,
output_file,

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "bazel_rules_mongo"
version = "0.1.5"
version = "0.1.6"
description = "Bazel rule we use to ship common code between bazel repos"
authors = ["Trevor Guidry <trevor.guidry@mongodb.com>"]
readme = "README.md"