diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ebd7539c..759c9b9d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ This wave rebuilds three community PRs from @mvanhorn on current main. A checkpo - `/context-save` Remaining Work did not record whether a step was run, read or assumed, and `/context-restore` offered the first item as the next action (#3004). Marker format from #3019 by @mvanhorn, field-tested by @tomg65. - Design images were silently overwritten by later rounds and `--retry` attempts (#1529). Exclusive-create claim idea from #1737 by @mvanhorn. - Comparison boards and quality checks read fixed `variant-A/B/C` names or a `variant-*.png` glob and mixed rounds; a stale `feedback.json` could approve a new round. +- `$D` wrote iterate session files to `/tmp`, which does not exist on Windows, so `generate` could not record its session and `iterate` could not find it there; sessions now live in the OS temp directory. +- /setup-deploy reported a failing status command as success (the pipe hid its exit code), matched `cd` anywhere in a workflow as a deploy workflow, and left the merge-method check, Fly `/health` detection and GitHub-Actions-only status command unspecified. #### Added - `$D compare --images-file` and JSON-array `--images`, `bin/gstack-design-claim`, `bin/gstack-design-approved`, and `approved_path` in approval records. diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index c5ef439b3..9ba78fe4a 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -425,7 +425,7 @@ Run the platform detection from the deploy bootstrap: # GitHub Actions deploy workflows for f in $(find .github/workflows -maxdepth 1 \( -name '*.yml' -o -name '*.yaml' \) 2>/dev/null); do - [ -f "$f" ] && grep -qiE "deploy|release|production|staging|cd" "$f" 2>/dev/null && echo "DEPLOY_WORKFLOW:$f" + [ -f "$f" ] && grep -qiE "deploy|release|production|staging" "$f" 2>/dev/null && echo "DEPLOY_WORKFLOW:$f" done # Project type @@ -447,7 +447,7 @@ If `fly.toml` detected: 3. If installed, verify: `fly status --app {app} 2>/dev/null` 4. Infer URL: `https://{app}.fly.dev` 5. Set deploy status command: `fly status --app {app}` -6. Set health check: `https://{app}.fly.dev` (or `/health` if the app has one) +6. Set health check: run `curl -s -o /dev/null -w "%{http_code}" https://{app}.fly.dev/health`; use `https://{app}.fly.dev/health` when it returns 2xx, otherwise `https://{app}.fly.dev` Ask the user to confirm the production URL. Some Fly apps use custom domains. @@ -495,6 +495,7 @@ If deploy workflows detected but no platform config: 1. Read the workflow file to understand what it does 2. Extract the deploy target (if mentioned) 3. Ask the user for the production URL +4. Set deploy status command: `gh run list --workflow {workflow file name} --limit 1 --json headSha,status,conclusion` #### Custom / Manual @@ -523,7 +524,7 @@ Use AskUserQuestion to gather the information: ### Step 4: Write configuration -Before writing, collect fields not already confirmed: merge method (squash/merge/rebase, constrained to methods allowed by repo settings), pre-merge command or none, deploy trigger, and status/health checks. Ask only for missing values, across every platform path. If the project does not deploy, set platform/URL/workflow/status/health/trigger to `none`, retain its CLI/library project type, and skip deploy verification. Show the complete proposed configuration and obtain confirmation. +Before writing, collect fields not already confirmed: merge method (squash/merge/rebase, offering only the methods `gh repo view --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed` reports as allowed), pre-merge command or none, deploy trigger, and status/health checks. Ask only for missing values, across every platform path. If the project does not deploy, set platform/URL/workflow/status/health/trigger to `none`, retain its CLI/library project type, and skip deploy verification. Show the complete proposed configuration and obtain confirmation. Read CLAUDE.md (or create it). Find and replace the `## Deploy Configuration` section if it exists, or append it at the end. @@ -545,6 +546,8 @@ if it exists, or append it at the end. - Health check: {URL or command} ``` +The hooks block repeats the exact commands /land-and-deploy runs: `Deploy status` is the same value as `Deploy status command`, and `Health check` the same as `Post-deploy health check`. Write each value in both places. + ### Step 5: Verify After writing, verify the configuration works: @@ -556,7 +559,9 @@ curl -sf "{health-check-url}" -o /dev/null -w "%{http_code}" 2>/dev/null || echo 2. If a deploy status command was configured, try it: ```bash -{deploy-status-command} 2>/dev/null | head -5 || echo "COMMAND_FAILED" +_OUT=$({deploy-status-command} 2>&1); _RC=$? +printf '%s\n' "$_OUT" | head -5 +[ "$_RC" -eq 0 ] || echo "COMMAND_FAILED (exit $_RC)" ``` Report results. If anything failed, note it but don't block — the config is still diff --git a/setup-deploy/SKILL.md.tmpl b/setup-deploy/SKILL.md.tmpl index 6ac0d4092..4f3125f81 100644 --- a/setup-deploy/SKILL.md.tmpl +++ b/setup-deploy/SKILL.md.tmpl @@ -68,7 +68,7 @@ Run the platform detection from the deploy bootstrap: # GitHub Actions deploy workflows for f in $(find .github/workflows -maxdepth 1 \( -name '*.yml' -o -name '*.yaml' \) 2>/dev/null); do - [ -f "$f" ] && grep -qiE "deploy|release|production|staging|cd" "$f" 2>/dev/null && echo "DEPLOY_WORKFLOW:$f" + [ -f "$f" ] && grep -qiE "deploy|release|production|staging" "$f" 2>/dev/null && echo "DEPLOY_WORKFLOW:$f" done # Project type @@ -90,7 +90,7 @@ If `fly.toml` detected: 3. If installed, verify: `fly status --app {app} 2>/dev/null` 4. Infer URL: `https://{app}.fly.dev` 5. Set deploy status command: `fly status --app {app}` -6. Set health check: `https://{app}.fly.dev` (or `/health` if the app has one) +6. Set health check: run `curl -s -o /dev/null -w "%{http_code}" https://{app}.fly.dev/health`; use `https://{app}.fly.dev/health` when it returns 2xx, otherwise `https://{app}.fly.dev` Ask the user to confirm the production URL. Some Fly apps use custom domains. @@ -138,6 +138,7 @@ If deploy workflows detected but no platform config: 1. Read the workflow file to understand what it does 2. Extract the deploy target (if mentioned) 3. Ask the user for the production URL +4. Set deploy status command: `gh run list --workflow {workflow file name} --limit 1 --json headSha,status,conclusion` #### Custom / Manual @@ -166,7 +167,7 @@ Use AskUserQuestion to gather the information: ### Step 4: Write configuration -Before writing, collect fields not already confirmed: merge method (squash/merge/rebase, constrained to methods allowed by repo settings), pre-merge command or none, deploy trigger, and status/health checks. Ask only for missing values, across every platform path. If the project does not deploy, set platform/URL/workflow/status/health/trigger to `none`, retain its CLI/library project type, and skip deploy verification. Show the complete proposed configuration and obtain confirmation. +Before writing, collect fields not already confirmed: merge method (squash/merge/rebase, offering only the methods `gh repo view --json squashMergeAllowed,mergeCommitAllowed,rebaseMergeAllowed` reports as allowed), pre-merge command or none, deploy trigger, and status/health checks. Ask only for missing values, across every platform path. If the project does not deploy, set platform/URL/workflow/status/health/trigger to `none`, retain its CLI/library project type, and skip deploy verification. Show the complete proposed configuration and obtain confirmation. Read CLAUDE.md (or create it). Find and replace the `## Deploy Configuration` section if it exists, or append it at the end. @@ -188,6 +189,8 @@ if it exists, or append it at the end. - Health check: {URL or command} ``` +The hooks block repeats the exact commands /land-and-deploy runs: `Deploy status` is the same value as `Deploy status command`, and `Health check` the same as `Post-deploy health check`. Write each value in both places. + ### Step 5: Verify After writing, verify the configuration works: @@ -199,7 +202,9 @@ curl -sf "{health-check-url}" -o /dev/null -w "%{http_code}" 2>/dev/null || echo 2. If a deploy status command was configured, try it: ```bash -{deploy-status-command} 2>/dev/null | head -5 || echo "COMMAND_FAILED" +_OUT=$({deploy-status-command} 2>&1); _RC=$? +printf '%s\n' "$_OUT" | head -5 +[ "$_RC" -eq 0 ] || echo "COMMAND_FAILED (exit $_RC)" ``` Report results. If anything failed, note it but don't block — the config is still