fix: fix: disinto init change-password triggers must_change_password despite --must-change-password=false (#267) #273

Merged
dev-bot merged 1 commit from fix/issue-267 into main 2026-04-06 08:24:03 +00:00
Collaborator

Fixes #267

Changes

Fixes #267 ## Changes
dev-qwen added 1 commit 2026-04-06 08:20:02 +00:00
fix: fix: disinto init change-password triggers must_change_password despite --must-change-password=false (#267)
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
20de8e5d3a
Collaborator

AI Review — Error\n\nReview failed.\n---\n20de8e5

## AI Review — Error\n<!-- review-error: 20de8e5d3a5d113f61997f9287447acfba765c34 -->\nReview failed.\n---\n*20de8e5*
Collaborator

AI Review

Summary\n\nBug fix in setup_forge(): the unconditional change-password call on re-runs was triggering must_change_password=true in Forgejo 11.x (which ignores --must-change-password=false), blocking downstream token creation. The fix adds a live basic-auth probe and only falls back to change-password when credentials actually fail.\n\n### Verdict\n\nAPPROVE — the change is minimal, correct, and well-targeted.\n\n### Notes\n\n- forge_url is the first parameter of setup_forge() (line 581), in scope throughout ✓\n- admin_user/admin_pass locals are set before this branch ✓\n- Variables are properly quoted in the curl call ✓\n- The endpoint /api/v1/user (authenticated self-info) is the right probe: it confirms both that the password is correct and that basic auth is not blocked by must_change_password\n- Edge case (pre-existing, not introduced here): if auth fails because must_change_password=true was already set by a previous broken run, calling change-password again in Forgejo 11.x will re-set the flag — the recovery path still has the Forgejo 11.x limitation. This is acceptable; it only affects the exceptional failure branch, not the common idempotent re-run that this PR targets.

Verdict

APPROVE — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs.


Reviewed at 20de8e5 | AGENTS.md

## AI Review <!-- reviewed: 20de8e5d3a5d113f61997f9287447acfba765c34 --> ### Summary\n\nBug fix in `setup_forge()`: the unconditional `change-password` call on re-runs was triggering `must_change_password=true` in Forgejo 11.x (which ignores `--must-change-password=false`), blocking downstream token creation. The fix adds a live basic-auth probe and only falls back to `change-password` when credentials actually fail.\n\n### Verdict\n\n**APPROVE** — the change is minimal, correct, and well-targeted.\n\n### Notes\n\n- `forge_url` is the first parameter of `setup_forge()` (line 581), in scope throughout ✓\n- `admin_user`/`admin_pass` locals are set before this branch ✓\n- Variables are properly quoted in the `curl` call ✓\n- The endpoint `/api/v1/user` (authenticated self-info) is the right probe: it confirms both that the password is correct *and* that basic auth is not blocked by `must_change_password`\n- **Edge case (pre-existing, not introduced here)**: if auth fails because `must_change_password=true` was already set by a previous broken run, calling `change-password` again in Forgejo 11.x will re-set the flag — the recovery path still has the Forgejo 11.x limitation. This is acceptable; it only affects the exceptional failure branch, not the common idempotent re-run that this PR targets. ### Verdict **APPROVE** — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs. --- *Reviewed at `20de8e5` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-06 08:23:03 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs.

AI Review: **APPROVE** — Correctly guards the change-password call behind a live auth check, preventing unnecessary Forgejo 11.x must_change_password side-effects on idempotent re-runs.
dev-bot merged commit b5e97b106c into main 2026-04-06 08:24:03 +00:00
dev-bot deleted branch fix/issue-267 2026-04-06 08:24:03 +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: disinto-admin/disinto#273
No description provided.