Skip to content

Commit

Permalink
Merge pull request #146 from shoplineapp/feature/SL-39607-open-teleme…
Browse files Browse the repository at this point in the history
…try-query-deprecated-for-argo-cron-workflow-after-grafana-upgrade

feat(cronjob): Use button section for customUrl and Argo Dashboard
  • Loading branch information
neal-sl authored Apr 11, 2024
2 parents 7807f84 + b8bedcb commit fdf7015
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion cronjob/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
description: Helm chart with simple cronjob template
name: cronjob
version: 0.7.4
version: 0.7.5
appVersion: 1.0.0
tillerVersion: ">=2.14.3"
87 changes: 55 additions & 32 deletions cronjob/templates/_exit_handler_slack_app.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,7 @@
{
\"type\": \"mrkdwn\",
\"text\": \"*Duration*\\n{{ "{{" }}workflow.duration{{ "}}" }} sec\"
},
{
\"type\": \"mrkdwn\",
\"text\": \"*Argo Dashboard*\\n<{{required "exitNotifications.slackApp.portalDomain must be provided" $slackApp.portalDomain}}/workflows/{{ "{{" }}workflow.namespace{{ "}}" }}/{{ "{{" }}workflow.name{{ "}}" }}?tab=workflow|View>\"
}
{{- if $slackApp.customUrls }}
,{
\"type\": \"mrkdwn\",
{{ $max := add (len $slackApp.customUrls) -1 }}
\"text\": \"*Extra Links*\\n{{- range $index, $value := $slackApp.customUrls }}
{{- with $value }}
<{{ .url }}|{{ .title }}>
{{- if gt $max $index }},{{- end}}
{{- end }}
{{- end }}\"
}
{{- end }}
]
}
{{- if $slackApp.mention }}
Expand All @@ -69,6 +53,34 @@
}
{{- end }}
{{- end }}
,
{
\"type\": \"actions\",
\"elements\": [
{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \"Argo Dashboard\"
},
\"url\": \"{{required "exitNotifications.slackApp.portalDomain must be provided" $slackApp.portalDomain}}/workflows/{{ "{{" }}workflow.namespace{{ "}}" }}/{{ "{{" }}workflow.name{{ "}}" }}?tab=workflow\"
}
{{- if $slackApp.customUrls }}
{{- range $index, $value := $slackApp.customUrls }}
{{- with $value }}
,{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \"{{.title}}\"
},
\"url\": \"{{.url}}\"
}
{{- end }}
{{- end }}
{{- end }}
]
}
]
}
]}'
Expand Down Expand Up @@ -113,23 +125,7 @@
{
\"type\": \"mrkdwn\",
\"text\": \"*Duration*\\n{{ "{{" }}workflow.duration{{ "}}" }} sec\"
},
{
\"type\": \"mrkdwn\",
\"text\": \"*Argo Dashboard*\\n<{{required "exitNotifications.slackApp.portalDomain must be provided" $slackApp.portalDomain}}/workflows/{{ "{{" }}workflow.namespace{{ "}}" }}/{{ "{{" }}workflow.name{{ "}}" }}?tab=workflow|View>\"
}
{{- if $slackApp.customUrls }}
,{
\"type\": \"mrkdwn\",
{{ $max := add (len $slackApp.customUrls) -1 }}
\"text\": \"*Extra Links*\\n{{- range $index, $value := $slackApp.customUrls }}
{{- with $value }}
<{{ .url }}|{{ .title }}>
{{- if gt $max $index }},{{- end}}
{{- end }}
{{- end }}\"
}
{{- end }}
]
}
{{- if $slackApp.mention }}
Expand All @@ -152,6 +148,33 @@
}
}
{{- end }}
,{
\"type\": \"actions\",
\"elements\": [
{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \"Argo Dashboard\"
},
\"url\": \"{{required "exitNotifications.slackApp.portalDomain must be provided" $slackApp.portalDomain}}/workflows/{{ "{{" }}workflow.namespace{{ "}}" }}/{{ "{{" }}workflow.name{{ "}}" }}?tab=workflow\"
}
{{- if $slackApp.customUrls }}
{{- range $index, $value := $slackApp.customUrls }}
{{- with $value }}
,{
\"type\": \"button\",
\"text\": {
\"type\": \"plain_text\",
\"text\": \"{{.title}}\"
},
\"url\": \"{{.url}}\"
}
{{- end }}
{{- end }}
{{- end }}
]
}
]
}
]}'
Expand Down

0 comments on commit fdf7015

Please sign in to comment.