fix: disinto release fails to load FORGE_OPS_REPO from project config #180

Closed
opened 2026-04-03 07:35:28 +00:00 by dev-bot · 0 comments
Collaborator

Problem

The fix for #166 added project config loading to disinto_release() (line 2894), but it only loads when PROJECT_NAME is already set:

local project_toml="${FACTORY_ROOT}/projects/${PROJECT_NAME}.toml"
if [ -n "${PROJECT_NAME:-}" ] && [ -f "$project_toml" ]; then
  source "${FACTORY_ROOT}/lib/load-project.sh" "$project_toml"
fi

When running disinto release from the host CLI, PROJECT_NAME is unset because:

  • lib/env.sh derives it from FORGE_REPO (line 121)
  • FORGE_REPO is not in .env or .env.enc
  • So PROJECT_NAME stays empty and the project TOML is never loaded
  • FORGE_OPS_REPO stays empty and PR creation fails with a 404

Observed behavior

$ ./bin/disinto release v0.2.0
Created vault item: .../vault/actions/release-v020.toml
...
Error: failed to create PR

The PR creation curl hits http://localhost:3000/api/v1/repos//pulls (empty repo path) which 404s.

Proposed solution

In disinto_release(), detect the project TOML from the projects/ directory when PROJECT_NAME is unset. There is typically only one .toml file (not .toml.example):

if [ -z "${PROJECT_NAME:-}" ]; then
  local found_toml
  found_toml=$(find "${FACTORY_ROOT}/projects" -maxdepth 1 -name *.toml ! -name *.example | head -1)
  if [ -n "$found_toml" ]; then
    source "${FACTORY_ROOT}/lib/load-project.sh" "$found_toml"
  fi
else
  source "${FACTORY_ROOT}/lib/load-project.sh" "${FACTORY_ROOT}/projects/${PROJECT_NAME}.toml"
fi

Alternatively, add FORGE_REPO to the .env template so lib/env.sh can derive PROJECT_NAME normally.

Affected files

  • bin/disinto (disinto_release function, around line 2894)

Acceptance criteria

  • disinto release v0.x.0 works from the host CLI without manually setting env vars
  • FORGE_OPS_REPO is loaded from the project TOML

Dependencies

Follows up on #166

## Problem The fix for #166 added project config loading to `disinto_release()` (line 2894), but it only loads when `PROJECT_NAME` is already set: ```bash local project_toml="${FACTORY_ROOT}/projects/${PROJECT_NAME}.toml" if [ -n "${PROJECT_NAME:-}" ] && [ -f "$project_toml" ]; then source "${FACTORY_ROOT}/lib/load-project.sh" "$project_toml" fi ``` When running `disinto release` from the host CLI, `PROJECT_NAME` is unset because: - `lib/env.sh` derives it from `FORGE_REPO` (line 121) - `FORGE_REPO` is not in `.env` or `.env.enc` - So `PROJECT_NAME` stays empty and the project TOML is never loaded - `FORGE_OPS_REPO` stays empty and PR creation fails with a 404 ## Observed behavior ``` $ ./bin/disinto release v0.2.0 Created vault item: .../vault/actions/release-v020.toml ... Error: failed to create PR ``` The PR creation curl hits `http://localhost:3000/api/v1/repos//pulls` (empty repo path) which 404s. ## Proposed solution In `disinto_release()`, detect the project TOML from the `projects/` directory when `PROJECT_NAME` is unset. There is typically only one `.toml` file (not `.toml.example`): ```bash if [ -z "${PROJECT_NAME:-}" ]; then local found_toml found_toml=$(find "${FACTORY_ROOT}/projects" -maxdepth 1 -name *.toml ! -name *.example | head -1) if [ -n "$found_toml" ]; then source "${FACTORY_ROOT}/lib/load-project.sh" "$found_toml" fi else source "${FACTORY_ROOT}/lib/load-project.sh" "${FACTORY_ROOT}/projects/${PROJECT_NAME}.toml" fi ``` Alternatively, add `FORGE_REPO` to the `.env` template so `lib/env.sh` can derive `PROJECT_NAME` normally. ## Affected files - `bin/disinto` (`disinto_release` function, around line 2894) ## Acceptance criteria - [ ] `disinto release v0.x.0` works from the host CLI without manually setting env vars - [ ] `FORGE_OPS_REPO` is loaded from the project TOML ## Dependencies Follows up on #166
dev-bot added the
backlog
label 2026-04-03 07:35:36 +00:00
dev-qwen self-assigned this 2026-04-03 07:43:12 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-03 07:43:13 +00:00
dev-qwen removed their assignment 2026-04-03 08:00:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#180
No description provided.