Skip to content

Commit

Permalink
v1.13.8
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyorlando authored Dec 6, 2024
2 parents 2183a03 + e115617 commit 73a0a01
Show file tree
Hide file tree
Showing 36 changed files with 303 additions and 879 deletions.
10 changes: 5 additions & 5 deletions engine/apps/alerts/models/alert_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ def status(self) -> int:
)

prevent_posting_alerts = models.BooleanField(default=False)
"""
TODO: this column is no longer used, drop it in a subsequent PR/release
"""

maintenance_uuid = models.CharField(max_length=100, unique=True, null=True, default=None)

raw_escalation_snapshot = JSONField(null=True, default=None)
Expand Down Expand Up @@ -1983,11 +1987,7 @@ def slack_channel_id(self) -> str | None:
channel_filter = self.channel_filter

if self.slack_message:
# TODO: once _channel_id has been fully migrated to channel, remove _channel_id
# see https://raintank-corp.slack.com/archives/C06K1MQ07GS/p173255546
#
# return self.slack_message.channel.slack_id
return self.slack_message._channel_id
return self.slack_message.channel.slack_id
elif channel_filter and channel_filter.slack_channel_or_org_default:
return channel_filter.slack_channel_or_org_default.slack_id
return None
Expand Down
12 changes: 6 additions & 6 deletions engine/apps/alerts/tests/test_alert_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def test_render_for_phone_call(

alert_group = make_alert_group(alert_receive_channel)
slack_channel = make_slack_channel(slack_team_identity)
make_slack_message(alert_group=alert_group, channel=slack_channel)
make_slack_message(slack_channel, alert_group=alert_group)

make_alert(
alert_group,
Expand Down Expand Up @@ -105,7 +105,7 @@ def test_delete(
make_alert(alert_group, raw_request_data={})

# Create Slack messages
slack_message = make_slack_message(alert_group=alert_group, channel=slack_channel1)
slack_message = make_slack_message(slack_channel1, alert_group=alert_group)
resolution_note_1 = make_resolution_note_slack_message(
alert_group=alert_group,
user=user,
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_delete_slack_ratelimit(
make_alert(alert_group, raw_request_data={})

# Create Slack messages
make_slack_message(alert_group=alert_group, channel=slack_channel1)
make_slack_message(slack_channel1, alert_group=alert_group)
make_resolution_note_slack_message(
alert_group=alert_group,
user=user,
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_delete_slack_api_error_other_than_ratelimit(
make_alert(alert_group, raw_request_data={})

# Create Slack messages
make_slack_message(alert_group=alert_group, channel=slack_channel1)
make_slack_message(slack_channel1, alert_group=alert_group)
make_resolution_note_slack_message(
alert_group=alert_group,
user=user,
Expand Down Expand Up @@ -827,8 +827,8 @@ def test_slack_channel_id_with_slack_message(
slack_channel = make_slack_channel(slack_team_identity)
slack_message = make_slack_message(slack_channel, alert_group=alert_group)

# Assert that slack_channel_id returns the _channel_id from slack_message
assert alert_group.slack_channel_id == slack_message._channel_id
# Assert that slack_channel_id returns the channel.slack_id from slack_message
assert alert_group.slack_channel_id == slack_message.channel.slack_id

@pytest.mark.django_db
def test_slack_channel_id_with_channel_filter(
Expand Down
Loading

0 comments on commit 73a0a01

Please sign in to comment.