File tree Expand file tree Collapse file tree 2 files changed +10
-14
lines changed
sql/moz-fx-data-shared-prod/external_derived/market_intel_bot_v1 Expand file tree Collapse file tree 2 files changed +10
-14
lines changed Original file line number Diff line number Diff line change @@ -19,5 +19,5 @@ scheduling:
1919 key : bqetl_chrome_releases__open_ai_api_key
2020 - deploy_target : MARKET_INTEL_BOT_GITHUB_ACCESS_TOKEN
2121 key : bqetl_market_intel_bot__github_token
22- # - deploy_target: SLACK_MARKET_INTEL_BOT_WEBHOOK_URL
23- # key: bqetl_market_intel_bot__webhook_url
22+ - deploy_target : SLACK_MARKET_INTEL_BOT_WEBHOOK_URL
23+ key : bqetl_market_intel_bot__webhook_url
Original file line number Diff line number Diff line change 4343
4444# Pull in the different keys from GSM
4545OPENAI_API_TOKEN = os .getenv ("DATA_ENG_OPEN_AI_API_KEY" )
46- # SLACK_WEBHOOK = os.getenv("SLACK_MARKET_INTEL_BOT_WEBHOOK_URL")
46+ SLACK_WEBHOOK = os .getenv ("SLACK_MARKET_INTEL_BOT_WEBHOOK_URL" )
4747GITHUB_ACCESS_TOKEN = os .getenv ("MARKET_INTEL_BOT_GITHUB_ACCESS_TOKEN" )
4848
4949# If any aren't found, raise an error
5050if not OPENAI_API_TOKEN :
5151 raise ValueError ("Environment variable DATA_ENG_OPEN_AI_API_KEY is not set!" )
52- # if not SLACK_WEBHOOK:
53- # raise ValueError(
54- # "Environment variable SLACK_MARKET_INTEL_BOT_WEBHOOK_URL is not set!"
55- # )
52+ if not SLACK_WEBHOOK :
53+ raise ValueError (
54+ "Environment variable SLACK_MARKET_INTEL_BOT_WEBHOOK_URL is not set!"
55+ )
5656if not GITHUB_ACCESS_TOKEN :
5757 raise ValueError (
5858 "Environment variable MARKET_INTEL_BOT_GITHUB_ACCESS_TOKEN is not set!"
@@ -426,13 +426,9 @@ def main():
426426 raise Exception (error_message )
427427
428428 # Build the message & include the link to the report
429- # message = {
430- # "text": """ :robot_face: Your latest market intelligence report is here:
431- # https://github.com/mozilla/market_intel_bot/tree/main/REPORTS"""
432- # }
433-
434- # Send the message & report to Slack
435- # requests.post(SLACK_WEBHOOK, json=message, timeout=20)
429+ response = requests .post (SLACK_WEBHOOK )
430+ response .raise_for_status ()
431+ print ("Slack message sent successfully!" )
436432
437433
438434if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments