Skip to content

Fix the mattermost created at timestamp#150

Merged
armiiller merged 1 commit intomainfrom
fix-mattermost-date-fix
Mar 13, 2026
Merged

Fix the mattermost created at timestamp#150
armiiller merged 1 commit intomainfrom
fix-mattermost-date-fix

Conversation

@armiiller
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the “Created” timestamp formatting for the Mattermost v3 channel integration, while refactoring Slack v3 to route timestamp rendering through an overridable helper.

Changes:

  • Update Mattermost v3 “Created” field output to an ISO8601 timestamp.
  • Extract Slack v3 “Created” field formatting into _alert_created_at_timestamp_formatted.
  • Update the Mattermost v3 test expectations to match the new timestamp format.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
test/models/pager_tree/integrations/channel/mattermost/v3_test.rb Updates expected “Created” field value to ISO8601 for Mattermost payloads.
app/models/pager_tree/integrations/channel/slack/v3.rb Adds a helper for Slack date formatting and uses it in the outgoing payload blocks.
app/models/pager_tree/integrations/channel/mattermost/v3.rb Overrides the Slack helper to emit an ISO8601 timestamp for Mattermost.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +71 to 76
def _alert_created_at_timestamp_formatted
"<!date^#{_alert.created_at.utc.to_i}^{date_num} {time_secs}|#{_alert.created_at.utc.to_i}>"
end

private

# we can just piggy back the Channel::Slack::V3 since Mattermost is a clone of Slack
# both integrations have the same exact functionality

def _alert_created_at_timestamp_formatted
{
title: "Created",
value: "<!date^#{@alert.created_at.utc.to_i}^{date_num} {time_secs}|#{@alert.created_at.utc.to_i}>",
value: @alert.created_at.utc.iso8601.to_s,
# both integrations have the same exact functionality

def _alert_created_at_timestamp_formatted
_alert.created_at.utc.iso8601.to_s
end

def _alert_created_at_timestamp_formatted
"<!date^#{_alert.created_at.utc.to_i}^{date_num} {time_secs}|#{_alert.created_at.utc.to_i}>"
@armiiller armiiller merged commit e9c031a into main Mar 13, 2026
6 checks passed
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