-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
[infra] feat: notify Discord role when URLs checks fail #1824
Conversation
@@ -88,6 +88,9 @@ export TWBOT_ACCESS_TOKEN_EN | |||
TWBOT_ACCESS_TOKEN_SECRET_EN=$(get_settings_value .TWITTERBOT_CREDENTIALS.\"@TournesolBot\".ACCESS_TOKEN_SECRET) | |||
export TWBOT_ACCESS_TOKEN_SECRET_EN | |||
|
|||
DISCORD_ROLE_ID_URLS_CHECKS="$(ssh "$VM_USER@$VM_ADDR" -- sudo cat /root/discord_role_id_urls_checks)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the current state, if /root/discord_role_id_urls_checks
doesn't exist the command will fail and will stop the deployment.
If we want to keep this feature optional, we could use:
# won't fail, the error will be displayed in the stdout
sudo cat /root/discord_role_id_urls_checks || true
# won't fail, the error will be silent
sudo cat /root/discord_role_id_urls_checks 2> /dev/null || true
In theory I think that DISCORD_ROLE_ID_URLS_CHECKS
should be optional, to let people deploy a Tournesol instance without being forced to use Discord alerts. Thus using 2> /dev/null
could be appropriate if we don't want to display an error when an optional setting is missing.
What do you think @amatissart ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2> /dev/null
is fine.
Alternatively, I think it would be acceptable to define the variable discord_role_id_urls_checks
publicly in "inventory.yml" in the tournesol-prod
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related issues #1822
Description
This PR makes the external URLs monitoring script able to highlight a specific Discord role when it fails.
The goal is to explicitly and quickly notify the core team when the staging and production server are unreachable.
Checklist