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

Post message to Slack when ingest completes successfully #1466

Merged
merged 3 commits into from
Nov 22, 2024

Conversation

eecavanna
Copy link
Collaborator

@eecavanna eecavanna commented Nov 22, 2024

In this branch, I updated the ingest CLI script so that, when it finishes a successful run, if a Slack incoming webhook URL is defined, the script uses that URL to post a message to a Slack channel. This technique for posting messages to Slack is documented here.

Outside of this PR, I have created a Slack app and—for that Slack app—generated an incoming webhook URL. That is what I plan to use on Spin (in all of our environments) once this code gets deployed there. For any reviewers that intend to test this locally, I can also provide that URL to you via Snappass (or Spin). Using that specific URL, the Slack message will be posted to the newly-created #ingest-notifications channel in the NMDC Slack workspace.

@eecavanna eecavanna linked an issue Nov 22, 2024 that may be closed by this pull request
@eecavanna eecavanna self-assigned this Nov 22, 2024
@eecavanna eecavanna marked this pull request as ready for review November 22, 2024 05:52
@eecavanna eecavanna changed the title Post message to Slack when ingest is done Post message to Slack when ingest completes successfully Nov 22, 2024
@eecavanna
Copy link
Collaborator Author

Thanks for reviewing/approving this.

Spin/Rancher has been configured with the Slack incoming webhook URL

Before merging this branch in, I have added the Slack incoming webhook URL to Rancher.

Specifically, in both the development and production environments (i.e. nmdc-dev and nmdc namespaces): I created an opaque secret named slack, which has an item whose key is SLACK_WEBHOOK_URL_FOR_INGESTERand whose value is that Slack incoming webhook URL. Then, I configured the portal-ingest CronJob so that it has an environment variable named SLACK_WEBHOOK_URL_FOR_INGESTER whose value comes from that secret key (as shown in the following screenshot).

image

As a result, once this gets merged into main, the next time the ingest runs successfully in the development environment, I expect a message to appear in the #ingest-notifications Slack channel.

In addition, after the next monthly NMDC release (i.e. when this code gets deployed to production), I expect a message to appear in that Slack channel whenever ingest runs successfully in production.

@eecavanna eecavanna merged commit f90bc87 into main Nov 22, 2024
2 checks passed
@eecavanna eecavanna deleted the 328-improve-alerting-and-sanity-checking-on-ingest branch November 22, 2024 18:27
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.

Improve alerting and sanity checking on ingest
2 participants