mirror of https://github.com/mongodb/mongo
SERVER-114483 Fix path issue in Evergreen config linter (#44469)
GitOrigin-RevId: 1b904306d2d7cae73c25826849efa9925c147da9
This commit is contained in:
parent
87b363ce7d
commit
156901215b
|
|
@ -345,7 +345,6 @@ def run_rules_lint(bazel_bin: str, args: List[str]):
|
||||||
"buildscripts:validate_evg_project_config",
|
"buildscripts:validate_evg_project_config",
|
||||||
[
|
[
|
||||||
f"--evg-project-name={parsed_args.lint_yaml_project}",
|
f"--evg-project-name={parsed_args.lint_yaml_project}",
|
||||||
"--evg-auth-config=.evergreen.yml",
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,6 @@ from buildscripts.ciconfig.evergreen import find_evergreen_binary
|
||||||
|
|
||||||
LOGGER = structlog.get_logger(__name__)
|
LOGGER = structlog.get_logger(__name__)
|
||||||
|
|
||||||
DEFAULT_LOCAL_EVG_AUTH_CONFIG = os.path.expanduser("~/.evergreen.yml")
|
|
||||||
|
|
||||||
DEFAULT_EVG_PROJECT_NAME = "mongodb-mongo-master"
|
DEFAULT_EVG_PROJECT_NAME = "mongodb-mongo-master"
|
||||||
DEFAULT_EVG_NIGHTLY_PROJECT_NAME = "mongodb-mongo-master-nightly"
|
DEFAULT_EVG_NIGHTLY_PROJECT_NAME = "mongodb-mongo-master-nightly"
|
||||||
DEFAULT_EVG_PROJECT_CONFIG = "etc/evergreen.yml"
|
DEFAULT_EVG_PROJECT_CONFIG = "etc/evergreen.yml"
|
||||||
|
|
@ -61,14 +59,29 @@ def messages_to_report(messages, num_of_projects):
|
||||||
return (error_on_evg_validate_messages, shared_evg_validate_messages)
|
return (error_on_evg_validate_messages, shared_evg_validate_messages)
|
||||||
|
|
||||||
|
|
||||||
|
def default_evg_config():
|
||||||
|
config_locations = [
|
||||||
|
os.path.join(os.getcwd(), ".evergreen.yml"),
|
||||||
|
os.path.expanduser("~/.evergreen.yml"),
|
||||||
|
]
|
||||||
|
for candidate in config_locations:
|
||||||
|
if os.path.exists(candidate):
|
||||||
|
return candidate
|
||||||
|
LOGGER.error(f"No evergreen config exists at any of {config_locations}.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def main(
|
def main(
|
||||||
evg_project_name: Annotated[
|
evg_project_name: Annotated[
|
||||||
str, typer.Option(help="Evergreen project name")
|
str, typer.Option(help="Evergreen project name")
|
||||||
] = DEFAULT_EVG_PROJECT_NAME,
|
] = DEFAULT_EVG_PROJECT_NAME,
|
||||||
evg_auth_config: Annotated[
|
evg_auth_config: Annotated[str, typer.Option(help="Evergreen auth config file")] = None,
|
||||||
str, typer.Option(help="Evergreen auth config file")
|
|
||||||
] = DEFAULT_LOCAL_EVG_AUTH_CONFIG,
|
|
||||||
):
|
):
|
||||||
|
os.chdir(os.environ.get("BUILD_WORKSPACE_DIRECTORY", "."))
|
||||||
|
|
||||||
|
if not evg_auth_config:
|
||||||
|
evg_auth_config = default_evg_config()
|
||||||
|
|
||||||
evg_project_config_map = {evg_project_name: DEFAULT_EVG_NIGHTLY_PROJECT_CONFIG}
|
evg_project_config_map = {evg_project_name: DEFAULT_EVG_NIGHTLY_PROJECT_CONFIG}
|
||||||
if evg_project_name == DEFAULT_EVG_PROJECT_NAME:
|
if evg_project_name == DEFAULT_EVG_PROJECT_NAME:
|
||||||
evg_project_config_map = {
|
evg_project_config_map = {
|
||||||
|
|
@ -95,6 +108,7 @@ def main(
|
||||||
shared_evg_validate_messages = []
|
shared_evg_validate_messages = []
|
||||||
error_on_evg_validate_messages = defaultdict(list)
|
error_on_evg_validate_messages = defaultdict(list)
|
||||||
|
|
||||||
|
exit_code = 0
|
||||||
num_of_projects = len(evg_project_config_map)
|
num_of_projects = len(evg_project_config_map)
|
||||||
evergreen_bin = find_evergreen_binary("evergreen")
|
evergreen_bin = find_evergreen_binary("evergreen")
|
||||||
for project, project_config in evg_project_config_map.items():
|
for project, project_config in evg_project_config_map.items():
|
||||||
|
|
@ -110,6 +124,11 @@ def main(
|
||||||
]
|
]
|
||||||
LOGGER.info(f"Running command: {cmd}")
|
LOGGER.info(f"Running command: {cmd}")
|
||||||
result = subprocess.run(cmd, capture_output=True, text=True)
|
result = subprocess.run(cmd, capture_output=True, text=True)
|
||||||
|
if result.returncode:
|
||||||
|
LOGGER.error(
|
||||||
|
f"Command failed with return code {result.returncode}.\nstdout:{result.stdout}stderr:{result.stderr}"
|
||||||
|
)
|
||||||
|
exit_code = 1
|
||||||
interesting_messages = result.stdout.strip().split("\n")[:-1]
|
interesting_messages = result.stdout.strip().split("\n")[:-1]
|
||||||
|
|
||||||
(error_on_evg_validate_messages[project], allowed_if_not_shared) = messages_to_report(
|
(error_on_evg_validate_messages[project], allowed_if_not_shared) = messages_to_report(
|
||||||
|
|
@ -122,7 +141,6 @@ def main(
|
||||||
if shared_evg_validate_messages.count(message) == num_of_projects:
|
if shared_evg_validate_messages.count(message) == num_of_projects:
|
||||||
error_on_shared_evg_validate_messages.append(message)
|
error_on_shared_evg_validate_messages.append(message)
|
||||||
|
|
||||||
exit_code = 0
|
|
||||||
all_configs = list(evg_project_config_map.values())
|
all_configs = list(evg_project_config_map.values())
|
||||||
all_projects = list(evg_project_config_map.keys())
|
all_projects = list(evg_project_config_map.keys())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -367,20 +367,6 @@ tasks:
|
||||||
vars:
|
vars:
|
||||||
target: //evergreen:validate_compile_commands
|
target: //evergreen:validate_compile_commands
|
||||||
|
|
||||||
- name: run_bazel_program_windows
|
|
||||||
tags: ["assigned_to_jira_team_devprod_build", "auxiliary", "bazel_check"]
|
|
||||||
depends_on:
|
|
||||||
- name: version_expansions_gen
|
|
||||||
variant: generate-tasks-for-version
|
|
||||||
commands:
|
|
||||||
- func: "bazel run"
|
|
||||||
vars:
|
|
||||||
target: >-
|
|
||||||
//src/mongo/platform:visibility1_test
|
|
||||||
# TODO DEVPROD-2508 remove dbg flags when compilation_mode is synced with build_mode automatically
|
|
||||||
args: >-
|
|
||||||
--compilation_mode=dbg
|
|
||||||
|
|
||||||
- name: compile_upload_benchmarks
|
- name: compile_upload_benchmarks
|
||||||
tags: ["assigned_to_jira_team_devprod_build", "auxiliary"]
|
tags: ["assigned_to_jira_team_devprod_build", "auxiliary"]
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|
@ -1313,6 +1299,7 @@ tasks:
|
||||||
# don't want to publish packages.
|
# don't want to publish packages.
|
||||||
patchable: false
|
patchable: false
|
||||||
stepback: false
|
stepback: false
|
||||||
|
disable: true # TODO(SERVER-114245) Remove this to re-enable the task
|
||||||
# Same dependencies as "push" below
|
# Same dependencies as "push" below
|
||||||
depends_on:
|
depends_on:
|
||||||
- name: crypt_push
|
- name: crypt_push
|
||||||
|
|
|
||||||
|
|
@ -716,6 +716,7 @@ tasks:
|
||||||
- func: "cleanup environment"
|
- func: "cleanup environment"
|
||||||
- func: "set up venv"
|
- func: "set up venv"
|
||||||
- func: "upload pip requirements"
|
- func: "upload pip requirements"
|
||||||
|
- func: "configure evergreen api credentials"
|
||||||
- func: "get engflow creds"
|
- func: "get engflow creds"
|
||||||
- func: "bazel run"
|
- func: "bazel run"
|
||||||
vars:
|
vars:
|
||||||
|
|
|
||||||
|
|
@ -519,7 +519,6 @@ tasks:
|
||||||
depends_on:
|
depends_on:
|
||||||
- name: version_expansions_gen
|
- name: version_expansions_gen
|
||||||
variant: generate-tasks-for-version
|
variant: generate-tasks-for-version
|
||||||
- name: compile_libraries_for_unittests
|
|
||||||
commands:
|
commands:
|
||||||
- func: "do bazel setup"
|
- func: "do bazel setup"
|
||||||
- func: "bazel compile"
|
- func: "bazel compile"
|
||||||
|
|
@ -544,7 +543,6 @@ tasks:
|
||||||
depends_on:
|
depends_on:
|
||||||
- name: version_expansions_gen
|
- name: version_expansions_gen
|
||||||
variant: generate-tasks-for-version
|
variant: generate-tasks-for-version
|
||||||
- name: compile_libraries_for_unittests
|
|
||||||
commands:
|
commands:
|
||||||
- func: "do bazel setup"
|
- func: "do bazel setup"
|
||||||
- func: "bazel compile"
|
- func: "bazel compile"
|
||||||
|
|
|
||||||
|
|
@ -2532,7 +2532,7 @@ tasks:
|
||||||
name: query_cbr_histogram_jscore_passthrough
|
name: query_cbr_histogram_jscore_passthrough
|
||||||
# Currently disabled due to an OOM in SERVER-109720
|
# Currently disabled due to an OOM in SERVER-109720
|
||||||
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
||||||
activate: false
|
disable: true
|
||||||
tags: [
|
tags: [
|
||||||
"assigned_to_jira_team_server_query_optimization",
|
"assigned_to_jira_team_server_query_optimization",
|
||||||
"experimental",
|
"experimental",
|
||||||
|
|
@ -2548,7 +2548,7 @@ tasks:
|
||||||
name: query_cbr_histogram_aggregation_passthrough
|
name: query_cbr_histogram_aggregation_passthrough
|
||||||
# Currently disabled due to an OOM in SERVER-109720
|
# Currently disabled due to an OOM in SERVER-109720
|
||||||
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
||||||
activate: false
|
disable: true
|
||||||
tags: [
|
tags: [
|
||||||
"assigned_to_jira_team_server_query_optimization",
|
"assigned_to_jira_team_server_query_optimization",
|
||||||
"experimental",
|
"experimental",
|
||||||
|
|
@ -2564,7 +2564,7 @@ tasks:
|
||||||
name: query_golden_cbr_histogram
|
name: query_golden_cbr_histogram
|
||||||
# Currently disabled due to plan flips due to SERVER-108077
|
# Currently disabled due to plan flips due to SERVER-108077
|
||||||
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
# To be re-enabled in SERVER-109881 Re-enable the cbr_histogram passthroughs
|
||||||
activate: false
|
disable: true
|
||||||
tags: [
|
tags: [
|
||||||
"assigned_to_jira_team_server_query_optimization",
|
"assigned_to_jira_team_server_query_optimization",
|
||||||
"experimental",
|
"experimental",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue