Skip to content

Commit 73423a7

Browse files
authored
resolve more authors in system-probe-ops messages (#46754)
### What does this PR do? Resolves some known github usernames in the nightly changelog in #system-probe-ops ### Motivation Better notification for users when their changes are deployed nightly. ### Describe how you validated your changes ### Additional Notes Co-authored-by: bryce.kahle <bryce.kahle@datadoghq.com>
1 parent fa4eb89 commit 73423a7

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tasks/pipeline.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,10 @@ def is_system_probe(owners, files):
414414
"guy20495@gmail.com": "U03LJSCAPK2",
415415
"safchain@gmail.com": "U01009CUG9X",
416416
"usamasaqib.96@live.com": "U03D807V94J",
417-
"leeavital@gmail.com": "UDG2223C1",
417+
}
418+
GITHUB_SLACK_ID_MAP = {
419+
"gjulianm": "U069N8XCSQ0",
420+
"jmw51798": "U05FPPV9ASF",
418421
}
419422

420423

@@ -472,6 +475,12 @@ def changelog(ctx, new_commit_sha):
472475
author_handle = ""
473476
if author_email in EMAIL_SLACK_ID_MAP:
474477
author_handle = EMAIL_SLACK_ID_MAP[author_email]
478+
elif author_email.endswith("@users.noreply.github.com"):
479+
github_username = author_email.removesuffix("@users.noreply.github.com")
480+
if "+" in github_username:
481+
github_username = github_username.split("+", maxsplit=1)[1]
482+
if github_username in GITHUB_SLACK_ID_MAP:
483+
author_handle = GITHUB_SLACK_ID_MAP[github_username]
475484
else:
476485
try:
477486
recipient = client.users_lookupByEmail(email=author_email)
@@ -487,13 +496,12 @@ def changelog(ctx, new_commit_sha):
487496
messages.append(f"{message_link} {author_handle}")
488497

489498
if messages:
490-
slack_message += (
491-
"\n".join(messages) + "\n:wave: Authors, please check the "
492-
"<https://ddstaging.datadoghq.com/dashboard/kfn-zy2-t98?tpl_var_kube_cluster_name%5B0%5D=stripe"
493-
"&tpl_var_kube_cluster_name%5B1%5D=oddish-b&tpl_var_kube_cluster_name%5B2%5D=lagaffe"
494-
"&tpl_var_kube_cluster_name%5B3%5D=diglet&tpl_var_kube_cluster_name%5B4%5D=snowver"
495-
"&tpl_var_kube_cluster_name%5B5%5D=chillpenguin&tpl_var_kube_cluster_name%5B6%5D=muk|dashboard> for issues"
496-
)
499+
slack_message += "\n".join(messages)
500+
slack_message += "\n:wave: Authors, please check the <https://ddstaging.datadoghq.com/dashboard/kfn-zy2-t98?"
501+
clusters = ["chillpenguin", "diglet", "lagaffe", "muk", "oddish-b", "snowver", "stripe", "venomoth"]
502+
for i, cluster_name in enumerate(clusters):
503+
slack_message += f"{"&" if i > 0 else ""}tpl_var_kube_cluster_name%5B{i}%5D={cluster_name}"
504+
slack_message += "|dashboard> for issues"
497505
else:
498506
slack_message += empty_changelog_msg
499507

0 commit comments

Comments
 (0)