From 0883b1a5ebadae1aeb0bc9ae4bc503268f51868c Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 5 Apr 2026 19:21:27 +0000 Subject: [PATCH 1/3] fix: feat: add bug report issue template with required reproduction steps (#251) --- bin/disinto | 32 ++++++++++++++++++++++++++++++++ templates/issue/bug.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 templates/issue/bug.md diff --git a/bin/disinto b/bin/disinto index 48b4526..242459a 100755 --- a/bin/disinto +++ b/bin/disinto @@ -1440,6 +1440,35 @@ EOF echo " Commit this to your repo when ready" } +# Copy issue templates from templates/ to target project repo. +copy_issue_templates() { + local repo_root="$1" + local template_dir="${FACTORY_ROOT}/templates" + local target_dir="${repo_root}/.forgejo/ISSUE_TEMPLATE" + + # Skip if templates directory doesn't exist + if [ ! -d "$template_dir" ]; then + return + fi + + # Create target directory + mkdir -p "$target_dir" + + # Copy each template file if it doesn't already exist + for template in "$template_dir"/*; do + [ -f "$template" ] || continue + local filename + filename=$(basename "$template") + local target_path="${target_dir}/${filename}" + if [ ! -f "$target_path" ]; then + cp "$template" "$target_path" + echo "Copied: ${target_path}" + else + echo "Skipped: ${target_path} (already exists)" + fi + done +} + # Generate and optionally install cron entries for the project agents. install_cron() { local name="$1" toml="$2" auto_yes="$3" bare="${4:-false}" @@ -2050,6 +2079,9 @@ p.write_text(text) # Generate template deployment pipeline configs in project repo generate_deploy_pipelines "$repo_root" "$project_name" + # Copy issue templates to target project + copy_issue_templates "$repo_root" + # Install cron jobs install_cron "$project_name" "$toml_path" "$auto_yes" "$bare" diff --git a/templates/issue/bug.md b/templates/issue/bug.md new file mode 100644 index 0000000..9223e84 --- /dev/null +++ b/templates/issue/bug.md @@ -0,0 +1,28 @@ +--- +name: Bug Report +about: Report a bug or unexpected behavior +labels: bug-report +--- + +## What happened + + + +## What was expected + + + +## Steps to reproduce + + +1. +2. +3. + +## Environment + + +- Browser/Client: +- Wallet (if applicable): +- Network (if applicable): +- Version: From d1fc52870740d3b587f9bb65508842da53c47a17 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 5 Apr 2026 19:30:17 +0000 Subject: [PATCH 2/3] fix: resolve shellcheck warnings (SC2034, SC2069, SC2155) --- bin/disinto | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bin/disinto b/bin/disinto index 242459a..58ed831 100755 --- a/bin/disinto +++ b/bin/disinto @@ -2677,7 +2677,6 @@ disinto_hire_an_agent() { echo "" echo "Step 1: Creating user '${agent_name}' (if not exists)..." - local user_exists=false local user_pass="" local admin_pass="" @@ -2691,7 +2690,8 @@ disinto_hire_an_agent() { local admin_user="disinto-admin" admin_pass="${admin_pass:-admin}" local admin_token="" - local admin_token_name="temp-token-$(date +%s)" + local admin_token_name + admin_token_name="temp-token-$(date +%s)" admin_token=$(curl -sf -X POST \ -u "${admin_user}:${admin_pass}" \ -H "Content-Type: application/json" \ @@ -2712,7 +2712,6 @@ disinto_hire_an_agent() { fi if curl -sf --max-time 5 "${forge_url}/api/v1/users/${agent_name}" >/dev/null 2>&1; then - user_exists=true echo " User '${agent_name}' already exists" # Reset user password so we can get a token (#184) user_pass="agent-$(head -c 16 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | head -c 20)" @@ -2739,7 +2738,6 @@ disinto_hire_an_agent() { echo " Warning: failed to create user via admin API" >&2 # Try alternative: user might already exist if curl -sf --max-time 5 "${forge_url}/api/v1/users/${agent_name}" >/dev/null 2>&1; then - user_exists=true echo " User '${agent_name}' exists (confirmed)" else echo " Error: failed to create user '${agent_name}'" >&2 @@ -2797,9 +2795,7 @@ disinto_hire_an_agent() { echo "" echo "Step 2: Creating '${agent_name}/.profile' repo (if not exists)..." - local repo_exists=false if curl -sf --max-time 5 "${forge_url}/api/v1/repos/${agent_name}/.profile" >/dev/null 2>&1; then - repo_exists=true echo " Repo '${agent_name}/.profile' already exists" else # Create the repo using the admin API to ensure it's created in the agent's namespace. @@ -2906,8 +2902,8 @@ EOF git -C "$clone_dir" add -A if ! git -C "$clone_dir" diff --cached --quiet 2>/dev/null; then git -C "$clone_dir" commit -m "chore: initial .profile setup" -q - git -C "$clone_dir" push origin main 2>&1 >/dev/null || \ - git -C "$clone_dir" push origin master 2>&1 >/dev/null || true + git -C "$clone_dir" push origin main >/dev/null 2>&1 || \ + git -C "$clone_dir" push origin master >/dev/null 2>&1 || true echo " Committed: initial .profile setup" else echo " No changes to commit" From fc937d6904e06d38643a2691eb38c6efbb5b676f Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 5 Apr 2026 19:37:52 +0000 Subject: [PATCH 3/3] fix: fix copy_issue_templates glob to target issue/* instead of /* --- bin/disinto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/disinto b/bin/disinto index 58ed831..9483f1b 100755 --- a/bin/disinto +++ b/bin/disinto @@ -1455,7 +1455,7 @@ copy_issue_templates() { mkdir -p "$target_dir" # Copy each template file if it doesn't already exist - for template in "$template_dir"/*; do + for template in "$template_dir"/issue/*; do [ -f "$template" ] || continue local filename filename=$(basename "$template")