-
Notifications
You must be signed in to change notification settings - Fork 2
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
Display task container names for ECS task state change events #175
Conversation
@@ -258,6 +258,10 @@ function ecsTaskStateChangeMessageText(message) { | |||
const taskArn = message?.detail?.taskArn; | |||
const lastStatus = message?.detail?.lastStatus; | |||
let messageText = `Task ${taskArn} is now ${lastStatus}`; | |||
const taskContainers = message?.detail?.containers | |||
?.map((container) => container.name) | |||
.join(", "); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be robust when the containers
field is missing, probably needs a ?.join
so that an undefined
continues to propagate.
Also, right now, if the value of containers
is a scalar (which it probably never will be, but you never know), this code will throw at the map
invocation. What happens when the lambda throws, are we notified? If so, probably not worth worrying about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe we are notified. The lambda does have a dead queue configured but I don't think we do anything with it https://github.com/dockstore/dockstore-deploy/blob/38977e218b16a73d0a29167d00f3c89bbdb09b3d/cloudwatch-to-slack.yml.template#L146-L147
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This PR displays the containers that belong to the task when an ECS task state change event is received by the lambda.
See the dockstore-deploy PR https://github.com/dockstore/dockstore-deploy/pull/816 that redirects the events to different channels depending on if it's for the webservice task or a scheduled task.
The notifications now look like this for the webservice task:
and the topic updater task:
Issue
Implemented while doing https://ucsc-cgl.atlassian.net/browse/SEAB-6795, but technically tackles https://ucsc-cgl.atlassian.net/browse/SEAB-6746
Security
If there are any concerns that require extra attention from the security team, highlight them here.
Please make sure that you've checked the following before submitting your pull request. Thanks!