Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/pr_notifier/pr_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ def post_to_oncall(client, unassigned_prs, out_slo_prs):
if not SLACK_BOT_TOKEN:
print(
'Missing SLACK_BOT_TOKEN: please export token from https://api.slack.com/apps/A023NPQQ33K/oauth?'
' or disable actions via the instructions here: '
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, it would be less work to fail open and have this action succeed with this message if SLACK_BOT_TOKEN is missing. Is the assumption that the majority of Envoy contributors have their SLACK_BOT_TOKEN set up?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider that. The only reason I didn't do that is then if the token were missing in the main repo where this runs, it would silently fail to send out notifications and that might complicate debugging? But if this is really happening to everyone then maybe that's the right tradeoff?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this action not just bail if its not the envoy repo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I should have mentioned that I investigated that approach first. But from the docs I could not figure out a way to run just on the main repo. :/ Do you happen to know?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/'
'enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository'
)

sys.exit(1)

client = WebClient(token=SLACK_BOT_TOKEN)
Expand Down