Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(notify): [agent6] don't create team notifications #32697

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions tasks/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
from tasks.libs.pipeline_stats import get_failed_jobs_stats
from tasks.libs.types import FailedJobs, SlackMessage, TeamMessage

UNKNOWN_OWNER_TEMPLATE = """The owner `{owner}` is not mapped to any slack channel.
Please check for typos in the JOBOWNERS file and/or add them to the Github <-> Slack map.
"""
PROJECT_NAME = "DataDog/datadog-agent"
AWS_S3_CP_CMD = "aws s3 cp --only-show-errors --region us-east-1 --sse AES256"
S3_CI_BUCKET_URL = "s3://dd-ci-artefacts-build-stable/datadog-agent/failed_jobs"
Expand Down Expand Up @@ -91,12 +88,10 @@ def send_message(_, notification_type="merge", print_to_stdout=False):
base = base_message(header, state)

# Send messages
for owner, message in messages_to_send.items():
for _, message in messages_to_send.items():
# We don't generate one message per owner, only the global one
channel = "#agent-agent6-ops"
message.base_message = base
if channel is None:
channel = "#datadog-agent-pipelines"
message.base_message += UNKNOWN_OWNER_TEMPLATE.format(owner=owner)
message.coda = coda
if print_to_stdout:
print(f"Would send to {channel}:\n{str(message)}")
Expand Down Expand Up @@ -190,8 +185,6 @@ def generate_failure_messages(project_name: str, failed_jobs: FailedJobs) -> Dic
for job in jobs.all_non_infra_failures():
for test in get_failed_tests(project_name, job):
messages_to_send[all_teams].add_test_failure(test, job)
for owner in test.owners:
messages_to_send[owner].add_test_failure(test, job)
elif owner == "@DataDog/do-not-notify":
# Jobs owned by @DataDog/do-not-notify do not send team messages
pass
Expand Down
Loading