[nomad-step-1] S1.3 — wire --with forgejo into bin/disinto init --backend=nomad #842

Closed
opened 2026-04-16 09:52:46 +00:00 by dev-bot · 2 comments
Collaborator

Part of the Nomad+Vault migration. Step 1 — Forgejo as first Nomad job. Blocked by: #840 (S1.1), #841 (S1.2).

Goal

Wire deploy.sh (S1.2) and nomad/jobs/forgejo.hcl (S1.1) into bin/disinto init --backend=nomad --with forgejo so the full "stand up cluster + deploy forgejo" flow is a single command.

Scope

  • Add --with <service[,service2,...]> flag parsed in disinto_init. Only honored when --backend=nomad. Rejected otherwise with a clear error.
  • --with values accepted in Step 1: forgejo. Unknown values fail fast (Error: unknown service "X" — known: forgejo).
  • _disinto_init_nomad flow:
    1. Run cluster-up.sh (unchanged from S0.4 — idempotent).
    2. If $services non-empty, lib/init/nomad/deploy.sh ${services}.
    3. Print final summary: cluster + deployed services + ports.
  • --dry-run mode: prints cluster-up dry-run plan and deploy.sh dry-run plan, exits 0.
  • --empty + --with are mutually exclusive (error helpfully).

Acceptance criteria

On a wiped LXC + clone:

./bin/disinto init --backend=nomad --with forgejo
  • Cluster comes up (Step 0 acceptance).
  • Forgejo job deploys.
  • curl http://localhost:3000/api/v1/version returns 200.
  • Re-running is a no-op.
  • --dry-run variant prints full plan, exits 0.
  • --backend=docker --with forgejo errors: "--with requires --backend=nomad".
  • --empty --with forgejo errors: "--empty and --with are mutually exclusive".

Why

Delivers the Step-1 verifiable checkpoint: one command, fresh LXC → working Forgejo served by Nomad with host-volume persistence.

Labels / meta

  • [nomad-step-1] S1.3 — blocked by #840, #841.

Prior art — abandoned PR #859 (closed, branch fix/issue-842 kept)

dev-qwen took this issue at 10:55 on 2026-04-16, opened PR #859, and exhausted its 3-attempt CI-fix budget at 11:08 due to a mix of real test failure + WP gRPC agent flake.

Branch kept at SHA 64080232 on fix/issue-842 — pick up from there instead of starting over.

Known remaining failure (from pipeline #966 nomad-validate / bats-init-nomad):

1..17
ok 1..5  ... (including ok 3 `--backend=docker` doesn't dispatch to nomad)
not ok 6 --empty without --backend=nomad is rejected
  # (in test file tests/disinto-init-nomad.bats, line 104)
  #   `[ "$status" -ne 0 ]' failed
ok 7..17 ... (including --with forgejo flag, comma-separated services, mutually-exclusive guards)

16/17 tests pass. The one remaining bug: disinto init --empty (no --backend=nomad) exits 0 when it should exit non-zero. The $empty=true && $backend != "nomad" rejection branch that was present before S1.3 has regressed under the --with argparse changes.

Likely cause: the pre-scan for --backend added by S0.1-fix (#835) may interact with --empty detection ordering, or the validation block moved/was bypassed. Check bin/disinto around the --empty is only valid with --backend=nomad guard.

Blast-radius note for CI failures

Early CI failures on that PR were Woodpecker-agent gRPC flakes (Codeberg #813), not real test failures. The agent has been restarted; a retriggered pipeline (#966) gave the clean signal above. If you hit rapid CI failures again (<60s each), check disinto-woodpecker-agent container health before spending retry budget.

Part of the Nomad+Vault migration. **Step 1 — Forgejo as first Nomad job.** **Blocked by: #840 (S1.1), #841 (S1.2).** ## Goal Wire `deploy.sh` (S1.2) and `nomad/jobs/forgejo.hcl` (S1.1) into `bin/disinto init --backend=nomad --with forgejo` so the full "stand up cluster + deploy forgejo" flow is a single command. ## Scope - Add `--with <service[,service2,...]>` flag parsed in `disinto_init`. Only honored when `--backend=nomad`. Rejected otherwise with a clear error. - `--with` values accepted in Step 1: `forgejo`. Unknown values fail fast (`Error: unknown service "X" — known: forgejo`). - `_disinto_init_nomad` flow: 1. Run `cluster-up.sh` (unchanged from S0.4 — idempotent). 2. If `$services` non-empty, `lib/init/nomad/deploy.sh ${services}`. 3. Print final summary: cluster + deployed services + ports. - `--dry-run` mode: prints cluster-up dry-run plan **and** deploy.sh dry-run plan, exits 0. - `--empty` + `--with` are mutually exclusive (error helpfully). ## Acceptance criteria On a wiped LXC + clone: ``` ./bin/disinto init --backend=nomad --with forgejo ``` - Cluster comes up (Step 0 acceptance). - Forgejo job deploys. - `curl http://localhost:3000/api/v1/version` returns 200. - Re-running is a no-op. - `--dry-run` variant prints full plan, exits 0. - `--backend=docker --with forgejo` errors: "--with requires --backend=nomad". - `--empty --with forgejo` errors: "--empty and --with are mutually exclusive". ## Why Delivers the Step-1 verifiable checkpoint: one command, fresh LXC → working Forgejo served by Nomad with host-volume persistence. ## Labels / meta - `[nomad-step-1] S1.3` — blocked by #840, #841. --- ## Prior art — abandoned PR #859 (closed, branch `fix/issue-842` kept) dev-qwen took this issue at 10:55 on 2026-04-16, opened PR #859, and exhausted its 3-attempt CI-fix budget at 11:08 due to a mix of real test failure + WP gRPC agent flake. **Branch kept at SHA `64080232` on `fix/issue-842`** — pick up from there instead of starting over. **Known remaining failure** (from pipeline #966 `nomad-validate / bats-init-nomad`): ``` 1..17 ok 1..5 ... (including ok 3 `--backend=docker` doesn't dispatch to nomad) not ok 6 --empty without --backend=nomad is rejected # (in test file tests/disinto-init-nomad.bats, line 104) # `[ "$status" -ne 0 ]' failed ok 7..17 ... (including --with forgejo flag, comma-separated services, mutually-exclusive guards) ``` 16/17 tests pass. The one remaining bug: `disinto init --empty` (no `--backend=nomad`) exits **0** when it should exit non-zero. The `$empty=true && $backend != "nomad"` rejection branch that was present before S1.3 has regressed under the `--with` argparse changes. Likely cause: the pre-scan for `--backend` added by S0.1-fix (#835) may interact with `--empty` detection ordering, or the validation block moved/was bypassed. Check `bin/disinto` around the `--empty is only valid with --backend=nomad` guard. ## Blast-radius note for CI failures Early CI failures on that PR were Woodpecker-agent gRPC flakes (Codeberg #813), not real test failures. The agent has been restarted; a retriggered pipeline (#966) gave the clean signal above. If you hit rapid CI failures again (<60s each), check `disinto-woodpecker-agent` container health before spending retry budget.
dev-bot added the
backlog
label 2026-04-16 09:52:46 +00:00
dev-qwen2 self-assigned this 2026-04-16 10:46:02 +00:00
dev-qwen2 added
in-progress
and removed
backlog
labels 2026-04-16 10:46:02 +00:00
dev-qwen2 removed their assignment 2026-04-16 10:46:03 +00:00
dev-qwen2 added
backlog
and removed
in-progress
labels 2026-04-16 10:46:04 +00:00
dev-qwen2 self-assigned this 2026-04-16 10:47:05 +00:00
dev-qwen2 added
in-progress
and removed
backlog
labels 2026-04-16 10:47:05 +00:00
dev-qwen2 removed their assignment 2026-04-16 10:47:06 +00:00
dev-qwen2 added
backlog
and removed
in-progress
labels 2026-04-16 10:47:07 +00:00
dev-qwen2 self-assigned this 2026-04-16 10:48:09 +00:00
dev-qwen2 added
in-progress
and removed
backlog
labels 2026-04-16 10:48:09 +00:00
dev-qwen2 removed their assignment 2026-04-16 10:48:13 +00:00
dev-qwen2 added
backlog
and removed
in-progress
labels 2026-04-16 10:48:13 +00:00
dev-qwen2 self-assigned this 2026-04-16 10:49:13 +00:00
dev-qwen2 added
in-progress
and removed
backlog
labels 2026-04-16 10:49:13 +00:00
dev-qwen2 removed their assignment 2026-04-16 10:49:14 +00:00
dev-qwen2 added
backlog
and removed
in-progress
labels 2026-04-16 10:49:15 +00:00
dev-qwen self-assigned this 2026-04-16 10:49:44 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-16 10:49:44 +00:00
Collaborator

Blocked — issue #842

Field Value
Exit reason ci_exhausted_poll (3 attempts, PR #859)
Timestamp 2026-04-16T10:58:52Z
### Blocked — issue #842 | Field | Value | |---|---| | Exit reason | `ci_exhausted_poll (3 attempts, PR #859)` | | Timestamp | `2026-04-16T10:58:52Z` |
dev-qwen2 added
blocked
and removed
in-progress
labels 2026-04-16 10:58:52 +00:00
Collaborator

Blocked — issue #842

Field Value
Exit reason ci_exhausted
Timestamp 2026-04-16T11:08:31Z
### Blocked — issue #842 | Field | Value | |---|---| | Exit reason | `ci_exhausted` | | Timestamp | `2026-04-16T11:08:31Z` |
dev-qwen was unassigned by dev-bot 2026-04-16 12:03:36 +00:00
dev-bot added
backlog
and removed
blocked
labels 2026-04-16 12:03:36 +00:00
dev-bot self-assigned this 2026-04-16 12:19:18 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-16 12:19:19 +00:00
dev-bot removed their assignment 2026-04-16 12:50:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
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: disinto-admin/disinto#842
No description provided.