fix(#2348): stop swallowing gh pr create stderr in post-code.sh - #2349
Conversation
Replace the command substitution with 2>&1 redirect on the gh pr create call with the if-! pattern already used in reconcile-repos.sh. Previously, when gh pr create failed, stderr (containing the API error like 403 or 422) was captured into the PR_URL variable instead of flowing to the workflow logs, making failures impossible to debug. The new pattern lets stderr print to the log naturally while still capturing the PR URL on success. On failure, it emits a GitHub Actions error annotation and exits non-zero. Note: pre-commit and make lint could not run in the sandbox due to shellcheck-py failing to download (network restriction). The post-script runs an authoritative pre-commit check on the runner. bash -n syntax check passed. Closes #2348
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
Site previewPreview: https://d02c0727-site.fullsend-ai.workers.dev Commit: |
|
🤖 Finished Review · ✅ Success · Started 6:52 PM UTC · Completed 7:00 PM UTC |
ReviewFindingsLow
Info
|
| --body "${PR_BODY}" \ | ||
| 2>&1)" | ||
| --body "${PR_BODY}"); then | ||
| echo "::error::Failed to create PR: see above for details" |
There was a problem hiding this comment.
[low] error-message-consistency
Error message 'Failed to create PR: see above for details' is less specific than the established pattern in reconcile-repos.sh, which uses 'Failed to create PR for $REPO'. The post-code.sh context has ISSUE_NUMBER and BRANCH available and could include them for faster log triage. However, since post-code.sh only has one PR creation call (unlike reconcile-repos.sh which loops), the generic message is less ambiguous here.
Suggested fix: Consider using 'Failed to create PR for issue #${ISSUE_NUMBER}' or 'Failed to create PR (branch: ${BRANCH})' to provide more context.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
🤖 Finished Retro · ✅ Success · Started 8:29 PM UTC · Completed 8:36 PM UTC |
Retro: PR #2349 — fix(#2348): stop swallowing gh pr create stderrWorkflow quality: Excellent. This was a clean, single-cycle workflow with no rework. Timeline
Assessment
Observations (covered by existing issues)
No new proposals. All improvement opportunities identified are already covered by existing open issues. |
Replace the command substitution with 2>&1 redirect on the gh pr create call with the if-! pattern already used in reconcile-repos.sh. Previously, when gh pr create failed, stderr (containing the API error like 403 or 422) was captured into the PR_URL variable instead of flowing to the workflow logs, making failures impossible to debug.
The new pattern lets stderr print to the log naturally while still capturing the PR URL on success. On failure, it emits a GitHub Actions error annotation and exits non-zero.
Note: pre-commit and make lint could not run in the sandbox due to shellcheck-py failing to download (network restriction). The post-script runs an authoritative pre-commit check on the runner. bash -n syntax check passed.
Closes #2348
Post-script verification
agent/2348-fix-pr-create-stderr)966abbf5f5daec2d012b559d0e1a9808a8839652..HEAD)