Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our Slack API integration currently relies on legacy tokens, which have been deprecated in favor of Slack App (or Bot) tokens. While existing legacy tokens continue to work for now, new tokens are no longer being issued, which has resulted in engineers having to share personal tokens around with new hires. Legacy tokens will likely be removed entirely in a future Slack update, so let's get ahead of that and switch our Slack API calls to use a new Bot token that can be properly shared!
A few notes:
chat.command
endpoint, which was not updated to accept Bot tokens. Since this was only being used in theci_build
script to set a/remind
er for the DOTD, I replaced thecommand
function with aremind
function that utilizes thechat.scheduleMessage
endpoint to send a DM from the bot to a given user at a given time.message
function that is widely used across the codebase. This function utilizes an incoming webhook to send messages to various channels in Slack, and never used the legacy token to do so. I opted to leave this function untouched.Links
Context: Slack thread
Jira ticket: FND-1699
More info: doc
Testing story
Existing Slack tests have been updated accordingly
Deployment strategy & follow-up
Once deployed, automated processes that post to Slack (using anything other than Slack.message) will need to do so using the new Bot token. The
locals.yml
of all servers currently using a legacy token will need to be updated to use the new token.Once individual engineers pull this change locally, they should update their own
locals.yml
to use the new bot token before running the DOTD script.