Skip to content
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

✨(deploy) slack notify authors of deployments #3101

Merged
merged 2 commits into from
Jan 17, 2024
Merged

Conversation

mlbrgl
Copy link
Member

@mlbrgl mlbrgl commented Jan 15, 2024

Send Slack notifications when a new content deployment finishes.

Screenshot 2024-01-15 at 16.07.52.png

To trigger a new notification locally:

  • set BUILDKITE_DEPLOY_CONTENT_PIPELINE_SLUG=testing-notify-authors-on-slack
  • set BUILDKITE_API_ACCESS_TOKEN
  • yarn startDeployQueueServer
  • update a chart to trigger a new "deploy" (with the queue updated above, this will only trigger a slack notification, and not an actual deploy)

This relies on:

@mlbrgl
Copy link
Member Author

mlbrgl commented Jan 15, 2024

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@mlbrgl mlbrgl marked this pull request as ready for review January 15, 2024 15:44
@mlbrgl mlbrgl requested a review from Marigold January 15, 2024 15:44
@mlbrgl mlbrgl force-pushed the slack-notify-deploy branch from 8b43774 to 7ce27c0 Compare January 15, 2024 17:04
@mlbrgl mlbrgl changed the base branch from refresh-deploy-status to master January 15, 2024 17:04
Copy link
Contributor

@Marigold Marigold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't test it on staging because of an error (perhaps it needs to be rebased or the staging server needs to be restarted?). I couldn't make it work on local, but my setup is a bit screwed right now.

The code looks good though! I'm just wondering why don't you send the notification directly (since you already have a connection to slack web api) and instead go through buildkite? (I'm not saying it's a bad thing, you must have good reasons to do it like that)

(On a side note, it'd be nice to have slack info in users table so that we don't have to do the conversion. But it's obviously out of scope and not a priority.)

@mlbrgl
Copy link
Member Author

mlbrgl commented Jan 17, 2024

@Marigold thanks for the review!

it'd be nice to have slack info in users table so that we don't have to do the conversion.

💯

I'm just wondering why don't you send the notification directly (since you already have a connection to slack web api) and instead go through buildkite?

Yes it's true that using the slack API in two different places seems a bit redundant. I prefer going through BK because it makes the pipeline more self-contained. It also makes dealing with errors in this side-effect straightforward: we see them straightaway in context, for free (no additional reporting to set up, and no need to worry about what to report, and what it means for the rest of the code execution).

Another reason was reusability: we might want to notify through slack from other pipelines, and it's convenient to just grap that one-liner and paste it in.

When and if we do save slack IDs in the DB, the reliance on the slack API at bake time would disappear, which might make the slacktee approach even more palatable.

I couldn't test it on staging because of an error (perhaps it needs to be rebased or the staging server needs to be restarted?). I

I rebuilt the server and set up the relevant BUILDKITE_* env vars. Upon saving or updating a new gdoc, notifications are sent.

Note that lightning content updates are currently broken, so they will appear as regular full bakes but support for lightning bakes is there:

Screenshot 2024-01-17 at 15 42 28

@mlbrgl
Copy link
Member Author

mlbrgl commented Jan 17, 2024

Merge activity

  • Jan 17, 12:56 PM: @mlbrgl started a stack merge that includes this pull request via Graphite.
  • Jan 17, 12:57 PM: @mlbrgl merged this pull request with Graphite.

@mlbrgl mlbrgl merged commit dbd83a8 into master Jan 17, 2024
14 of 16 checks passed
@mlbrgl mlbrgl deleted the slack-notify-deploy branch January 17, 2024 17:57
@Marigold
Copy link
Contributor

Thanks for the explanation; agree with all your points.

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.

3 participants