Skip to content

Commit

Permalink
Merge pull request #97 from cloudflare/add-timestamps-to-reports
Browse files Browse the repository at this point in the history
Add timestamps to gchat cards
  • Loading branch information
third774 authored Aug 23, 2024
2 parents 8663207 + 08a9dbb commit e19f7bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/routes/api.bugReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const action = async ({ request, context }: ActionFunctionArgs) => {
card: {
header: {
title: `Feedback from ${identity?.name ?? ''}`,
subtitle: `Environment: ${hostname} commit: ${RELEASE}`,
subtitle: `Time: ${new Date().toISOString()} Environment: ${hostname} commit: ${RELEASE}`,
imageUrl:
'https://developers.google.com/chat/images/quickstart-app-avatar.png',
imageType: 'CIRCLE',
Expand Down
7 changes: 5 additions & 2 deletions app/routes/api.deadTrack.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ActionFunctionArgs } from '@remix-run/cloudflare'
import { json } from '@remix-run/cloudflare'
import type { ChatCard } from '~/types/GoogleChatApi'
import { RELEASE } from '~/utils/constants'

export type DeadTrackInfo = {
pullSessionTrace: string
Expand All @@ -23,14 +24,16 @@ export const action = async ({ request, context }: ActionFunctionArgs) => {
pushingUser,
} = info

const { hostname } = new URL(request.url)

const chatCard: ChatCard = {
cardsV2: [
{
cardId: 'orange-meets-dead-track-card',
card: {
header: {
title: `💀 Dead track detected`,
subtitle: `${pullingUser} had issue pulling from ${pushingUser}`,
title: `💀 Dead track: ${pullingUser} had issue pulling from ${pushingUser}`,
subtitle: `Time: ${new Date().toISOString()} Environment: ${hostname} commit: ${RELEASE}`,
imageUrl:
'https://developers.google.com/chat/images/quickstart-app-avatar.png',
imageType: 'CIRCLE',
Expand Down

0 comments on commit e19f7bb

Please sign in to comment.