Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Merge requests
!246
Include environment name in notification email subject line
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Include environment name in notification email subject line
feature/distinguish-public-private-hostname
into
develop
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Karel van Klink
requested to merge
feature/distinguish-public-private-hostname
into
develop
9 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Viewing commit
34be7c8d
Show latest version
1 file
+
3
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Verified
34be7c8d
Include environment name in notification email subject line
· 34be7c8d
Karel van Klink
authored
9 months ago
gso/workflows/tasks/send_email_notifications.py
+
3
−
3
Options
@@ -18,10 +18,10 @@ def gather_failed_tasks() -> State:
@step
(
"
Send notification emails for all failed tasks
"
)
def
send_email_notifications
(
state
:
State
)
->
None
:
"""
Send out an email notification for all tasks that have failed.
"""
base_url
=
load_oss_params
().
GENERAL
.
public_hostname
general_settings
=
load_oss_params
().
GENERAL
all_alerts
=
""
for
failure
in
state
[
"
failed_tasks
"
]:
failed_task_url
=
f
"
{
base_url
}
/workflows/
{
failure
[
"
process_id
"
]
}
"
failed_task_url
=
f
"
{
general_settings
.
public_hostname
}
/workflows/
{
failure
[
"
process_id
"
]
}
"
failed_subscription
=
get_subscription_by_process_id
(
failure
[
"
process_id
"
])
all_alerts
=
f
"
{
all_alerts
}
------
\n\n
"
if
failed_subscription
:
@@ -36,7 +36,7 @@ def send_email_notifications(state: State) -> None:
)
send_mail
(
"
GAP - One or more tasks have failed!
"
,
f
"
GAP
{
general_settings
.
environment
}
environment
- One or more tasks have failed!
"
,
(
f
"
Please check the following tasks in GAP which have failed.
\n\n
{
all_alerts
}
------
"
f
"
\n\n
Regards, the GÉANT Automation Platform.
\n\n
"
Loading