fix(chart): align cronjob config with openab binary + add usercron support#638
Merged
thepagent merged 3 commits intoopenabdev:mainfrom Apr 30, 2026
Merged
Conversation
…pport - Change [[cronjobs]] to [[cron.jobs]] in configmap template to match Config.cron.jobs in src/config.rs - Add [cron] section with usercron_enabled and usercron_path fields - Add enabled field to each cron job entry - Add cron defaults (usercronEnabled, usercronPath) to values.yaml - Wrap cron block in conditional to avoid empty output when unused
added 2 commits
April 30, 2026 05:40
The previous conditional `or ($cfg.cronjobs) ($cfg.cron)` was always truthy because values.yaml provides a default `cron:` map. Check the actual feature flags instead: usercronEnabled, usercronPath, or cronjobs.
thepagent
approved these changes
Apr 30, 2026
Collaborator
四法師 Review 結論感謝 @ChunHao-dev 的 PR!方向完全正確,我們交叉比對了 ✅ 已確認
🔴 需修:Go template
|
| 法師 | Verdict |
|---|---|
| 超渡法師 | 🟢 修完可 merge |
| 普渡法師 | 🟡 需修 hasKey |
| 覺渡法師 | 🟡 需修 hasKey(發現者) |
| 擺渡法師 | 🟡 註解措辭 + runtime validation gap |
Blocking: hasKey fix(1 行)
Non-blocking: conditional 精確化 + 註解措辭 + runtime validate_cronjobs() 跳過 disabled jobs(建議另開 issue)
This was referenced Apr 30, 2026
thepagent
pushed a commit
that referenced
this pull request
Apr 30, 2026
validate_cronjobs() now skips jobs with enabled=false, aligning startup validation with runtime scheduling semantics. Previously a disabled job with an invalid cron expression or timezone would cause openab to fail at startup even though the job would never be scheduled. Discovered during four-monk review of PR #638. Co-authored-by: 超渡法師 <chaodu@openab.dev> Co-authored-by: 擺渡法師 <codex@openab.dev>
chaodu-agent
pushed a commit
that referenced
this pull request
May 1, 2026
…e default trap
Go template's `default` treats `false` as a zero value, so
`{{ false | default true }}` returns `true`. This made it impossible
to disable cronjobs or reactions via `enabled: false`.
Fix both occurrences:
- reactions.enabled (L104)
- cron.jobs[].enabled (L142)
Also clarify the enabled field comment in values.yaml to reflect that
disabled jobs are still validated at startup.
Discovered during four-monk review of PR #638.
Co-authored-by: 覺渡法師 <gemini@openab.dev>
thepagent
pushed a commit
that referenced
this pull request
May 1, 2026
…lt trap (#639) * fix(chart): use hasKey for boolean enabled fields to avoid Go template default trap Go template's `default` treats `false` as a zero value, so `{{ false | default true }}` returns `true`. This made it impossible to disable cronjobs or reactions via `enabled: false`. Fix both occurrences: - reactions.enabled (L104) - cron.jobs[].enabled (L142) Also clarify the enabled field comment in values.yaml to reflect that disabled jobs are still validated at startup. Discovered during four-monk review of PR #638. Co-authored-by: 覺渡法師 <gemini@openab.dev> * fix(chart): apply hasKey to removeAfterReply and usercronEnabled Extend the hasKey pattern to the remaining '| default false' boolean fields for consistency. While the current default-false behavior is correct today, using hasKey prevents a latent trap if defaults are ever changed to true. --------- Co-authored-by: 超渡法師 <chaodu@openab.dev> Co-authored-by: 覺渡法師 <gemini@openab.dev> Co-authored-by: chaodu-agent <chaodu-agent@openab.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this solve?
PR #629 consolidated all cron config under
[cron]and renamed[[cronjobs]]→[[cron.jobs]], but the Helm chart template was not updated to match:[[cronjobs]](top-level key)[[cron.jobs]](under[cron]perConfig.cron: CronConfiginsrc/config.rs)Result: all Helm-deployed cronjob configs are silently ignored.
Additionally,
usercron_enabledandusercron_pathare supported inconfig.rsbut had no corresponding chart fields.Changes
charts/openab/templates/configmap.yaml[[cronjobs]]→[[cron.jobs]]; add[cron]section withusercron_enabled,usercron_path; addenabledfield per job; wrap in conditionalcharts/openab/values.yamlcron.usercronEnabled(default:false) andcron.usercronPath(default:"")Testing
helm template verification
OrbStack K8s live test
[[cron.jobs]]) — fires every minute, Discord receives messageDiscord Discussion: https://discord.com/channels/1491295327620169908/1499264765141454940