Skip to content

chore: Prevent crash when empty channel is defined in the slack map - #65

Merged
chouetz merged 2 commits into
masterfrom
nicolas.schweitzer/handle-empty-channel
Jun 2, 2026
Merged

chore: Prevent crash when empty channel is defined in the slack map#65
chouetz merged 2 commits into
masterfrom
nicolas.schweitzer/handle-empty-channel

Conversation

@chouetz

@chouetz chouetz commented Jun 1, 2026

Copy link
Copy Markdown
Member

What does this PR do?

  • Prevent crash when empty channel is defined in the slack map
  • Improve crashes to always return channel information

Motivation

Maintenance

Describe how you validated your changes

Added some unit tests

Additional Notes

@chouetz

chouetz commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6746655c65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread slapr/review_map.py
Comment on lines +75 to +76
case {"review": {"id": "", **_rest}}:
print(f"Info: Empty channel id for {team}, notifications suppressed")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve empty-channel mappings to suppress notifications

For a team whose map entry has review.id: '', this branch only logs suppression and leaves the team out of team_to_channel. Downstream, both _resolve_target_channels and get_channels_for_requested_teams treat missing teams as unmapped and fall back to SLACK_CHANNEL_ID/default_channel_id, so an explicitly suppressed requested team with a non-empty default channel will still get notifications in the default channel. Store an explicit None/sentinel for suppressed teams (and have callers honor it) instead of making them indistinguishable from unknown teams.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is not a big deal we can leave with it.

@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Jun 1, 2026

Copy link
Copy Markdown

Pipelines

Fix all issues with BitsAI

⚠️ Warnings

🚦 1 Pipeline job failed

Slack emoji PR updates | run_slapr   View in Datadog   GitHub Actions

🛟 This job is unlikely to succeed on retry. Please review your pipeline configuration. KeyError: 'SLACK_API_TOKEN'. The required environment variable is missing.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6746655 | Docs | Datadog PR Page | Give us feedback!

@chouetz
chouetz merged commit 95312d6 into master Jun 2, 2026
10 of 12 checks passed
@chouetz
chouetz deleted the nicolas.schweitzer/handle-empty-channel branch June 2, 2026 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants