Build Airflow Slack connections from path variables #3813
Labels
🤖 aspect: dx
Concerns developers' experience with the codebase
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
🟩 priority: low
Low priority and doesn't need to be rushed
🧱 stack: catalog
Related to the catalog and Airflow DAGs
Current Situation
Currently, the Airflow connections for the Slack hook are configured through the Admin UI in production and by environment variable locally. The connection URI looks is formatted like:
https://hooks.slack.com/services/foo/bar/baz
. In order for the host to be parsed correctly, the string must be url encoded when set via an environment variable (ie,https://hooks.slack.com%2Fservices%2Ffoo%2Fbar%2Fbaz
. This is somewhat tedious when switching between local testing set ups, so for convenience we modify the Slack environment variables in theentrypoint
script to encode them properly (#3805).Suggested Improvement
Modifying the environment variables in the entrypoint script is not ideal and has led to confusion in the past (#3805). We could instead use an Airflow variable to define the Slack webhook URL and then use it to create the Connection in the SlackMessage class.
Benefit
The text was updated successfully, but these errors were encountered: