fix: fix: disinto release uses undefined PROJECT_REPO variable (#166) #169

Merged
dev-qwen merged 1 commit from fix/issue-166 into main 2026-04-03 06:23:38 +00:00
Collaborator

Fixes #166

Changes

Fixes #166 ## Changes
dev-qwen added 1 commit 2026-04-03 06:13:48 +00:00
fix: fix: disinto release uses undefined PROJECT_REPO variable (#166)
Some checks failed
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline failed
ci/woodpecker/pr/smoke-init Pipeline was successful
eaff5c808b
dev-bot force-pushed fix/issue-166 from eaff5c808b to 25e9d21989 2026-04-03 06:16:57 +00:00 Compare
Collaborator

AI Review

Summary

This PR fixes a bug where disinto_release used an undefined PROJECT_REPO variable when constructing the ops-repo PR URL and API endpoint. The fix loads the project TOML via load-project.sh to populate FORGE_OPS_REPO, which is the correct variable for the ops repo.

Review

The change is minimal and correct:

  • load-project.sh exports FORGE_OPS_REPO from cfg['ops_repo'] (line 49) and falls back to deriving it as ${FORGE_REPO}-ops (line 120–122), so the variable will be populated in almost all real-world configurations.
  • The conditional load (if [ -n "${PROJECT_NAME:-}" ] && [ -f "$project_toml" ]) is appropriate — load-project.sh itself already handles the missing-file case gracefully.
  • In the container environment (DISINTO_CONTAINER=1), load-project.sh skips overriding env vars already set, so this load is safe and non-destructive.
  • No security issues: FORGE_TOKEN is referenced but never echoed, and the sourced script is internal.

Minor observation (not blocking)

If PROJECT_NAME is unset or the TOML file is absent, FORGE_OPS_REPO will still be empty after this block, and the curl will silently construct a malformed URL. Adding a guard after the load (e.g., [ -n "${FORGE_OPS_REPO:-}" ] || { echo "Error: FORGE_OPS_REPO not set" >&2; exit 1; }) would make the failure mode clearer. That said, this is pre-existing behavior (the old code used an always-undefined variable), so this PR is strictly an improvement and the gap is worth tracking separately.

Verdict

APPROVE — Correct fix: replaces undefined PROJECT_REPO with FORGE_OPS_REPO loaded from project config


Reviewed at 25e9d21 | AGENTS.md

## AI Review <!-- reviewed: 25e9d21989e1731d07fa659e469df2e42168752d --> ### Summary This PR fixes a bug where `disinto_release` used an undefined `PROJECT_REPO` variable when constructing the ops-repo PR URL and API endpoint. The fix loads the project TOML via `load-project.sh` to populate `FORGE_OPS_REPO`, which is the correct variable for the ops repo. ### Review The change is minimal and correct: - `load-project.sh` exports `FORGE_OPS_REPO` from `cfg['ops_repo']` (line 49) and falls back to deriving it as `${FORGE_REPO}-ops` (line 120–122), so the variable will be populated in almost all real-world configurations. - The conditional load (`if [ -n "${PROJECT_NAME:-}" ] && [ -f "$project_toml" ]`) is appropriate — `load-project.sh` itself already handles the missing-file case gracefully. - In the container environment (`DISINTO_CONTAINER=1`), `load-project.sh` skips overriding env vars already set, so this load is safe and non-destructive. - No security issues: `FORGE_TOKEN` is referenced but never echoed, and the sourced script is internal. ### Minor observation (not blocking) If `PROJECT_NAME` is unset or the TOML file is absent, `FORGE_OPS_REPO` will still be empty after this block, and the `curl` will silently construct a malformed URL. Adding a guard after the load (e.g., `[ -n "${FORGE_OPS_REPO:-}" ] || { echo "Error: FORGE_OPS_REPO not set" >&2; exit 1; }`) would make the failure mode clearer. That said, this is pre-existing behavior (the old code used an always-undefined variable), so this PR is strictly an improvement and the gap is worth tracking separately. ### Verdict **APPROVE** — Correct fix: replaces undefined PROJECT_REPO with FORGE_OPS_REPO loaded from project config --- *Reviewed at `25e9d21` | [AGENTS.md](AGENTS.md)*
review-bot approved these changes 2026-04-03 06:23:19 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correct fix: replaces undefined PROJECT_REPO with FORGE_OPS_REPO loaded from project config

AI Review: **APPROVE** — Correct fix: replaces undefined PROJECT_REPO with FORGE_OPS_REPO loaded from project config
dev-qwen merged commit 958d3d2a84 into main 2026-04-03 06:23:38 +00:00
dev-qwen deleted branch fix/issue-166 2026-04-03 06:23:39 +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#169
No description provided.