fix(myorg-assistant): mirror Deployment env (GIT_*, WEB_SECRET_KEY) into all cronjobs #23

Open
platform-engineer-agent wants to merge 1 commits from platform-engineer-agent/k3s-cluster:fix/myorg-cronjob-env-parity into main
Collaborator

Problem

myorg-git-sync was crash-looping: 4.19 restarts per 15m (pod myorg-git-sync-29731995-wbdnx). Loki stderr showed a pydantic Settings validation error for the missing WEB_SECRET_KEY field, raised at src/config.py line 44 (Settings()) at import time, which kills the container before it does any work.

The myorg-assistant Deployment's pydantic Settings model requires WEB_SECRET_KEY (and the GIT_* set for git-sync / deadline-checker). The cronjobs carried only a subset of env, so every scheduled run crashed at import.

Fix

Mirror the Deployment's full required env into all 5 cronjobs, per file (no duplicates):

  • git-sync: add WEB_SECRET_KEY (it already had GIT_*)
  • deadline-checker, evening-summary, morning-briefing, waiting-followup: add GIT_REPO_URL / GIT_USERNAME / GIT_TOKEN / GIT_BRANCH plus WEB_SECRET_KEY

Supersedes PRs 19, 20, 21

Those PRs added ONLY WEB_SECRET_KEY and left the GIT_* gap. deadline-checker (and the others) are still missing the whole GIT_* set, so merging them would NOT stop the recurring loop. This PR is complete.

Delivery

Fork-branch plus PR only (agent cannot push upstream and cannot merge). Roger: merge this and close 19/20/21, then ArgoCD self-heals and the restart loop stops.

## Problem myorg-git-sync was crash-looping: 4.19 restarts per 15m (pod myorg-git-sync-29731995-wbdnx). Loki stderr showed a pydantic Settings validation error for the missing WEB_SECRET_KEY field, raised at src/config.py line 44 (Settings()) at import time, which kills the container before it does any work. The myorg-assistant Deployment's pydantic Settings model requires WEB_SECRET_KEY (and the GIT_* set for git-sync / deadline-checker). The cronjobs carried only a subset of env, so every scheduled run crashed at import. ## Fix Mirror the Deployment's full required env into all 5 cronjobs, per file (no duplicates): - git-sync: add WEB_SECRET_KEY (it already had GIT_*) - deadline-checker, evening-summary, morning-briefing, waiting-followup: add GIT_REPO_URL / GIT_USERNAME / GIT_TOKEN / GIT_BRANCH plus WEB_SECRET_KEY ## Supersedes PRs 19, 20, 21 Those PRs added ONLY WEB_SECRET_KEY and left the GIT_* gap. deadline-checker (and the others) are still missing the whole GIT_* set, so merging them would NOT stop the recurring loop. This PR is complete. ## Delivery Fork-branch plus PR only (agent cannot push upstream and cannot merge). Roger: merge this and close 19/20/21, then ArgoCD self-heals and the restart loop stops.
platform-engineer-agent added 1 commit 2026-07-13 07:23:47 +02:00
The myorg-assistant Deployment's Settings() requires WEB_SECRET_KEY (and the
GIT_* set for git-sync/deadline-checker). The cronjobs only carried a subset,
so every run crashed at import with:
  pydantic_core._pydantic_core.ValidationError: 1 validation error for Settings
    web_secret_key [type=missing]

myorg-git-sync was crash-looping (4.19 restarts/15m, pod 29731995-wbdnx).
deadline-checker/evening-summary/morning-briefing/waiting-followup were also
missing the full env set (git-sync already had GIT_*, but lacked WEB_SECRET_KEY;
the others lacked both GIT_* and WEB_SECRET_KEY).

Mirror the Deployment's full required env (GIT_REPO_URL/USERNAME/TOKEN/BRANCH
from secret/configmap, WEB_SECRET_KEY from secret) into every cronjob so
import-time Settings() validation passes for all. Supersedes the incomplete
PRs #19/#20/#21 (which added only WEB_SECRET_KEY and left the GIT_* gap).

Roger: merge -> ArgoCD self-heals, loop stops.
This pull request has changes conflicting with the target branch.
  • myorg-assistant/cronjobs/deadline-checker.yaml
  • myorg-assistant/cronjobs/evening-summary.yaml
  • myorg-assistant/cronjobs/morning-briefing.yaml
  • myorg-assistant/cronjobs/waiting-followup.yaml
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u fix/myorg-cronjob-env-parity:platform-engineer-agent-fix/myorg-cronjob-env-parity
git checkout platform-engineer-agent-fix/myorg-cronjob-env-parity
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: roger/k3s-cluster#23
No description provided.