feat(ops-agent): version-control repo_contains_sha (M17 DEPLOY sha-guard) #92

Merged
janpeter merged 1 commit from feat/repo-contains-sha-command into main 2026-07-04 16:48:38 +02:00
Owner

Waarom

De M17 Fase-4-rollout voegde een ops-agent-command repo_contains_sha (read-only git ancestor-check die DEPLOY-jobs gebruiken om al-gedeployede merges over te slaan) toe aan de live /etc/ops-agent/commands.yml + het script op /srv/scrum4me/scripts/repo-contains-sha.sh. Geen van beide stond in version control → een re-provision via setup.sh zou ze missen.

Wat

  • deploy/ops-agent/scripts/repo-contains-sha.sh — het exacte live-script. repo=arg, doel-sha via stdin omdat de ops-agent args-whitelist exact-match (allowed) is en géén patroonvorm kent; een vrije sha kan dus niet als gevalideerd arg → hij komt via stdin_from_body en het script valideert hem met een strikte regex. Ops-dashboard-pad = /srv/scrum4me/ops-dashboard (niet repos/Ops-dashboard).
  • repo_contains_sha-entry in beide commands.yml (deploy + baseline, zodat drift-detectie met live overeenkomt).
  • setup.sh-stap die het script naar /srv/scrum4me/scripts/ installeert (het absolute pad waar de commands.yml-entry naar verwijst).

Live + de drift-runtime-baseline zijn al gesynct (drift-check groen); deze PR brengt de version-controlled baseline gelijk.

🤖 Generated with Claude Code

## Waarom De M17 Fase-4-rollout voegde een ops-agent-command `repo_contains_sha` (read-only git ancestor-check die DEPLOY-jobs gebruiken om al-gedeployede merges over te slaan) toe aan de **live** `/etc/ops-agent/commands.yml` + het script op `/srv/scrum4me/scripts/repo-contains-sha.sh`. Geen van beide stond in version control → een re-provision via `setup.sh` zou ze missen. ## Wat - `deploy/ops-agent/scripts/repo-contains-sha.sh` — het exacte live-script. **repo=arg, doel-sha via `stdin`** omdat de ops-agent args-whitelist exact-match (`allowed`) is en géén patroonvorm kent; een vrije sha kan dus niet als gevalideerd arg → hij komt via `stdin_from_body` en het script valideert hem met een strikte regex. Ops-dashboard-pad = `/srv/scrum4me/ops-dashboard` (niet `repos/Ops-dashboard`). - `repo_contains_sha`-entry in **beide** commands.yml (`deploy` + `baseline`, zodat drift-detectie met live overeenkomt). - `setup.sh`-stap die het script naar `/srv/scrum4me/scripts/` installeert (het absolute pad waar de commands.yml-entry naar verwijst). Live + de drift-runtime-baseline zijn al gesynct (drift-check groen); deze PR brengt de version-controlled baseline gelijk. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The M17 Fase-4 rollout added an ops-agent command `repo_contains_sha` (a
read-only git ancestor-check used by DEPLOY jobs to skip already-deployed
merges) to the live /etc/ops-agent/commands.yml, plus the backing script at
/srv/scrum4me/scripts/repo-contains-sha.sh. Neither was version-controlled, so a
re-provision via setup.sh would lose them.

This vendors both:
- deploy/ops-agent/scripts/repo-contains-sha.sh (the exact live script; repo=arg,
  target-sha via stdin because the ops-agent arg-whitelist is exact-match only,
  so a free-form sha cannot be a validated arg — it comes through
  stdin_from_body and the script validates it with a strict regex).
- the repo_contains_sha entry in both commands.yml (deploy + baseline, so drift
  detection agrees with live).
- a setup.sh step that installs the script to /srv/scrum4me/scripts/ (the
  absolute path the commands.yml entry references).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/Ops-dashboard!92
No description provided.