I’m working on a project where we are going to integrate Lighthouse CI into our TeamCity Pipeline. That’s working, but I want to post results into our Slack channel using the official Slack Notifier and system messages (Slack Notifier itself is not able to use message templates yet).
I’m extracting the link and meta information about the report via the Lighthouse CI Server API which working perfectly, the only thing is imagine the project’s name (Git, TeamCity and LHCI) is “MyApp” and the Lighthouse CI report is stored in a link looking like http://192.168.1.3:9001/app/projects/myApp/compare/6c216h396311
The link that the notifier will post in our Slack Channel suddenly looks like this:
I tried to post “MyApp” as a default system message without using the Slack Notifier, and thats working. While using the Slack Notifier makes my projects name unreadable. I’m not able to find any information to prevent this behavior.
Let TeamCity post the LHCI Report from a on-premise hosted LHCI Server via System Messages and the official Slack Notifier.
Actually the only thing that should be prevented is to postURLs, which makes sense, but where to prevent censoring of the project’s name?
I’d be glad to help you with integrating Lighthouse CI into your TeamCity pipeline and posting results to Slack using the official Slack Notifier and system messages.
Understanding the Issue:
The problem seems to be that the Slack Notifier is censoring the project name in the URL. This is likely due to security measures to prevent sensitive information from being leaked.
Solution:
To resolve this, you can use a combination of system messages and the Slack Notifier:
Create a system message: In TeamCity, create a system message that contains the project name and the Lighthouse CI report link. You can use the following template:Lighthouse CI Report for MyApp: http://192.168.1.3:9001/app/projects/myApp/compare/6c216h396311Replace MyApp with the actual project name.
Post the system message to Slack: Use the Slack Notifier to post the system message to your desired Slack channel.
Additional Considerations:
Customizable system messages: If you need more flexibility in formatting the system message, you can use TeamCity’s built-in message formatting options.
Conditional posting: You can configure the Slack Notifier to post messages based on certain conditions, such as build success or failure.
Slack Notifier configuration: Ensure that the Slack Notifier is configured correctly with the necessary credentials and channel information.
By following these steps, you should be able to successfully post Lighthouse CI report results to your Slack channel without the project name being censored.