Skip to content

Commit 444109c

Browse files
authored
fix(alert): corrected code path and version check (#146)
# Testing with latest version ``` tasks: enabled: true ``` <img width="1411" height="987" alt="Screenshot 2025-11-14 at 12 20 29 PM" src="https://github.com/user-attachments/assets/3c48ad56-1fb7-477b-9a8f-1e04de24e40f" /> # Testing with older version ``` hyperdx: image: tag: 2.6.0 tasks: enabled: true ``` <img width="1271" height="626" alt="Screenshot 2025-11-14 at 12 23 25 PM" src="https://github.com/user-attachments/assets/200b75a2-4013-4c4d-81b4-2ae9cdf2c2b3" />
1 parent f2ae348 commit 444109c

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.changeset/smart-mammals-invent.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"helm-charts": patch
3+
---
4+
5+
Further fixes to the cronjob to use the correct path and version.

charts/hdx-oss-v2/templates/cronjobs/task-checkAlerts.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ spec:
2727
image: "{{ .Values.hyperdx.image.repository }}:{{ .Values.hyperdx.image.tag | default .Chart.AppVersion }}"
2828
imagePullPolicy: {{ .Values.hyperdx.image.pullPolicy }}
2929
{{- $tag := .Values.hyperdx.image.tag | default .Chart.AppVersion -}}
30-
{{- if and (regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag) (semverCompare "< 2.7.1" $tag) }} # before esbuild revert
30+
{{- if and (regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag) (semverCompare "< 2.7.0" $tag) }} # before esbuild revert
3131
command: ["node", "/app/packages/api/tasks/index", "check-alerts"]
3232
{{- else }}
33-
command: ["node", "/app/api/build/tasks/index.js", "check-alerts"] # after esbuild revert
33+
command: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"] # after esbuild revert
3434
{{- end }}
3535
envFrom:
3636
- configMapRef:

charts/hdx-oss-v2/tests/task-checkAlerts_test.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ tests:
3838
value: hyperdx/hyperdx:2-beta
3939
- equal:
4040
path: spec.jobTemplate.spec.template.spec.containers[0].command
41-
value: ["node", "/app/api/build/tasks/index.js", "check-alerts"]
41+
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]
4242
- isSubset:
4343
path: spec.jobTemplate.spec.template.spec.containers[0].resources
4444
content:
@@ -95,31 +95,31 @@ tests:
9595
path: spec.jobTemplate.spec.template.spec.imagePullSecrets[0].name
9696
value: regcred
9797

98-
- it: should use esbuild command path for versions before 2.7.1
98+
- it: should use esbuild command path for version 2.6.0
9999
set:
100100
tasks:
101101
enabled: true
102102
hyperdx:
103103
image:
104-
tag: "2.7.0"
104+
tag: "2.6.0"
105105
asserts:
106106
- equal:
107107
path: spec.jobTemplate.spec.template.spec.containers[0].command
108108
value: ["node", "/app/packages/api/tasks/index", "check-alerts"]
109109

110-
- it: should use esbuild command path for version 2.6.0
110+
- it: should use post-esbuild command path for version 2.7.0
111111
set:
112112
tasks:
113113
enabled: true
114114
hyperdx:
115115
image:
116-
tag: "2.6.0"
116+
tag: "2.7.0"
117117
asserts:
118118
- equal:
119119
path: spec.jobTemplate.spec.template.spec.containers[0].command
120-
value: ["node", "/app/packages/api/tasks/index", "check-alerts"]
120+
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]
121121

122-
- it: should use post-esbuild command path for version 2.7.1
122+
- it: should use post-esbuild command path for versions after 2.7.0 (patch)
123123
set:
124124
tasks:
125125
enabled: true
@@ -129,9 +129,9 @@ tests:
129129
asserts:
130130
- equal:
131131
path: spec.jobTemplate.spec.template.spec.containers[0].command
132-
value: ["node", "/app/api/build/tasks/index.js", "check-alerts"]
132+
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]
133133

134-
- it: should use post-esbuild command path for versions after 2.7.1
134+
- it: should use post-esbuild command path for versions after 2.7.0 (minor)
135135
set:
136136
tasks:
137137
enabled: true
@@ -141,9 +141,9 @@ tests:
141141
asserts:
142142
- equal:
143143
path: spec.jobTemplate.spec.template.spec.containers[0].command
144-
value: ["node", "/app/api/build/tasks/index.js", "check-alerts"]
144+
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]
145145

146-
- it: should use post-esbuild command path for version 3.0.0
146+
- it: should use post-esbuild command path for version 3.0.0 (major)
147147
set:
148148
tasks:
149149
enabled: true
@@ -153,4 +153,4 @@ tests:
153153
asserts:
154154
- equal:
155155
path: spec.jobTemplate.spec.template.spec.containers[0].command
156-
value: ["node", "/app/api/build/tasks/index.js", "check-alerts"]
156+
value: ["node", "/app/packages/api/build/tasks/index.js", "check-alerts"]

0 commit comments

Comments
 (0)