|
3 | 3 |
|
4 | 4 | from ..models.collection_choice_fields import WorkflowStatusChoices
|
5 | 5 |
|
6 |
| -SLACK_ID_MAPPING = { |
7 |
| - "Carson Davis": "@UESJLQXH6", |
8 |
| - "Bishwas Praveen": "@U05QZUF182J", |
9 |
| - "Xiang Li": "@U03PPLNDZA7", |
10 |
| - "Shravan Vishwanathan": "@U056B4HMGEP", |
11 |
| - "Advait Yogaonkar": "@U06L5SKQ5QA", |
12 |
| - "Emily Foshee": "@UPKDARB9P", |
13 |
| - "Ashish Acharya": "@UC97PNAF6", |
14 |
| - "channel": "!here", |
15 |
| -} |
16 |
| - |
17 |
| - |
18 | 6 | STATUS_CHANGE_NOTIFICATIONS = {
|
19 | 7 | (WorkflowStatusChoices.RESEARCH_IN_PROGRESS, WorkflowStatusChoices.READY_FOR_ENGINEERING): {
|
20 | 8 | "message": "Research on {name} is complete. Ready for engineering! :rocket:",
|
21 |
| - "tags": [ |
22 |
| - SLACK_ID_MAPPING["Xiang Li"], |
23 |
| - SLACK_ID_MAPPING["Shravan Vishwanathan"], |
24 |
| - SLACK_ID_MAPPING["Advait Yogaonkar"], |
25 |
| - ], |
26 | 9 | },
|
27 | 10 | (WorkflowStatusChoices.ENGINEERING_IN_PROGRESS, WorkflowStatusChoices.READY_FOR_CURATION): {
|
28 | 11 | "message": "Engineering on {name} is complete. Ready for curation! :mag:",
|
29 |
| - "tags": [SLACK_ID_MAPPING["Emily Foshee"]], |
30 | 12 | },
|
31 | 13 | (WorkflowStatusChoices.CURATION_IN_PROGRESS, WorkflowStatusChoices.CURATED): {
|
32 | 14 | "message": "Curation on {name} is complete. It's now curated! :checkered_flag:",
|
33 |
| - "tags": [ |
34 |
| - SLACK_ID_MAPPING["Carson Davis"], |
35 |
| - SLACK_ID_MAPPING["Bishwas Praveen"], |
36 |
| - SLACK_ID_MAPPING["Ashish Acharya"], |
37 |
| - ], |
38 | 15 | },
|
39 | 16 | (WorkflowStatusChoices.SECRET_DEPLOYMENT_STARTED, WorkflowStatusChoices.SECRET_DEPLOYMENT_FAILED): {
|
40 | 17 | "message": "Alert: Secret deployment of {name} has failed! :warning:",
|
41 |
| - "tags": [ |
42 |
| - SLACK_ID_MAPPING["Carson Davis"], |
43 |
| - SLACK_ID_MAPPING["Bishwas Praveen"], |
44 |
| - SLACK_ID_MAPPING["Ashish Acharya"], |
45 |
| - ], |
46 | 18 | },
|
47 | 19 | (WorkflowStatusChoices.SECRET_DEPLOYMENT_STARTED, WorkflowStatusChoices.READY_FOR_LRM_QUALITY_CHECK): {
|
48 | 20 | "message": "Indexing of {name} on Secret Prod completed successfully. Ready for LRM QC! :clipboard:",
|
49 |
| - "tags": [SLACK_ID_MAPPING["Shravan Vishwanathan"], SLACK_ID_MAPPING["Advait Yogaonkar"]], |
50 | 21 | },
|
51 | 22 | (WorkflowStatusChoices.READY_FOR_LRM_QUALITY_CHECK, WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK): {
|
52 | 23 | "message": "LRM QC passed for {name}. Ready for final quality check! :white_check_mark:",
|
53 |
| - "tags": [SLACK_ID_MAPPING["Emily Foshee"]], |
54 | 24 | },
|
55 | 25 | (WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_FAILED): {
|
56 |
| - "message": "Quality check on {name} has failed. Changes needed! :x:", |
57 |
| - "tags": [ |
58 |
| - SLACK_ID_MAPPING["Xiang Li"], |
59 |
| - SLACK_ID_MAPPING["Shravan Vishwanathan"], |
60 |
| - SLACK_ID_MAPPING["Advait Yogaonkar"], |
61 |
| - ], |
| 26 | + "message": "<!here> <@U056B4HMGEP> <@U06L5SKQ5QA> Quality check on {name} has failed. Changes needed! :x:", |
62 | 27 | },
|
63 | 28 | (WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_PERFECT): {
|
64 | 29 | "message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
|
65 |
| - "tags": [ |
66 |
| - SLACK_ID_MAPPING["Carson Davis"], |
67 |
| - SLACK_ID_MAPPING["Bishwas Praveen"], |
68 |
| - SLACK_ID_MAPPING["Ashish Acharya"], |
69 |
| - ], |
70 | 30 | },
|
71 | 31 | (WorkflowStatusChoices.READY_FOR_FINAL_QUALITY_CHECK, WorkflowStatusChoices.QUALITY_CHECK_MINOR): {
|
72 | 32 | "message": "{name} has passed all quality checks and is ready for public production! :white_check_mark:",
|
73 |
| - "tags": [ |
74 |
| - SLACK_ID_MAPPING["Carson Davis"], |
75 |
| - SLACK_ID_MAPPING["Bishwas Praveen"], |
76 |
| - SLACK_ID_MAPPING["Ashish Acharya"], |
77 |
| - ], |
78 | 33 | },
|
79 | 34 | (WorkflowStatusChoices.QUALITY_CHECK_PERFECT, WorkflowStatusChoices.PROD_PERFECT): {
|
80 |
| - "message": "{name} is now live on Public Prod! Congrats team! :sparkles:", |
81 |
| - "tags": [SLACK_ID_MAPPING["channel"]], |
| 35 | + "message": "<!here> {name} is now live on Public Prod! Congrats team! :sparkles:", |
82 | 36 | },
|
83 | 37 | (WorkflowStatusChoices.QUALITY_CHECK_MINOR, WorkflowStatusChoices.PROD_MINOR): {
|
84 |
| - "message": "{name} is now live on Public Prod! Congrats team! :sparkles:", |
85 |
| - "tags": [SLACK_ID_MAPPING["channel"]], |
| 38 | + "message": "<!here> {name} is now live on Public Prod! Congrats team! :sparkles:", |
86 | 39 | },
|
87 | 40 | }
|
88 | 41 |
|
89 | 42 |
|
90 | 43 | def format_slack_message(name, details, collection_id):
|
91 | 44 | message_template = details["message"]
|
92 |
| - tags = " ".join([f"<{user}>" for user in details["tags"]]) |
93 | 45 | link = f"https://sde-indexing-helper.nasa-impact.net/{collection_id}/" # noqa: E231
|
94 | 46 | linked_name = f"<{link}|{name}>"
|
95 |
| - return tags + " " + message_template.format(name=linked_name) |
| 47 | + return message_template.format(name=linked_name) |
96 | 48 |
|
97 | 49 |
|
98 | 50 | def send_slack_message(message):
|
|
0 commit comments