Add build stage to Slack's build messages
On GitLab-CI using a multi-stage pipeline, the Slack build messages for a single commit look like:
owner/project: Commit ffaabb of branch by human passed in 80 seconds
owner/project: Commit ffaabb of branch by human passed in 456 seconds
owner/project: Commit ffaabb of branch by human passed in 501 seconds
owner/project: Commit ffaabb of branch by human passed in 555 seconds
I'd like these messages to include the build stage. That way we could know which stage passed or failed. It could look like this:
owner/project: Commit ffaabb of branch by human passed build in 80 seconds
owner/project: Commit ffaabb of branch by human passed test in 456 seconds
owner/project: Commit ffaabb of branch by human passed post-test in 700 seconds
Rather than display the duration for the entire pipeline, could it be for the current build stage instead? It also would be nice if time was displayed as '1 minute and 20 seconds' too.
I took a look at https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/models/project_services/slack_service/build_message.rb but wasn't sure how to find the build stage name.