Skip to content

fix: preserve PR URL in opened notifications#108

Merged
jonit-dev merged 1 commit into
masterfrom
fix/pr-open-notification-url-fallback
May 10, 2026
Merged

fix: preserve PR URL in opened notifications#108
jonit-dev merged 1 commit into
masterfrom
fix/pr-open-notification-url-fallback

Conversation

@jonit-dev
Copy link
Copy Markdown
Owner

Summary

  • fall back to cached executor PR metadata when the final gh --jq URL lookup is empty
  • include pr_number in success_open_pr markers so CLI enrichment has a stable selector
  • add smoke coverage for transient gh URL lookup misses

Tests

  • yarn vitest run packages/cli/src/tests/commands/run.test.ts packages/core/src/tests/utils/notify.test.ts packages/cli/src/tests/scripts/core-flow-smoke.test.ts -t "executor should defer draft PR creation|notification integration|formatTelegramPayload" --run
  • yarn verify

@github-actions
Copy link
Copy Markdown

DiffGuard AI Analysis

AI Review Summary

🏆 Overall Score: 88/100

This PR adds a fallback mechanism for transient gh pr list lookup failures and includes pr_number in the result output. The implementation is focused, well-tested, and addresses a real reliability gap.


✅ Key Strengths

  • Reliability Improvement: Adds proper fallback to cached EXECUTOR_PR_URL when gh pr list --jq returns empty, handling real-world transient API issues.
  • Enhanced Observability: Includes pr_number in the emit_result output for both board and non-board modes, improving traceability.
  • Targeted Test Coverage: The smoke test correctly simulates a transient lookup miss and verifies the fallback behavior works as expected.

⚠️ Areas for Improvement

  • Variable Source Verification: The diff references EXECUTOR_PR_URL and EXECUTOR_PR_NUMBER but doesn't show where they're set. Ensure these are reliably populated upstream before this fallback logic executes.

📋 Issues Found

Issue Type Issue Name Affected Components Description Impact/Severity
Maintainability Implicit State Dependency night-watch-cron.sh The fallback relies on EXECUTOR_PR_URL and EXECUTOR_PR_NUMBER being set earlier; consider adding a defensive check or comment documenting this expectation. Low

🔚 Conclusion

This is a well-scoped reliability fix with appropriate test coverage. The implementation is sound, and the only minor consideration is ensuring the executor variables are consistently populated upstream. Ready to merge with that verification.


Analyzed using z-ai/glm-5

@jonit-dev
Copy link
Copy Markdown
Owner Author

Self-review pass.

Checked:

  • Diff is limited to PR-open result metadata and regression coverage.
  • Fallback preserves cached EXECUTOR_PR_URL for both board and non-board success paths when final gh pr list --jq ... .url returns empty.
  • pr_number is emitted when available, giving CLI enrichment a stable selector.
  • Regression test now simulates the final URL lookup miss and still requires pr_url + pr_number in success_open_pr.

Verification:

  • Focused notification/script tests passed locally.
  • yarn verify passed locally.
  • GitHub checks are green: verify, lint, review, test, core-flow-smoke.

@jonit-dev jonit-dev merged commit 468ddcf into master May 10, 2026
5 checks passed
@jonit-dev jonit-dev deleted the fix/pr-open-notification-url-fallback branch May 10, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant