diff --git a/.github/actions/pr_notifier/pr_notifier.py b/.github/actions/pr_notifier/pr_notifier.py index 14ddcd0cf1121..4366327d28880 100644 --- a/.github/actions/pr_notifier/pr_notifier.py +++ b/.github/actions/pr_notifier/pr_notifier.py @@ -17,9 +17,7 @@ import os import sys -import requests import github -import icalendar from slack_sdk import WebClient from slack_sdk.errors import SlackApiError @@ -45,9 +43,6 @@ 'soulxu': 'U01GNQ3B8AY', } -# Oncall calendar -CALENDAR = "https://calendar.google.com/calendar/ical/d6glc0l5rc3v235q9l2j29dgovh3dn48%40import.calendar.google.com/public/basic.ics" - # First pass reviewers who are not maintainers should get # notifications but not result in a PR not getting assigned a # maintainer owner. @@ -231,30 +226,10 @@ def post_to_oncall(client, unassigned_prs, out_slo_prs): text=( "*Untriaged Issues* (please tag and cc area experts)\n<%s|%s>" % (issue_link, issue_link))) - # On Monday, post the new oncall. - if datetime.date.today().weekday() == 0: - oncall = parse_calendar() - client.chat_postMessage(channel='#envoy-maintainer-oncall', text=(oncall)) - client.chat_postMessage(channel='#general', text=(oncall)) except SlackApiError as e: print("Unexpected error %s", e.response["error"]) -def parse_calendar(): - ical = requests.get(CALENDAR) - parsed_calendar = icalendar.Calendar.from_ical(ical.text) - ical.close() - - now = datetime.datetime.now() - sunday = now - datetime.timedelta(days=now.weekday() + 1) - - for component in parsed_calendar.walk(): - if component.name == "VEVENT": - if (sunday.date() == component.decoded("dtstart").date()): - return component.get("summary") - return "unable to find this week's oncall" - - if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( diff --git a/.github/actions/pr_notifier/requirements.in b/.github/actions/pr_notifier/requirements.in index e564157d3eeaa..b27ccacba25ae 100644 --- a/.github/actions/pr_notifier/requirements.in +++ b/.github/actions/pr_notifier/requirements.in @@ -1,4 +1,2 @@ pygithub slack_sdk -requests -icalendar diff --git a/.github/actions/pr_notifier/requirements.txt b/.github/actions/pr_notifier/requirements.txt index 12832516484f2..3ef51ec40c41e 100644 --- a/.github/actions/pr_notifier/requirements.txt +++ b/.github/actions/pr_notifier/requirements.txt @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with Python 3.11 -# by the following command: +# This file is autogenerated by pip-compile +# To update, run: # -# pip-compile --allow-unsafe --generate-hashes requirements.in +# pip-compile --generate-hashes .github/actions/pr_notifier/requirements.txt # certifi==2023.7.22 \ --hash=sha256:539cc1d13202e33ca466e88b2807e29f4c13049d6d87031a3c110744495cb082 \ @@ -167,10 +167,6 @@ deprecated==1.2.13 \ --hash=sha256:43ac5335da90c31c24ba028af536a91d41d53f9e6901ddb021bcc572ce44e38d \ --hash=sha256:64756e3e14c8c5eea9795d93c524551432a0be75629f8f29e67ab8caf076c76d # via pygithub -icalendar==5.0.10 \ - --hash=sha256:34f0ca020b804758ddf316eb70d1d46f769bce64638d5a080cb65dd46cfee642 \ - --hash=sha256:6e392c2f301b6b5f49433e14c905db3de444b12876f3345f1856a75e9cd8be6f - # via -r requirements.in idna==2.10 \ --hash=sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6 \ --hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0 @@ -210,36 +206,28 @@ pynacl==1.4.0 \ python-dateutil==2.8.2 \ --hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \ --hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 - # via - # icalendar - # pygithub -pytz==2023.3.post1 \ - --hash=sha256:7b4fddbeb94a1eba4b557da24f19fdf9db575192544270a9101d8509f9f43d7b \ - --hash=sha256:ce42d816b81b68506614c11e8937d3aa9e41007ceb50bfdcb0749b921bf646c7 - # via icalendar + # via pygithub requests==2.31.0 \ --hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \ --hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1 - # via - # -r requirements.in - # pygithub + # via pygithub six==1.16.0 \ --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 # via # pynacl # python-dateutil -slack-sdk==3.23.0 \ - --hash=sha256:2a8513505cced20ceee22b5b49c11d9545caa6234b56bf0ad47133ea5b357d10 \ - --hash=sha256:9d6ebc4ff74e7983e1b27dbdb0f2bb6fc3c2a2451694686eaa2be23bbb085a73 +slack-sdk==3.22.0 \ + --hash=sha256:6eacce0fa4f8cfb4d84eac0d7d7e1b1926040a2df654ae86b94179bdf2bc4d8c \ + --hash=sha256:f102a4902115dff3b97c3e8883ad4e22d54732221886fc5ef29bfc290f063b4a # via -r requirements.in typing-extensions==4.8.0 \ --hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \ --hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef # via pygithub -urllib3==1.26.17 \ - --hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \ - --hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b +urllib3==1.26.6 \ + --hash=sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4 \ + --hash=sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f # via # pygithub # requests