Skip to content

Commit 47edfe0

Browse files
authored
DMP-5285 Enable notify label for dev emails (#3090)
1 parent 30e1781 commit 47edfe0

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

Jenkinsfile_CNP

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def determineDevEnvironmentDeployment() {
8383
env.DEV_DARTS_GATEWAY_URL = "http://darts-gateway.staging.platform.hmcts.net"
8484
env.DEV_DARTS_GATEWAY_IMAGE_SUFFIX = "latest"
8585

86+
env.NOTIFICATION_SCHEDULER_ENABLED = false
87+
env.AUTOMATED_TASK_MODE = true
8688

8789
env.DEV_ENABLE_DARTS_KEDA = false
8890

@@ -97,6 +99,13 @@ def determineDevEnvironmentDeployment() {
9799

98100
def githubApi = new GithubAPI(this)
99101
if (githubApi.checkForLabel(env.BRANCH_NAME, "enable_keep_helm")) {
102+
if (githubApi.checkForLabel(env.BRANCH_NAME, "enable_notify")) {
103+
echo "enable_notify label detected; scheduler enabled in PR environment"
104+
105+
env.NOTIFICATION_SCHEDULER_ENABLED = true
106+
env.AUTOMATED_TASK_MODE = false
107+
}
108+
100109
for (label in githubApi.getLabelsbyPattern(env.BRANCH_NAME, "enable_darts_")) {
101110

102111
//Portal

charts/darts-api/values.dev.template.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ java:
1414
keyVaults:
1515
"darts":
1616
secrets:
17-
- name: GovukNotifyTestApiKey
17+
- name: GovukNotifyApiKey
1818
alias: GOVUK_NOTIFY_API_KEY
1919
- name: app-insights-connection-string
2020
alias: app-insights-connection-string
21-
- name: GovukNotifyTestApiKey
22-
alias: GOVUK_NOTIFY_API_KEY
2321
- name: api-POSTGRES-USER
2422
alias: DARTS_API_DB_USERNAME
2523
- name: api-POSTGRES-PASS
@@ -119,7 +117,8 @@ java:
119117
TESTING_SUPPORT_ENDPOINTS_ENABLED: true
120118
DARTS_GATEWAY_URL: ${DEV_DARTS_GATEWAY_URL}
121119
DARTS_PORTAL_URL: ${DEV_DARTS_PORTAL_URL}
122-
AUTOMATED_TASK_MODE: true
120+
NOTIFICATION_SCHEDULER_ENABLED: ${NOTIFICATION_SCHEDULER_ENABLED}
121+
AUTOMATED_TASK_MODE: ${AUTOMATED_TASK_MODE}
123122
API_MODE: true
124123
IS_MOCK_ARM_RPO_DOWNLOAD_CSV: false
125124
AZCOPY_LOG_LEVEL: "--log-level=ERROR"
@@ -313,7 +312,6 @@ function:
313312
DARTS_API_DB_USERNAME: "hmcts"
314313
ATS_MODE: true
315314
API_MODE: false
316-
NOTIFICATION_SCHEDULER_ENABLED: false
317315
AUTOMATED_TASK_MODE: false
318316
POSTGRES_SSL_MODE: require
319317
RUN_DB_MIGRATION_ON_STARTUP: false

src/main/java/uk/gov/hmcts/darts/notification/service/impl/NotificationServiceImpl.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ private NotificationEntity saveNotificationToDb(String eventId, Integer caseId,
157157
public void sendNotificationToGovNotify() {
158158
if (notificationsEnabled && !automatedTasksMode) {
159159
sendNotificationToGovNotifyNow();
160+
} else {
161+
log.trace("Notification scheduler is disabled.");
160162
}
161163
}
162164

0 commit comments

Comments
 (0)