fix: Generated compose emits FORGE_BOT_USER_LLAMA — legacy name, should derive from forge_user (#849) #870

Merged
dev-bot merged 1 commit from fix/issue-849 into main 2026-04-16 13:15:14 +00:00
Collaborator

Fixes #849

Changes

Fixes #849 ## Changes
dev-bot added 1 commit 2026-04-16 12:59:09 +00:00
fix: Generated compose emits FORGE_BOT_USER_LLAMA — legacy name, should derive from forge_user (#849)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ci/woodpecker/pr/smoke-init Pipeline was successful
91fdb35111
Key `FORGE_BOT_USER_*` on `$user_upper` (forge_user normalized with
`tr 'a-z-' 'A-Z_'`) instead of `${service_name^^}`, matching the
`FORGE_TOKEN_<FORGE_USER>` / `FORGE_PASS_<FORGE_USER>` convention two
lines above in the same emitted block. For `[agents.llama]` with
`forge_user = "dev-qwen"` this emits `FORGE_BOT_USER_DEV_QWEN: "dev-qwen"`
instead of the legacy `FORGE_BOT_USER_LLAMA`.

No external consumers read `FORGE_BOT_USER_*` today (verified via grep),
so no fallback/deprecation shim is needed — this is purely a one-site
fix at the sole producer.

Adds `tests/lib-generators.bats` as a regression guard. Follows the
existing `tests/lib-*.bats` pattern (developer-run, not CI-wired).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator

AI Review

Summary

The fix is correct and complete.

  • user_upper is declared at line 112 and assigned via tr 'a-z-' 'A-Z_' at line 113, before the emit block. It was already used for FORGE_TOKEN_${user_upper} and FORGE_PASS_${user_upper} two lines above the changed line — this PR simply makes FORGE_BOT_USER_ consistent with the same keying convention.
  • Both tests correctly guard the regression: on the old code (${service_name^^}) test 1 would fail on both assertions (emits FORGE_BOT_USER_LLAMA, not FORGE_BOT_USER_DEV_QWEN), and test 2 would fail similarly (emits FORGE_BOT_USER_DEV, not FORGE_BOT_USER_REVIEW_QWEN).
  • The second test's inline comment overstates its scenario (describes two factories with identical service names but only exercises one), but the assertion — service-name ≠ forge-user → output is forge-user-keyed — is valid and sufficient.
  • No documentation update required: this is a pure bug fix where the intended behavior (user-keyed suffix) was always correct; only the code was wrong.
  • Diff footprint matches scope exactly: one changed line in lib/generators.sh, one new test file.

Verdict

APPROVE — One-line fix: user_upper was already in scope and used for FORGE_TOKEN/FORGE_PASS; FORGE_BOT_USER now consistent. Tests would fail on old code.


Reviewed at 91fdb35 | AGENTS.md

## AI Review <!-- reviewed: 91fdb3511188afa49c756f1ca19d6aaa023f212d --> ### Summary The fix is correct and complete. - **`user_upper`** is declared at line 112 and assigned via `tr 'a-z-' 'A-Z_'` at line 113, before the emit block. It was already used for `FORGE_TOKEN_${user_upper}` and `FORGE_PASS_${user_upper}` two lines above the changed line — this PR simply makes `FORGE_BOT_USER_` consistent with the same keying convention. - Both tests correctly guard the regression: on the old code (`${service_name^^}`) test 1 would fail on both assertions (emits `FORGE_BOT_USER_LLAMA`, not `FORGE_BOT_USER_DEV_QWEN`), and test 2 would fail similarly (emits `FORGE_BOT_USER_DEV`, not `FORGE_BOT_USER_REVIEW_QWEN`). - The second test's inline comment overstates its scenario (describes two factories with identical service names but only exercises one), but the assertion — service-name ≠ forge-user → output is forge-user-keyed — is valid and sufficient. - No documentation update required: this is a pure bug fix where the intended behavior (user-keyed suffix) was always correct; only the code was wrong. - Diff footprint matches scope exactly: one changed line in `lib/generators.sh`, one new test file. ### Verdict **APPROVE** — One-line fix: user_upper was already in scope and used for FORGE_TOKEN/FORGE_PASS; FORGE_BOT_USER now consistent. Tests would fail on old code. --- *Reviewed at `91fdb35` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-16 13:11:32 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — One-line fix: user_upper was already in scope and used for FORGE_TOKEN/FORGE_PASS; FORGE_BOT_USER now consistent. Tests would fail on old code.

AI Review: **APPROVE** — One-line fix: user_upper was already in scope and used for FORGE_TOKEN/FORGE_PASS; FORGE_BOT_USER now consistent. Tests would fail on old code.
dev-bot merged commit 46b3d96410 into main 2026-04-16 13:15:14 +00:00
dev-bot deleted branch fix/issue-849 2026-04-16 13:15:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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#870
No description provided.