Skip to content

Conversation

allejo
Copy link
Contributor

@allejo allejo commented Aug 19, 2025

Dedupe Press/Resource Slack Notifications

Reported by @thekaveman, on Slack, the "New Press/Resource Request" Slack notification was reporting the issue twice.

SCR-20250818-tnlo

This was fixed in 8e48028.

One workflow gets triggered per label that was added. For example, in
"content" and "resources". Our if statement checked with contains
against the issue.labels.*.name array, which included both labels
already since these labels were created alongside the issue; opposed to
being added individually.

Instead, check that the label triggered this workflow is what we're
looking for.

Report failed Netlify deployment previews to Slack

The Netlify App uses GitHub's pull request status API to communicate when Netlify's website checks fail, succeed, get canceled, etc. We can listen to these status updates and trigger a workflow when they happen.

if: (github.event.state == 'failure' || github.event.state == 'error') && endsWith(github.event.context, '/deploy-preview')

The context of the status we care for is netlify/cal-itp-website/deploy-preview, but why make things so strict? I felt like checking the whole string could inadvertently cause problems if we rename the project on Netlify at some point.

closes #474

Reporting to Slack on build failures is a paid extra.

image

We can circumvent this by either hosting or using someone's service to accept POST APIs and translate that into a Slack message.

allejo added 2 commits August 18, 2025 22:32
One workflow gets triggered per label that was added. For example, in
"content" and "resources". Our if statement checked with `contains`
against the `issue.labels.*.name` array, which included both labels
already since these labels were created alongside the issue; opposed to
being added individually.

Instead, check that the label triggered this workflow is what we're
looking for.
@allejo allejo requested a review from a team as a code owner August 19, 2025 06:04
Copy link

netlify bot commented Aug 19, 2025

Deploy Preview for cal-itp-website ready!

Name Link
🔨 Latest commit 7c1ff97
🔍 Latest deploy log https://app.netlify.com/projects/cal-itp-website/deploys/68a413dd31111000088dda1c
😎 Deploy Preview https://deploy-preview-486--cal-itp-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@leelas-pm
Copy link

Hi @thekaveman ! Just looked over this PR and I'm thinking it needs a dev reviewer/approver to proceed - also wanted to call out @allejo 's proposed solution for the build failure alert, since I think that's probably a conversation you may want to have with the team before we land on a solution? Not sure what your week looks like, so happy to save this one for slush if need be. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create alert for deploy preview and build command failure in #notify-websites channel on Cal-ITP Slack
2 participants