VersionControl:PRs/maybelle-config/295: Difference between revisions

From PickiPedia: A knowledge base of bluegrass, old time psychedelic jams, and other public domain music
Jump to navigationJump to search
DrivingThatTrain (talk | contribs)
cryptograss/maybelle-config#295, as GitHub has it
DrivingThatTrain (talk | contribs)
cryptograss/maybelle-config#295, as GitHub has it
 
Line 16: Line 16:
|deploy=redeploy maybelle
|deploy=redeploy maybelle
}}
}}
<pre class="pr-body">Why `branch-tests` isn't in Jenkins, though it's on disk (`/var/jenkins_home/jobs/branch-tests/config.xml`, made 01:44:13 on 9 Nov): Configuration as Code seeds jobs at boot while Jenkins is still loading the jobs already on disk. Jenkins logged "Loaded all jobs" 65 ms after making it, from a list read before it existed. The 10 old jobs were fine because they were already on disk. A job that's new in a deploy waits until the next restart.
**Reproduced** in a preview Jenkins on hunter:
1. Boot with three jobs.
2. Boot again with `branch-tests` added. Its `config.xml` is on disk, and `/job/branch-tests/` answers 404.
3. `jcasc-reload.sh` reloads Configuration as Code, and all four jobs are there.
**The fix:** after Jenkins accepts `docker exec`, the deploy runs `maybelle/scripts/jcasc-reload.sh` inside the container. As admin, with a crumb, it reloads Configuration as Code. Then it checks that every job the `jobs:` list names exists, and fails the deploy if one doesn't. It runs on every deploy, so a new job is there when the deploy finishes, not at the next restart.
Reloading also reapplies `nodes:`, so the `branches` agent may reconnect once; inbound agents retry on their own.
Checked: `sh -n`, the playbook parses, and every task takes what it says.
Deploy: redeploy maybelle
Worked on by: magent, justin, in #ramp</pre>

Latest revision as of 17:06, 9 November 2026

maybelle-config#295: Jenkins: reload Configuration as Code once it's up, and check every job it names exists
State 🟣 merged 2026-11-09 02:41:55
Worked on by magent, justin
Moods #ramp
Deploy redeploy maybelle
Branch magent/jcasc-reload → production, by magent-cryptograss
Opened · last pushed 2026-11-09 02:23:18 · 2026-11-09 02:23:11
Why `branch-tests` isn't in Jenkins, though it's on disk (`/var/jenkins_home/jobs/branch-tests/config.xml`, made 01:44:13 on 9 Nov): Configuration as Code seeds jobs at boot while Jenkins is still loading the jobs already on disk. Jenkins logged "Loaded all jobs" 65 ms after making it, from a list read before it existed. The 10 old jobs were fine because they were already on disk. A job that's new in a deploy waits until the next restart.

**Reproduced** in a preview Jenkins on hunter:
1. Boot with three jobs.
2. Boot again with `branch-tests` added. Its `config.xml` is on disk, and `/job/branch-tests/` answers 404.
3. `jcasc-reload.sh` reloads Configuration as Code, and all four jobs are there.

**The fix:** after Jenkins accepts `docker exec`, the deploy runs `maybelle/scripts/jcasc-reload.sh` inside the container. As admin, with a crumb, it reloads Configuration as Code. Then it checks that every job the `jobs:` list names exists, and fails the deploy if one doesn't. It runs on every deploy, so a new job is there when the deploy finishes, not at the next restart.

Reloading also reapplies `nodes:`, so the `branches` agent may reconnect once; inbound agents retry on their own.

Checked: `sh -n`, the playbook parses, and every task takes what it says.

Deploy: redeploy maybelle
Worked on by: magent, justin, in #ramp