From 081e46d3c269915f9ba1507d70d930091cbbf88d Mon Sep 17 00:00:00 2001 From: JARVIS-coding-Agent Date: Fri, 17 Apr 2026 01:04:21 +0000 Subject: [PATCH 1/3] fix(helm): restore backward-compat discord rendering for per-agent configs When upgrading from 0.7.6 to 0.7.7, per-agent discord configs that lack the new discord.enabled field fail to render the [discord] TOML section, causing pods to crash with 'no adapter configured'. Replace the strict boolean check with a backward-compatible condition that also considers the presence of botToken, matching the intent of #394. Closes #416 --- charts/openab/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/openab/templates/configmap.yaml b/charts/openab/templates/configmap.yaml index 84dcb1d4..aa6a169b 100644 --- a/charts/openab/templates/configmap.yaml +++ b/charts/openab/templates/configmap.yaml @@ -10,7 +10,7 @@ metadata: {{- include "openab.labels" $d | nindent 4 }} data: config.toml: | - {{- if ($cfg.discord).enabled }} + {{- if and (ne (($cfg.discord).enabled | toString) "false") (or ($cfg.discord).enabled ($cfg.discord).botToken) }} [discord] bot_token = "${DISCORD_BOT_TOKEN}" {{- range $cfg.discord.allowedChannels }} From 69c2aa55153e3910248e609d3eb51ef1b2be257a Mon Sep 17 00:00:00 2001 From: JARVIS-coding-Agent Date: Fri, 17 Apr 2026 01:19:01 +0000 Subject: [PATCH 2/3] fix(helm): align configmap discord condition with secret/deployment/NOTES Replace the looser `or (enabled, botToken)` check with the same `botToken`-gated condition used by the other three templates, preventing configmap from rendering [discord] when no token is available. Also switches pipe syntax to function-call syntax for consistency. Co-Authored-By: Claude Sonnet 4.6 --- charts/openab/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/openab/templates/configmap.yaml b/charts/openab/templates/configmap.yaml index aa6a169b..7a40c8a4 100644 --- a/charts/openab/templates/configmap.yaml +++ b/charts/openab/templates/configmap.yaml @@ -10,7 +10,7 @@ metadata: {{- include "openab.labels" $d | nindent 4 }} data: config.toml: | - {{- if and (ne (($cfg.discord).enabled | toString) "false") (or ($cfg.discord).enabled ($cfg.discord).botToken) }} + {{- if and (ne (toString ($cfg.discord).enabled) "false") ($cfg.discord).botToken }} [discord] bot_token = "${DISCORD_BOT_TOKEN}" {{- range $cfg.discord.allowedChannels }} From 55526b0059cbf7845d0582c711bf594bb5752b98 Mon Sep 17 00:00:00 2001 From: JARVIS-coding-Agent Date: Fri, 17 Apr 2026 01:26:07 +0000 Subject: [PATCH 3/3] test(helm): align unit tests with botToken-gated discord condition Update test fixtures to supply discord.botToken where [discord] section is expected to render, matching the condition aligned with secret.yaml and deployment.yaml. Replace the "enabled=true without botToken renders" case with its inverse to document the new gate semantics. Co-Authored-By: Claude Sonnet 4.6 --- charts/openab/tests/adapter-enablement_test.yaml | 15 +++++++++++++-- charts/openab/tests/configmap_test.yaml | 8 ++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/charts/openab/tests/adapter-enablement_test.yaml b/charts/openab/tests/adapter-enablement_test.yaml index 2e924cc2..f7854ba7 100644 --- a/charts/openab/tests/adapter-enablement_test.yaml +++ b/charts/openab/tests/adapter-enablement_test.yaml @@ -2,10 +2,10 @@ suite: adapter enablement gating templates: - templates/configmap.yaml tests: - - it: renders [discord] with placeholder token when enabled=true without botToken + - it: renders [discord] when enabled=true and botToken is present set: agents.kiro.discord.enabled: true - agents.kiro.discord.botToken: "" + agents.kiro.discord.botToken: "xoxb-test-token" asserts: - matchRegex: path: data["config.toml"] @@ -14,9 +14,19 @@ tests: path: data["config.toml"] pattern: 'bot_token = "\$\{DISCORD_BOT_TOKEN\}"' + - it: omits [discord] when enabled=true but botToken is absent + set: + agents.kiro.discord.enabled: true + agents.kiro.discord.botToken: "" + asserts: + - notMatchRegex: + path: data["config.toml"] + pattern: "\\[discord\\]" + - it: omits [discord] when enabled=false set: agents.kiro.discord.enabled: false + agents.kiro.discord.botToken: "xoxb-test-token" asserts: - notMatchRegex: path: data["config.toml"] @@ -60,6 +70,7 @@ tests: - it: renders both [discord] and [slack] when both enabled set: agents.kiro.discord.enabled: true + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.slack.enabled: true asserts: - matchRegex: diff --git a/charts/openab/tests/configmap_test.yaml b/charts/openab/tests/configmap_test.yaml index 3735caa6..cead0766 100644 --- a/charts/openab/tests/configmap_test.yaml +++ b/charts/openab/tests/configmap_test.yaml @@ -4,6 +4,7 @@ templates: tests: - it: renders allow_bot_messages = "mentions" set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.allowBotMessages: mentions asserts: - matchRegex: @@ -12,6 +13,7 @@ tests: - it: renders allow_bot_messages = "all" set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.allowBotMessages: all asserts: - matchRegex: @@ -20,6 +22,7 @@ tests: - it: renders allow_bot_messages = "off" set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.allowBotMessages: "off" asserts: - matchRegex: @@ -28,6 +31,7 @@ tests: - it: rejects invalid allowBotMessages value set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.allowBotMessages: yolo asserts: - failedTemplate: @@ -35,6 +39,7 @@ tests: - it: renders trustedBotIds as JSON array set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.allowBotMessages: mentions agents.kiro.discord.trustedBotIds: - "123456789012345678" @@ -46,6 +51,7 @@ tests: - it: rejects mangled snowflake ID set: + agents.kiro.discord.botToken: "xoxb-test-token" agents.kiro.discord.trustedBotIds: - "1.234567890123457e+17" asserts: @@ -53,6 +59,8 @@ tests: errorPattern: mangled ID - it: renders default allow_bot_messages = "off" + set: + agents.kiro.discord.botToken: "xoxb-test-token" asserts: - matchRegex: path: data["config.toml"]