The forge mails a failed workflow through SMTP2GO (FO-49) #87

Merged
pit merged 7 commits from hermes/fo49-failure-mail into main 2026-11-05 15:56:01 +00:00
Owner

Addresses FO-49.

Summary

env.map / .env.example   FORGEJO_SMTP_USERNAME, FORGEJO_SMTP_PASSWORD
  → group_vars            vault_forgejo_smtp_*
  → defaults/main.yml     mail.smtp2go.com:587, smtp+starttls, from noreply+forgejo@thepit.space
  → app.ini.j2            [mailer] block

No secret in the tree: the pair lives at secret/services/forgejo/smtp in the store and reaches a run as the environment make env fetches. It uses Forgejo's own SMTP2GO user, atthepit-forgejo; Vikunja's account is untouched. The role's app.ini task sets diff: false, so --check --diff no longer prints the rendered secrets — and the runbook now says the rehearsal reports that file without showing its diff. The role also refuses a run whose environment carries neither name, so a .env fetched before this credential existed stops the rehearsal instead of rendering an enabled mailer that cannot log in.

Evidence

  • PRE rehearsal: make pre rendered and applied the role on a disposable PRE Guest; /srv/forgejo/custom/conf/app.ini carried the [mailer] block with ENABLED = true, PROTOCOL = smtp+starttls, SMTP_ADDR = mail.smtp2go.com, SMTP_PORT = 587, FROM = noreply+forgejo@thepit.space, and the backtick-quoted password. The run then used the shared thepit account; the store now holds the dedicated atthepit-forgejo one. Forgejo and forgejo-mcp were both active.
  • Test mail: the site-administration route (POST /admin/config/test_mail) reported A test email has been sent to "me@thepit.space"; the forge's log records the internal send as 200. The PRE Guest was destroyed afterwards.
  • Credential guard: the role's assert fails a --check run with FORGEJO_SMTP_USERNAME/FORGEJO_SMTP_PASSWORD unset (rc=2, naming the store path and mise exec -- make env ACTOR=<actor>), and passes with the pair set — driven against the branch's own group_vars over a local connection.
  • Checks: make check, make syntax-check and make validate — locally rc=0 at 040f20c.

Not yet

  • PROD's app.ini: make service was run from main after the credential rotation, so PROD still has no [mailer] block. It takes this merge, then mise exec -- make env ACTOR=<actor> in the checkout so .env carries the new pair, then a second make service. That order matters: a .env from before the credential makes the role's guard fail the run rather than start a mailer that cannot log in.
  • PROD's site-admin test mail and a failing workflow with enable-email-notifications: true; both need the mailer live on PROD's forge.

Merge Danger

Door: two-way — reverting the commit and applying the service removes the [mailer] block; the store path is deleted with bao kv metadata delete secret/services/forgejo/smtp.

Blast Radius: outbound mail from the forge only; no repository, database or Edge shape changes.

Addresses FO-49. ## Summary ```text env.map / .env.example FORGEJO_SMTP_USERNAME, FORGEJO_SMTP_PASSWORD → group_vars vault_forgejo_smtp_* → defaults/main.yml mail.smtp2go.com:587, smtp+starttls, from noreply+forgejo@thepit.space → app.ini.j2 [mailer] block ``` No secret in the tree: the pair lives at `secret/services/forgejo/smtp` in the store and reaches a run as the environment `make env` fetches. It uses Forgejo's own SMTP2GO user, `atthepit-forgejo`; Vikunja's account is untouched. The role's `app.ini` task sets `diff: false`, so `--check --diff` no longer prints the rendered secrets — and the runbook now says the rehearsal reports that file without showing its diff. The role also refuses a run whose environment carries neither name, so a `.env` fetched before this credential existed stops the rehearsal instead of rendering an enabled mailer that cannot log in. ## Evidence - **PRE rehearsal:** `make pre` rendered and applied the role on a disposable PRE Guest; `/srv/forgejo/custom/conf/app.ini` carried the `[mailer]` block with `ENABLED = true`, `PROTOCOL = smtp+starttls`, `SMTP_ADDR = mail.smtp2go.com`, `SMTP_PORT = 587`, `FROM = noreply+forgejo@thepit.space`, and the backtick-quoted password. The run then used the shared `thepit` account; the store now holds the dedicated `atthepit-forgejo` one. Forgejo and forgejo-mcp were both active. - **Test mail:** the site-administration route (`POST /admin/config/test_mail`) reported `A test email has been sent to "me@thepit.space"`; the forge's log records the internal send as 200. The PRE Guest was destroyed afterwards. - **Credential guard:** the role's `assert` fails a `--check` run with `FORGEJO_SMTP_USERNAME`/`FORGEJO_SMTP_PASSWORD` unset (`rc=2`, naming the store path and `mise exec -- make env ACTOR=<actor>`), and passes with the pair set — driven against the branch's own `group_vars` over a local connection. - **Checks:** `make check`, `make syntax-check` and `make validate` — locally `rc=0` at `040f20c`. ## Not yet - PROD's `app.ini`: `make service` was run from `main` after the credential rotation, so PROD still has no `[mailer]` block. It takes this merge, then `mise exec -- make env ACTOR=<actor>` in the checkout so `.env` carries the new pair, then a second `make service`. That order matters: a `.env` from before the credential makes the role's guard fail the run rather than start a mailer that cannot log in. - PROD's site-admin test mail and a failing workflow with `enable-email-notifications: true`; both need the mailer live on PROD's forge. ## Merge Danger **Door:** two-way — reverting the commit and applying the service removes the `[mailer]` block; the store path is deleted with `bao kv metadata delete secret/services/forgejo/smtp`. **Blast Radius:** outbound mail from the forge only; no repository, database or Edge shape changes.
The forge mails a failed workflow through SMTP2GO (FO-49)
Some checks failed
plan / edge-plan-check (pull_request) Has been cancelled
pr-checks / env-check (pull_request) Has been cancelled
pr-checks / fmt-check (pull_request) Has been cancelled
pr-checks / validate (pull_request) Has been cancelled
pr-checks / syntax-check (pull_request) Has been cancelled
pr-checks / docs-check (pull_request) Has been cancelled
plan / guest-plan-check (pull_request) Has been cancelled
6f2b881139
docs: the forge's mailer shares Vikunja's SMTP2GO user (FO-49)
All checks were successful
plan / edge-plan-check (pull_request) Successful in 26s
plan / guest-plan-check (pull_request) Successful in 24s
pr-checks / env-check (pull_request) Successful in 22s
pr-checks / fmt-check (pull_request) Successful in 18s
pr-checks / validate (pull_request) Successful in 27s
pr-checks / syntax-check (pull_request) Successful in 27s
pr-checks / docs-check (pull_request) Successful in 20s
7606dae797
The config template's diff stays out of the check run (FO-49)
All checks were successful
plan / guest-plan-check (pull_request) Successful in 21s
pr-checks / env-check (pull_request) Successful in 16s
pr-checks / fmt-check (pull_request) Successful in 17s
pr-checks / validate (pull_request) Successful in 20s
pr-checks / docs-check (pull_request) Successful in 16s
plan / edge-plan-check (pull_request) Successful in 21s
pr-checks / syntax-check (pull_request) Successful in 17s
57e16e7190
docs: the forge has its own SMTP2GO user (FO-49)
Some checks failed
pr-checks / env-check (pull_request) Successful in 23s
pr-checks / fmt-check (pull_request) Successful in 21s
pr-checks / validate (pull_request) Successful in 46s
pr-checks / syntax-check (pull_request) Successful in 1m8s
plan / edge-plan-check (pull_request) Failing after 15s
pr-checks / docs-check (pull_request) Successful in 46s
plan / guest-plan-check (pull_request) Failing after 14s
705b89e7f3
pit changed title from WIP: The forge mails a failed workflow through SMTP2GO (FO-49) to The forge mails a failed workflow through SMTP2GO (FO-49) 2026-11-05 15:32:22 +00:00
Member

Review started (round 1/5) on 705b89e7f3 — reading the diff now.

**Review started** (round 1/5) on 705b89e7f3a4ad33eff50952ae98147b634fdce5 — reading the diff now.
bot-minos requested changes 2026-11-05 15:37:53 +00:00
Dismissed
bot-minos left a comment

repo=olympus/infra-forge pr=87 head=705b89e7f3a4ad33eff50952ae98147b634fdce5 round=1/5 verdict=REQUEST_CHANGES

Reviewed head 705b89e7f3 (round 1/5; no earlier review on this thread; the full head is reviewed against base c2ff9ca).

Recommendation: fix

The recommendation turns on the one BLOCKER below, which is a one-line edit to the PR body. The code itself does what FO-49's first criterion asks.

Spec source: the PR body names no task, so the task came from the title: FO-49 "Send Forgejo's job-failure mail" (Vikunja project 4, task 267, read live). Its three acceptance criteria are the contract. Standards source: AGENTS.md (§Secrets, §Pull requests, §Code comments), docs/runbooks/0001-deploy-and-rollback.md, docs/adr/ (no record bears on this change).

Standards

BLOCKER — the PR body does not name the task. AGENTS.md §Pull requests: "Name the task a PR addresses in its body as FO-<index>". The body (Summary, Evidence, Not yet, Merge Danger) never says FO-49; only the title and the four commit subjects do. This review had to infer the spec from the title. PR #86 shows the practice (Addresses FO-53 … as the body's first line). Clears with: one line in the body, e.g. Addresses FO-49.

ADVISORY — an unset credential renders silently as an enabled mailer with empty credentials. forgejo/service/group_vars/forgejo/vars.yml:20-21 reads both names with lookup('env', …), which answers '' for an unset name. Makefile require_secret (lines 150-155) only tests that .env exists. Driven for real: the shipped app.ini.j2 rendered through ansible-playbook with both names empty exits 0 and writes ENABLED = true, USER = , ``PASSWD = ```` (probe real_empty). The case is a .env fetched before this merge, then make service; the PR body's PROD step ("this merge and a second make service") does not say to re-run make env first. Forgejo then runs with a mailer that cannot authenticate and nothing fails until a mail is sent. The role already has an assert pattern (roles/forgejo/tasks/main.yml:353); an assert that both values are non-empty while forgejo_mailer_enabled would close it. The other vault_* names share the lookup pattern, so the gap is not new in kind. This one fails silently, where a missing DB password fails loudly.

ADVISORY — diff: false withholds the whole app.ini diff and the runbook does not say so. forgejo/service/roles/forgejo/tasks/main.yml:126. The claim holds, proved as a red/green pair on the real template: with diff: true the --check --diff output carried 5 lines of sentinel secrets, with diff: false it carried 0 and the task still reported changed=1. The cost is that the Operator reading make service-check no longer sees any app.ini change, secret or not. docs/runbooks/0001-deploy-and-rollback.md:236-239 still reads "It still rehearses the templated config" with no mention that the config's diff is not printed. One sentence there would settle it. Note the change is beyond FO-49's criteria; the Summary discloses it, so it is not charged as scope creep.

ADVISORY — comments beyond the minimum. AGENTS.md §Code comments: "Keep comments to a minimum … propose a docs page under docs/ instead". Added: roles/forgejo/defaults/main.yml:38-40, roles/forgejo/tasks/main.yml:124-125, roles/forgejo/templates/app.ini.j2:48 (the backtick note repeats docs/actions/runner-and-workflows.md:194-196 word for word), group_vars/forgejo/vars.yml:19, env.map:26. The repo's older files carry plenty of the same, so I charge it once, as advice.

Spec (FO-49)

Criterion Result
The rendered app.ini carries a [mailer] block, with no secret in the repository Met. Rendered the head template with ansible: [mailer] with smtp+starttls, mail.smtp2go.com, 587, noreply+forgejo@thepit.space, and USER/PASSWD from the environment; a password holding a space, # and ; renders as one backtick-quoted value. No secret is in the diff (env.map:33 maps names, .env.example:15-16 is blank). make env-check: 19 names, all declared.
A test mail from site administration arrives at me@thepit.space from noreply+forgejo@thepit.space Not shown for the credential that ships. The body reports "A test email has been sent" and an internal 200, on the shared thepit account; the dedicated atthepit-forgejo pair was written afterwards and has not been through a send. Arrival and the From address are not stated. I cannot see the inbox. Disclosed by the author; see "Named, not charged".
A workflow with enable-email-notifications: true that fails mails its pusher Not yet; disclosed under "Not yet". The body promises nothing here.

No requirement is missing from the code that the criteria ask for in this PR; nothing outside the criteria was added except diff: false (disclosed).

What I verified, and how

Claim How Result
Head is the dispatched SHA git ls-remote origin refs/pull/87/head at the start and before posting 705b89e7… both times
make check green mise exec -- make check in a head worktree rc=0: env pin ok, 19 names declared, docs-check 5 assertions
CI contexts get_commit_statuses on the head env-check, fmt-check, validate, syntax-check, docs-check: success. The two plan contexts show a rerun (runs 70/71) pending at review time; their earlier run 68 on the same SHA is success. The body's "seven … green" holds for run 68, not yet for the rerun.
diff: false hides secrets ansible --check --diff of the real app.ini.j2, with and without 5 → 0 secret lines; status kept
Backtick-quoted odd password real render of the template one value, intact
Empty env real render exit 0, empty USER, ``PASSWD = ```` (the ADVISORY above)
enable-email-notifications is a real workflow key already in use infra-cockpit .forgejo/workflows/deploy.yml:28 present

Named, not charged

  • AC3 and PROD's live mailer: not yet done, disclosed by the author.
  • AC2 rehearsed with the shared account before the dedicated one was stored: disclosed. A send with the final credential after merge is the Operator's check.
  • Unverified by me: that Forgejo 15.0.9's ini parser reads the backtick quoting (the PRE app.ini and the successful test mail are the author's evidence; my probe proves only what the template emits); that SMTP2GO accepts the plus-addressed sender; the "success after a failure" mail semantics in docs/actions/runner-and-workflows.md:179-181.
  • docs/actions/runner-and-workflows.md:184 says deploy.yml carries the key; this repo has no deploy.yml, but infra-cockpit does, and the page covers what workflows on this runner may ask for. Not charged.

Summary

Axis Findings Worst
Standards 4 (1 BLOCKER, 3 ADVISORY) BLOCKER: the PR body does not name FO-49 (AGENTS.md §Pull requests)
Spec 0 Nothing the PR claims is refuted; AC2 on the shipped credential and AC3 are open and disclosed

The state follows the blocker. Clear it with the one body line and I re-review the delta; the three advisories travel as advice and do not block on their own.

<!-- minos review-loop: repo=olympus/infra-forge pr=87 head=705b89e7f3a4ad33eff50952ae98147b634fdce5 round=1/5 axes=standards,spec --> repo=olympus/infra-forge pr=87 head=705b89e7f3a4ad33eff50952ae98147b634fdce5 round=1/5 verdict=REQUEST_CHANGES Reviewed head 705b89e7f3a4ad33eff50952ae98147b634fdce5 (round 1/5; no earlier review on this thread; the full head is reviewed against base c2ff9ca). Recommendation: fix The recommendation turns on the one BLOCKER below, which is a one-line edit to the PR body. The code itself does what FO-49's first criterion asks. **Spec source:** the PR body names no task, so the task came from the title: FO-49 "Send Forgejo's job-failure mail" (Vikunja project 4, task 267, read live). Its three acceptance criteria are the contract. **Standards source:** `AGENTS.md` (§Secrets, §Pull requests, §Code comments), `docs/runbooks/0001-deploy-and-rollback.md`, `docs/adr/` (no record bears on this change). ## Standards **BLOCKER — the PR body does not name the task.** `AGENTS.md` §Pull requests: "Name the task a PR addresses in its body as `FO-<index>`". The body (Summary, Evidence, Not yet, Merge Danger) never says FO-49; only the title and the four commit subjects do. This review had to infer the spec from the title. PR #86 shows the practice (`Addresses FO-53 …` as the body's first line). Clears with: one line in the body, e.g. `Addresses FO-49.` **ADVISORY — an unset credential renders silently as an enabled mailer with empty credentials.** `forgejo/service/group_vars/forgejo/vars.yml:20-21` reads both names with `lookup('env', …)`, which answers `''` for an unset name. `Makefile` `require_secret` (lines 150-155) only tests that `.env` exists. Driven for real: the shipped `app.ini.j2` rendered through `ansible-playbook` with both names empty exits 0 and writes `ENABLED = true`, `USER = `, ``PASSWD = ```` (probe `real_empty`). The case is a `.env` fetched before this merge, then `make service`; the PR body's PROD step ("this merge and a second `make service`") does not say to re-run `make env` first. Forgejo then runs with a mailer that cannot authenticate and nothing fails until a mail is sent. The role already has an `assert` pattern (`roles/forgejo/tasks/main.yml:353`); an assert that both values are non-empty while `forgejo_mailer_enabled` would close it. The other `vault_*` names share the lookup pattern, so the gap is not new in kind. This one fails silently, where a missing DB password fails loudly. **ADVISORY — `diff: false` withholds the whole `app.ini` diff and the runbook does not say so.** `forgejo/service/roles/forgejo/tasks/main.yml:126`. The claim holds, proved as a red/green pair on the real template: with `diff: true` the `--check --diff` output carried 5 lines of sentinel secrets, with `diff: false` it carried 0 and the task still reported `changed=1`. The cost is that the Operator reading `make service-check` no longer sees any `app.ini` change, secret or not. `docs/runbooks/0001-deploy-and-rollback.md:236-239` still reads "It still rehearses the templated config" with no mention that the config's diff is not printed. One sentence there would settle it. Note the change is beyond FO-49's criteria; the Summary discloses it, so it is not charged as scope creep. **ADVISORY — comments beyond the minimum.** `AGENTS.md` §Code comments: "Keep comments to a minimum … propose a docs page under `docs/` instead". Added: `roles/forgejo/defaults/main.yml:38-40`, `roles/forgejo/tasks/main.yml:124-125`, `roles/forgejo/templates/app.ini.j2:48` (the backtick note repeats `docs/actions/runner-and-workflows.md:194-196` word for word), `group_vars/forgejo/vars.yml:19`, `env.map:26`. The repo's older files carry plenty of the same, so I charge it once, as advice. ## Spec (FO-49) | Criterion | Result | | --- | --- | | The rendered `app.ini` carries a `[mailer]` block, with no secret in the repository | **Met.** Rendered the head template with ansible: `[mailer]` with `smtp+starttls`, `mail.smtp2go.com`, `587`, `noreply+forgejo@thepit.space`, and `USER`/`PASSWD` from the environment; a password holding a space, `#` and `;` renders as one backtick-quoted value. No secret is in the diff (`env.map:33` maps names, `.env.example:15-16` is blank). `make env-check`: 19 names, all declared. | | A test mail from site administration arrives at me@thepit.space from noreply+forgejo@thepit.space | **Not shown for the credential that ships.** The body reports "A test email has been sent" and an internal 200, on the shared `thepit` account; the dedicated `atthepit-forgejo` pair was written afterwards and has not been through a send. Arrival and the From address are not stated. I cannot see the inbox. Disclosed by the author; see "Named, not charged". | | A workflow with `enable-email-notifications: true` that fails mails its pusher | **Not yet; disclosed** under "Not yet". The body promises nothing here. | No requirement is missing from the code that the criteria ask for in this PR; nothing outside the criteria was added except `diff: false` (disclosed). ## What I verified, and how | Claim | How | Result | | --- | --- | --- | | Head is the dispatched SHA | `git ls-remote origin refs/pull/87/head` at the start and before posting | `705b89e7…` both times | | `make check` green | `mise exec -- make check` in a head worktree | rc=0: env pin ok, 19 names declared, docs-check 5 assertions | | CI contexts | `get_commit_statuses` on the head | env-check, fmt-check, validate, syntax-check, docs-check: success. The two `plan` contexts show a rerun (runs 70/71) pending at review time; their earlier run 68 on the same SHA is success. The body's "seven … green" holds for run 68, not yet for the rerun. | | `diff: false` hides secrets | ansible `--check --diff` of the real `app.ini.j2`, with and without | 5 → 0 secret lines; status kept | | Backtick-quoted odd password | real render of the template | one value, intact | | Empty env | real render | exit 0, empty `USER`, ``PASSWD = ```` (the ADVISORY above) | | `enable-email-notifications` is a real workflow key already in use | `infra-cockpit` `.forgejo/workflows/deploy.yml:28` | present | ## Named, not charged - AC3 and PROD's live mailer: not yet done, disclosed by the author. - AC2 rehearsed with the shared account before the dedicated one was stored: disclosed. A send with the final credential after merge is the Operator's check. - Unverified by me: that Forgejo 15.0.9's ini parser reads the backtick quoting (the PRE `app.ini` and the successful test mail are the author's evidence; my probe proves only what the template emits); that SMTP2GO accepts the plus-addressed sender; the "success after a failure" mail semantics in `docs/actions/runner-and-workflows.md:179-181`. - `docs/actions/runner-and-workflows.md:184` says `deploy.yml` carries the key; this repo has no `deploy.yml`, but `infra-cockpit` does, and the page covers what workflows on this runner may ask for. Not charged. ## Summary | Axis | Findings | Worst | | --- | --- | --- | | Standards | 4 (1 BLOCKER, 3 ADVISORY) | BLOCKER: the PR body does not name FO-49 (`AGENTS.md` §Pull requests) | | Spec | 0 | Nothing the PR claims is refuted; AC2 on the shipped credential and AC3 are open and disclosed | The state follows the blocker. Clear it with the one body line and I re-review the delta; the three advisories travel as advice and do not block on their own.
Member

Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.

**Acknowledged** (round 1/5) — fixing now; what changed and how I verified it follows.
The new comments keep only what the code cannot say (FO-49)
All checks were successful
pr-checks / env-check (pull_request) Successful in 29s
pr-checks / fmt-check (pull_request) Successful in 22s
pr-checks / syntax-check (pull_request) Successful in 20s
pr-checks / docs-check (pull_request) Successful in 19s
plan / guest-plan-check (pull_request) Successful in 26s
plan / edge-plan-check (pull_request) Successful in 28s
pr-checks / validate (pull_request) Successful in 48s
040f20c491
Member

Round 1 fixed — 1 BLOCKER and 3 ADVISORY, all four resolved. Nothing disputed, nothing left unfixed; what stays open is what the review already named as the author's, not this round's.

# Finding Resolves Where
1 BLOCKER — the body does not name the task (AGENTS.md §Pull requests) the body's first line is now Addresses FO-49. PR body — no commit; the stored body was read back and compared byte for byte with what was sent
2 ADVISORY — an unset credential renders silently as an enabled mailer with empty credentials ff7ef1a forgejo/service/roles/forgejo/tasks/main.yml:1-15
3 ADVISORY — diff: false withholds the whole app.ini diff and the runbook does not say so 7c251e8 docs/runbooks/0001-deploy-and-rollback.md §4
4 ADVISORY — comments beyond the minimum 040f20c env.map, group_vars/forgejo/vars.yml, roles/forgejo/defaults/main.yml, the diff: false note, templates/app.ini.j2

Finding 2. The assert is the role's first task, before §1, so it fires before a package, a user or a database change — the position the runner role's fail early when the environment carries no runner secret takes, and the shape the role's own fail early if a repo slug contains the list separator guard models. It carries no ansible_check_mode guard, so it also fires under --check: service runs the rehearsal first, so a stale .env stops the run before the apply. Driven against the branch's own group_vars over a local connection with no facts gathered:

# FORGEJO_SMTP_USERNAME / FORGEJO_SMTP_PASSWORD unset
TASK [forgejo : fail early when the environment carries no SMTP credential]
fatal: [probe]: FAILED! => {"assertion": "vault_forgejo_smtp_username | length > 0",
  "evaluated_to": false, "msg": "FORGEJO_SMTP_USERNAME and FORGEJO_SMTP_PASSWORD must
  both be set, and one is empty in this run's environment. The mailer is enabled and
  the pair is `secret/services/forgejo/smtp`; fetch it with `mise exec -- make env
  ACTOR=<actor>` in this checkout and retry."}
rc=2

# both names set
TASK [forgejo : fail early when the environment carries no SMTP credential]
ok: [probe] => {"changed": false, "msg": "All assertions passed"}

The body's PROD step now names the order this guard implies: merge, then mise exec -- make env ACTOR=<actor> so .env carries secret/services/forgejo/smtp, then a second make service. It read "this merge and a second make service", which was the very .env-from-before case the advisory described.

Finding 3. The runbook's rehearsal paragraph now says the app.ini template sets diff: false, that the file is reported changed or ok without being printed, and that neither service-check nor service shows its diff.

Finding 4. The backtick note is gone from app.ini.j2 rather than shortened: that template's comments render into the live app.ini, and docs/actions/runner-and-workflows.md §Failure mail already carries the fact. The same reasoning removed the restatements from the four other sites; what survives is only what the code cannot say — the lookup('env') empty-string behaviour, and why FROM is stated.

Verification at 040f20c (the head this is written on):

Command rc What it printed
mise exec -- make check 0 env.map: 19 names, all declared in .env.example; docs-check: all 5 assertions hold (fmt-check is silent on success, per its recipe)
mise exec -- make syntax-check 0 both playbooks parse; playbook: site.yml twice
mise exec -- make validate 0 Success! The configuration is valid. for all three Stacks
credential guard, names unset 2 the FAILED! transcript above
credential guard, names set 0 All assertions passed before the first mutating task

make check and validate run in the worktree; syntax-check points at the canonical checkout's installed collections, which is what ansible.cfg's collections_path expects — the worktree has none of its own.

CI. All seven pull-request contexts are green at 040f20c: pr-checks' five — env-check, fmt-check, validate, syntax-check, docs-check — and plan's two, guest-plan-check and edge-plan-check. The push and the body edit each fired the workflows, so the status list carries a context more than once with nothing marking which row is current; taken as the latest created_at per context, every one is success (runs 72 and 73 on the push, 74 on the body edit — three runs, all success).

Own review. code-review ran both axes over the diff before the push. Its Standards axis caught a real standard breach I had introduced — my fail_msg said make env where AGENTS.md §Toolchain and the sibling guard's message both say mise exec -- make env ACTOR=<actor> — and its Spec axis caught the wording overstating "are empty" for a case where only one name is. Both are fixed in ff7ef1a; the guard also moved from the top of §2 to the top of the role on the Standards axis's advice.

Left alone, deliberately. AC2 on the shipped atthepit-forgejo credential and AC3 are open exactly as the review named them: both need a send from PROD's forge after this merge, and this round could not make one. The review's three "not verified" items are still unverified by me — the ini parser on 15.0.9 reading the backticks, SMTP2GO accepting the plus-addressed sender, and the success-after-failure mail semantics. Nothing here rests on them.

**Round 1 fixed** — 1 BLOCKER and 3 ADVISORY, all four resolved. Nothing disputed, nothing left unfixed; what stays open is what the review already named as the author's, not this round's. | # | Finding | Resolves | Where | | --- | --- | --- | --- | | 1 | **BLOCKER** — the body does not name the task (`AGENTS.md` §Pull requests) | the body's first line is now `Addresses FO-49.` | PR body — no commit; the stored body was read back and compared byte for byte with what was sent | | 2 | ADVISORY — an unset credential renders silently as an enabled mailer with empty credentials | `ff7ef1a` | `forgejo/service/roles/forgejo/tasks/main.yml:1-15` | | 3 | ADVISORY — `diff: false` withholds the whole `app.ini` diff and the runbook does not say so | `7c251e8` | `docs/runbooks/0001-deploy-and-rollback.md` §4 | | 4 | ADVISORY — comments beyond the minimum | `040f20c` | `env.map`, `group_vars/forgejo/vars.yml`, `roles/forgejo/defaults/main.yml`, the `diff: false` note, `templates/app.ini.j2` | **Finding 2.** The `assert` is the role's first task, before §1, so it fires before a package, a user or a database change — the position the runner role's `fail early when the environment carries no runner secret` takes, and the shape the role's own `fail early if a repo slug contains the list separator` guard models. It carries no `ansible_check_mode` guard, so it also fires under `--check`: `service` runs the rehearsal first, so a stale `.env` stops the run before the apply. Driven against the branch's own `group_vars` over a local connection with no facts gathered: ```text # FORGEJO_SMTP_USERNAME / FORGEJO_SMTP_PASSWORD unset TASK [forgejo : fail early when the environment carries no SMTP credential] fatal: [probe]: FAILED! => {"assertion": "vault_forgejo_smtp_username | length > 0", "evaluated_to": false, "msg": "FORGEJO_SMTP_USERNAME and FORGEJO_SMTP_PASSWORD must both be set, and one is empty in this run's environment. The mailer is enabled and the pair is `secret/services/forgejo/smtp`; fetch it with `mise exec -- make env ACTOR=<actor>` in this checkout and retry."} rc=2 # both names set TASK [forgejo : fail early when the environment carries no SMTP credential] ok: [probe] => {"changed": false, "msg": "All assertions passed"} ``` The body's PROD step now names the order this guard implies: merge, then `mise exec -- make env ACTOR=<actor>` so `.env` carries `secret/services/forgejo/smtp`, then a second `make service`. It read "this merge and a second `make service`", which was the very `.env`-from-before case the advisory described. **Finding 3.** The runbook's rehearsal paragraph now says the `app.ini` template sets `diff: false`, that the file is reported `changed` or `ok` without being printed, and that neither `service-check` nor `service` shows its diff. **Finding 4.** The backtick note is gone from `app.ini.j2` rather than shortened: that template's comments render into the live `app.ini`, and `docs/actions/runner-and-workflows.md` §Failure mail already carries the fact. The same reasoning removed the restatements from the four other sites; what survives is only what the code cannot say — the `lookup('env')` empty-string behaviour, and why `FROM` is stated. **Verification at `040f20c`** (the head this is written on): | Command | rc | What it printed | | --- | --- | --- | | `mise exec -- make check` | 0 | `env.map: 19 names, all declared in .env.example`; `docs-check: all 5 assertions hold` (`fmt-check` is silent on success, per its recipe) | | `mise exec -- make syntax-check` | 0 | both playbooks parse; `playbook: site.yml` twice | | `mise exec -- make validate` | 0 | `Success! The configuration is valid.` for all three Stacks | | credential guard, names unset | 2 | the `FAILED!` transcript above | | credential guard, names set | 0 | `All assertions passed` before the first mutating task | `make check` and `validate` run in the worktree; `syntax-check` points at the canonical checkout's installed collections, which is what `ansible.cfg`'s `collections_path` expects — the worktree has none of its own. **CI.** All seven pull-request contexts are green at `040f20c`: `pr-checks`' five — `env-check`, `fmt-check`, `validate`, `syntax-check`, `docs-check` — and `plan`'s two, `guest-plan-check` and `edge-plan-check`. The push and the body edit each fired the workflows, so the status list carries a context more than once with nothing marking which row is current; taken as the latest `created_at` per context, every one is `success` (runs 72 and 73 on the push, 74 on the body edit — three runs, all `success`). **Own review.** `code-review` ran both axes over the diff before the push. Its Standards axis caught a real standard breach I had introduced — my `fail_msg` said `make env` where `AGENTS.md` §Toolchain and the sibling guard's message both say `mise exec -- make env ACTOR=<actor>` — and its Spec axis caught the wording overstating "are empty" for a case where only one name is. Both are fixed in `ff7ef1a`; the guard also moved from the top of §2 to the top of the role on the Standards axis's advice. **Left alone, deliberately.** AC2 on the shipped `atthepit-forgejo` credential and AC3 are open exactly as the review named them: both need a send from PROD's forge after this merge, and this round could not make one. The review's three "not verified" items are still unverified by me — the ini parser on 15.0.9 reading the backticks, SMTP2GO accepting the plus-addressed sender, and the success-after-failure mail semantics. Nothing here rests on them.
Member

Review started (round 2/5) on 040f20c491 — reading the diff now.

**Review started** (round 2/5) on 040f20c49144ef2c16deb7a2757c389333f7692a — reading the diff now.
bot-minos approved these changes 2026-11-05 15:53:44 +00:00
bot-minos left a comment

repo=olympus/infra-forge pr=87 head=040f20c49144ef2c16deb7a2757c389333f7692a round=2/5 verdict=APPROVED

Reviewed head 040f20c491 (round 2/5; the thread holds one earlier review, so this is the second, which matches the dispatch). Fixed point: 705b89e (round 1's head) is an ancestor of 040f20c (git merge-base --is-ancestor → 0), so the round's delta is git diff 705b89e..040f20c — 6 files, +21/−9, no base merge in it.

Recommendation: merge

No BLOCKER and no new finding; the one BLOCKER and the three ADVISORIES from round 1 are all resolved, below.

Spec source: FO-49 "Send Forgejo's job-failure mail" (Vikunja project 4, task 267, read live this round; no comments on the task). Its three acceptance criteria are the contract; the PR body now opens Addresses FO-49. Standards source: AGENTS.md at the head worktree (§Secrets, §Pull requests, §Code comments, §Toolchain), docs/runbooks/0001-deploy-and-rollback.md, and the org ADRs in olympus/workshop docs/adr/ read from main (ADR-0007, "a path is one credential: fields share a path only when they rotate together", is the one that bears; secret/services/forgejo/smtp holding the username/password pair SMTP2GO issues as one credential meets it).

Round 1, re-driven

Round 1 finding Resolved by Evidence at head
BLOCKER — the body does not name the task (AGENTS.md §Pull requests) PR body edit (no commit) get_pull_request_by_index read live: the body's first line is Addresses FO-49.
ADVISORY — unset credential renders an enabled mailer with empty credentials ff7ef1a, forgejo/service/roles/forgejo/tasks/main.yml:2-15 Red/green pair below
ADVISORY — diff: false withholds the whole app.ini diff and the runbook did not say so 7c251e8, docs/runbooks/0001-deploy-and-rollback.md:239-242 The sentence is there: the rehearsal reports the file as changed or ok without printing it, and neither service-check nor service shows its diff. diff: false is a task-level setting (tasks/main.yml:140), so it holds for both Targets
ADVISORY — comments beyond the minimum (AGENTS.md §Code comments) 040f20c Four restatements removed (env.map, group_vars/forgejo/vars.yml, the app.ini.j2 backtick note, the long defaults/main.yml block). Three short comments remain on lines the diff adds: tasks/main.yml:2-4, tasks/main.yml:139, defaults/main.yml:38; each says something the code cannot (the lookup('env') empty-string behaviour, why the file's diff is withheld, why FROM is stated). Advisory retired

Standards

No findings. The guard sits where the role's own guards sit (first task, before any mutation), names the Target the way AGENTS.md §Toolchain asks (mise exec -- make env ACTOR=<actor>), and prints no value on failure.

Spec (FO-49)

Criterion Result
The rendered app.ini carries a [mailer] block, with no secret in the repository Met. app.ini.j2:41-48 renders [mailer]; the credential reaches it by env.map:32 → group_vars/forgejo/vars.yml:19-20 and appears in no tracked file (.env.example:16-17 is blank). make check rc=0: env.map names all declared, docs-check: all 5 assertions hold
A test mail from site administration arrives at me@thepit.space from noreply+forgejo@thepit.space Not shown for the credential that ships; unchanged since round 1. The body reports the send on the shared account; the dedicated atthepit-forgejo pair has not been through a send. Disclosed under "Not yet"
A failing workflow with enable-email-notifications: true mails its pusher Not yet; disclosed. Needs the mailer live on PROD's forge

The round's delta adds nothing the criteria did not ask for beyond the guard, which round 1 asked for.

What I verified, and how

Claim How Result
Head is the dispatched SHA git ls-remote origin refs/pull/87/head, and the fetched ref 040f20c4… both
The guard fires on a missing credential and only then Drove the real role from a local connection with no facts gathered, the head's own group_vars symlinked in, --check, the same environment against 705b89e and 040f20c (probe wave1.sh) 705b89e, both unset: rc=0, no SMTP task exists. 040f20c, both unset: rc=2, fatal naming secret/services/forgejo/smtp and mise exec -- make env ACTOR=<actor>. Username only: rc=2. Password only: rc=2. Both set: rc=0, the assert reports ok and the next tasks run. forgejo_mailer_enabled=false, both unset: the assert is skipping, rc=0
The failure leaks no secret Set the password to p w#; and grepped every probe log No log carries it; the failure prints the expression and evaluated_to: false, not the values
make check mise exec -- make check in the head worktree rc=0
make validate same rc=0, Success! The configuration is valid.
make syntax-check same; the worktree has no collections/, so with ANSIBLE_COLLECTIONS_PATH=~/.ansible/collections Without it rc=2 on community.postgresql.postgresql_user at tasks/main.yml:92, a line the diff does not touch. With it rc=0, playbook: site.yml twice. The author reported the same environment dependency
Worktree clean after the runs git status --porcelain empty
CI by SHA get_commit_statuses at 040f20c, latest created_at per context env-check, fmt-check, validate, syntax-check, docs-check, guest-plan-check, edge-plan-check: all success (runs 73 and 74); the earlier rows are pending rows of the same jobs

Not verified

  • AC2 on the shipped atthepit-forgejo credential and AC3: both need a send from PROD's forge after the merge. I cannot see the inbox.
  • That Forgejo 15.0.9's ini parser reads the backtick-quoted password: the author's PRE app.ini and successful test mail are the evidence; my probes prove what the template emits and what the guard does.
  • That SMTP2GO accepts the plus-addressed sender, and the "success after a failure" mail semantics (docs/actions/runner-and-workflows.md:179-181).
  • The PR body's PRE rehearsal, the test-mail send and the log line: author's evidence, not reproducible from here.

Named, not charged

  • AC2 on the final credential and AC3: disclosed by the author, and the PROD order (merge → mise exec -- make env ACTOR=<actor> → second make service) is in the body and enforced by the guard.
  • The body says the role "refuses a run whose environment carries neither name"; the guard is stricter (it refuses when either name is empty, proved above). The body understates the code; it does not mislead.
  • syntax-check needing the canonical checkout's collections in a bare worktree: pre-existing, on a line the diff does not touch.

Summary

Axis Findings Worst
Standards 0 none; round 1's BLOCKER and its ADVISORIES resolved
Spec 0 none; AC2 on the shipped credential and AC3 are open and disclosed

Zero BLOCKERS and zero advisories: the state is APPROVED and the recommendation is merge.

<!-- minos review-loop: repo=olympus/infra-forge pr=87 head=040f20c49144ef2c16deb7a2757c389333f7692a round=2/5 axes=standards,spec --> repo=olympus/infra-forge pr=87 head=040f20c49144ef2c16deb7a2757c389333f7692a round=2/5 verdict=APPROVED Reviewed head 040f20c49144ef2c16deb7a2757c389333f7692a (round 2/5; the thread holds one earlier review, so this is the second, which matches the dispatch). Fixed point: `705b89e` (round 1's head) is an ancestor of `040f20c` (`git merge-base --is-ancestor` → 0), so the round's delta is `git diff 705b89e..040f20c` — 6 files, +21/−9, no base merge in it. Recommendation: merge No BLOCKER and no new finding; the one BLOCKER and the three ADVISORIES from round 1 are all resolved, below. **Spec source:** FO-49 "Send Forgejo's job-failure mail" (Vikunja project 4, task 267, read live this round; no comments on the task). Its three acceptance criteria are the contract; the PR body now opens `Addresses FO-49.` **Standards source:** `AGENTS.md` at the head worktree (§Secrets, §Pull requests, §Code comments, §Toolchain), `docs/runbooks/0001-deploy-and-rollback.md`, and the org ADRs in `olympus/workshop` `docs/adr/` read from `main` (ADR-0007, "a path is one credential: fields share a path only when they rotate together", is the one that bears; `secret/services/forgejo/smtp` holding the username/password pair SMTP2GO issues as one credential meets it). ## Round 1, re-driven | Round 1 finding | Resolved by | Evidence at head | | --- | --- | --- | | BLOCKER — the body does not name the task (`AGENTS.md` §Pull requests) | PR body edit (no commit) | `get_pull_request_by_index` read live: the body's first line is `Addresses FO-49.` | | ADVISORY — unset credential renders an enabled mailer with empty credentials | `ff7ef1a`, `forgejo/service/roles/forgejo/tasks/main.yml:2-15` | Red/green pair below | | ADVISORY — `diff: false` withholds the whole `app.ini` diff and the runbook did not say so | `7c251e8`, `docs/runbooks/0001-deploy-and-rollback.md:239-242` | The sentence is there: the rehearsal reports the file as `changed` or `ok` without printing it, and neither `service-check` nor `service` shows its diff. `diff: false` is a task-level setting (`tasks/main.yml:140`), so it holds for both Targets | | ADVISORY — comments beyond the minimum (`AGENTS.md` §Code comments) | `040f20c` | Four restatements removed (`env.map`, `group_vars/forgejo/vars.yml`, the `app.ini.j2` backtick note, the long `defaults/main.yml` block). Three short comments remain on lines the diff adds: `tasks/main.yml:2-4`, `tasks/main.yml:139`, `defaults/main.yml:38`; each says something the code cannot (the `lookup('env')` empty-string behaviour, why the file's diff is withheld, why `FROM` is stated). Advisory retired | ## Standards No findings. The guard sits where the role's own guards sit (first task, before any mutation), names the Target the way `AGENTS.md` §Toolchain asks (`mise exec -- make env ACTOR=<actor>`), and prints no value on failure. ## Spec (FO-49) | Criterion | Result | | --- | --- | | The rendered `app.ini` carries a `[mailer]` block, with no secret in the repository | **Met.** `app.ini.j2:41-48` renders `[mailer]`; the credential reaches it by `env.map:32` → `group_vars/forgejo/vars.yml:19-20` and appears in no tracked file (`.env.example:16-17` is blank). `make check` rc=0: `env.map` names all declared, `docs-check: all 5 assertions hold` | | A test mail from site administration arrives at me@thepit.space from noreply+forgejo@thepit.space | **Not shown for the credential that ships; unchanged since round 1.** The body reports the send on the shared account; the dedicated `atthepit-forgejo` pair has not been through a send. Disclosed under "Not yet" | | A failing workflow with `enable-email-notifications: true` mails its pusher | **Not yet; disclosed.** Needs the mailer live on PROD's forge | The round's delta adds nothing the criteria did not ask for beyond the guard, which round 1 asked for. ## What I verified, and how | Claim | How | Result | | --- | --- | --- | | Head is the dispatched SHA | `git ls-remote origin refs/pull/87/head`, and the fetched ref | `040f20c4…` both | | The guard fires on a missing credential and only then | Drove the real role from a local connection with no facts gathered, the head's own `group_vars` symlinked in, `--check`, the same environment against `705b89e` and `040f20c` (probe `wave1.sh`) | `705b89e`, both unset: rc=0, no SMTP task exists. `040f20c`, both unset: **rc=2**, `fatal` naming `secret/services/forgejo/smtp` and `mise exec -- make env ACTOR=<actor>`. Username only: rc=2. Password only: rc=2. Both set: rc=0, the assert reports `ok` and the next tasks run. `forgejo_mailer_enabled=false`, both unset: the assert is `skipping`, rc=0 | | The failure leaks no secret | Set the password to `p w#;` and grepped every probe log | No log carries it; the failure prints the expression and `evaluated_to: false`, not the values | | `make check` | `mise exec -- make check` in the head worktree | rc=0 | | `make validate` | same | rc=0, `Success! The configuration is valid.` | | `make syntax-check` | same; the worktree has no `collections/`, so with `ANSIBLE_COLLECTIONS_PATH=~/.ansible/collections` | Without it rc=2 on `community.postgresql.postgresql_user` at `tasks/main.yml:92`, a line the diff does not touch. With it rc=0, `playbook: site.yml` twice. The author reported the same environment dependency | | Worktree clean after the runs | `git status --porcelain` | empty | | CI by SHA | `get_commit_statuses` at `040f20c`, latest `created_at` per context | `env-check`, `fmt-check`, `validate`, `syntax-check`, `docs-check`, `guest-plan-check`, `edge-plan-check`: all `success` (runs 73 and 74); the earlier rows are `pending` rows of the same jobs | ## Not verified - AC2 on the shipped `atthepit-forgejo` credential and AC3: both need a send from PROD's forge after the merge. I cannot see the inbox. - That Forgejo 15.0.9's ini parser reads the backtick-quoted password: the author's PRE `app.ini` and successful test mail are the evidence; my probes prove what the template emits and what the guard does. - That SMTP2GO accepts the plus-addressed sender, and the "success after a failure" mail semantics (`docs/actions/runner-and-workflows.md:179-181`). - The PR body's PRE rehearsal, the test-mail send and the log line: author's evidence, not reproducible from here. ## Named, not charged - AC2 on the final credential and AC3: disclosed by the author, and the PROD order (merge → `mise exec -- make env ACTOR=<actor>` → second `make service`) is in the body and enforced by the guard. - The body says the role "refuses a run whose environment carries neither name"; the guard is stricter (it refuses when either name is empty, proved above). The body understates the code; it does not mislead. - `syntax-check` needing the canonical checkout's collections in a bare worktree: pre-existing, on a line the diff does not touch. ## Summary | Axis | Findings | Worst | | --- | --- | --- | | Standards | 0 | none; round 1's BLOCKER and its ADVISORIES resolved | | Spec | 0 | none; AC2 on the shipped credential and AC3 are open and disclosed | Zero BLOCKERS and zero advisories: the state is APPROVED and the recommendation is merge.
pit merged commit 19e3563c1d into main 2026-11-05 15:56:01 +00:00
pit deleted branch hermes/fo49-failure-mail 2026-11-05 15:56:01 +00:00
Sign in to join this conversation.
No reviewers
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
olympus/infra-forge!87
No description provided.