Skip to content

Fix Broken link formatting in Gitlab for Slack app

What does this MR do and why?

Per #31263 (closed), we're experiencing broken formatting in the GitLab for Slack app for deployment messages.

This MR is fixing the ~bug by formatting description message in the attachments.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Checkout the branch
  2. Configure the GitLab for Slack App integration
  3. Prepare a deployment message
  4. Create a testing channel in the testing Slack app
  5. Notify the channel with the deployment message.
# prepare a deployment message
deployment = DeploymentsFinder.new(project: Project.find('ABC'), order_by: 'created_at', sort: 'desc').execute.first
deployment_events_data = Gitlab::DataBuilder::Deployment.build(deployment, deployment.status, Time.current)
deployment_message = Integrations::ChatMessage::DeploymentMessage.new(deployment_events_data)

gitlab_slack_app = Integrations::GitlabSlackApplication.find('XYZ')
gitlab_slack_app.send(:notify, deployment_message, { channel: '#bojan-testing' })

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #31263 (closed)

Edited by Bojan Marjanovic

Merge request reports