refactor: extract setup_forge() from bin/disinto into lib/forge-setup.sh #298

Closed
opened 2026-04-06 17:53:30 +00:00 by dev-bot · 3 comments
Collaborator

Context

Part of #284 — incremental extraction of bin/disinto into focused lib/ modules.

What to extract

The setup_forge() function (~386 lines) handles Forgejo provisioning: admin user creation, bot user creation, token generation, password resets, collaborator setup.

How

  1. Create lib/forge-setup.sh with setup_forge() and its helpers (_forgejo_exec, create bot users loop)
  2. Add a _load_init_context() function at the top of lib/forge-setup.sh that expects these globals: FORGE_URL, FACTORY_ROOT, PRIMARY_BRANCH. Assert they are set.
  3. In bin/disinto, replace the function body with: source "${FACTORY_ROOT}/lib/forge-setup.sh" and call setup_forge
  4. The smoke test (tests/smoke-init.sh) must still pass — it runs disinto init end-to-end

Affected files

  • bin/disinto (remove setup_forge body, add source + call)
  • lib/forge-setup.sh (new file)

Acceptance criteria

  • lib/forge-setup.sh contains setup_forge() and all its helpers
  • bin/disinto sources lib/forge-setup.sh and calls setup_forge()
  • smoke-init CI step passes
  • ShellCheck passes on both files
## Context Part of #284 — incremental extraction of bin/disinto into focused lib/ modules. ## What to extract The setup_forge() function (~386 lines) handles Forgejo provisioning: admin user creation, bot user creation, token generation, password resets, collaborator setup. ## How 1. Create lib/forge-setup.sh with setup_forge() and its helpers (_forgejo_exec, create bot users loop) 2. Add a _load_init_context() function at the top of lib/forge-setup.sh that expects these globals: FORGE_URL, FACTORY_ROOT, PRIMARY_BRANCH. Assert they are set. 3. In bin/disinto, replace the function body with: source "${FACTORY_ROOT}/lib/forge-setup.sh" and call setup_forge 4. The smoke test (tests/smoke-init.sh) must still pass — it runs disinto init end-to-end ## Affected files - bin/disinto (remove setup_forge body, add source + call) - lib/forge-setup.sh (new file) ## Acceptance criteria - [ ] lib/forge-setup.sh contains setup_forge() and all its helpers - [ ] bin/disinto sources lib/forge-setup.sh and calls setup_forge() - [ ] smoke-init CI step passes - [ ] ShellCheck passes on both files
dev-bot added the
backlog
label 2026-04-06 17:53:31 +00:00
dev-bot self-assigned this 2026-04-06 17:54:03 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-06 17:54:03 +00:00
Author
Collaborator

Blocked — issue #298

Field Value
Exit reason no_push
Timestamp 2026-04-06T17:54:06Z
Diagnostic output
Claude did not push branch fix/issue-298
### Blocked — issue #298 | Field | Value | |---|---| | Exit reason | `no_push` | | Timestamp | `2026-04-06T17:54:06Z` | <details><summary>Diagnostic output</summary> ``` Claude did not push branch fix/issue-298 ``` </details>
dev-bot added
backlog
and removed
in-progress
labels 2026-04-06 17:54:07 +00:00
dev-bot removed their assignment 2026-04-06 18:01:58 +00:00
gardener-bot added
in-progress
and removed
backlog
labels 2026-04-06 18:17:27 +00:00
Author
Collaborator

Blocked — issue #298

Field Value
Exit reason merge_blocked
Timestamp 2026-04-06T18:24:13Z
### Blocked — issue #298 | Field | Value | |---|---| | Exit reason | `merge_blocked` | | Timestamp | `2026-04-06T18:24:13Z` |
dev-bot added
blocked
and removed
in-progress
labels 2026-04-06 18:24:13 +00:00
dev-bot added
backlog
and removed
blocked
labels 2026-04-06 18:32:36 +00:00
dev-bot self-assigned this 2026-04-06 18:49:02 +00:00
dev-bot added
in-progress
and removed
backlog
labels 2026-04-06 18:49:02 +00:00
dev-qwen added
blocked
and removed
in-progress
labels 2026-04-06 18:51:56 +00:00
Collaborator

Stale in-progress issue detected

Field Value
Detection reason no_active_session_no_open_pr
Timestamp 2026-04-06T18:51:56Z

Status: This issue was labeled in-progress but no active tmux session exists.
Action required: A maintainer should triage this issue.

### Stale in-progress issue detected | Field | Value | |---|---| | Detection reason | `no_active_session_no_open_pr` | | Timestamp | `2026-04-06T18:51:56Z` | **Status:** This issue was labeled `in-progress` but no active tmux session exists. **Action required:** A maintainer should triage this issue.
dev-bot removed their assignment 2026-04-06 19:05:43 +00:00
Sign in to join this conversation.
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#298
No description provided.