Skip to content

Conversation

@dsyme
Copy link
Contributor

@dsyme dsyme commented Nov 14, 2025

Summary

  • Refactored workflow completion waiting mechanism with signal-aware polling
  • Added robust error handling and timeout support for workflow checks
  • Introduced a generic signal-aware polling utility for better interrupt handling

Key Changes

  • Created signal_aware_poll.go with a flexible PollWithSignalHandling function
  • Reimplemented WaitForWorkflowCompletion using the new polling mechanism
  • Added comprehensive test coverage for the new polling utility
  • Enhanced error handling for repository creation and workflow monitoring

Improvements

  • Supports graceful Ctrl-C interruption during long-running operations
  • Provides configurable polling intervals and timeouts
  • Improves visibility with optional verbose logging

Copilot AI review requested due to automatic review settings November 14, 2025 23:18
Copilot finished reviewing on behalf of dsyme November 14, 2025 23:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the workflow polling mechanism to use a reusable signal-aware polling utility. The changes introduce PollWithSignalHandling, a generic function that handles timeouts and graceful Ctrl-C interruption for long-running operations.

Key changes:

  • Created a new signal_aware_poll.go module with a flexible polling utility
  • Refactored WaitForWorkflowCompletion to use the new polling mechanism instead of custom polling logic
  • Added error handling for repository creation race conditions in trial command

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/cli/signal_aware_poll.go New polling utility with signal handling, timeout support, and configurable callbacks
pkg/cli/signal_aware_poll_test.go Comprehensive test coverage for the new polling utility including success, failure, timeout, and signal interruption cases
pkg/cli/pr_automerge.go Refactored to use PollWithSignalHandling instead of custom polling loop
pkg/cli/pr_automerge_test.go Added test to verify signal-aware polling integration
pkg/cli/trial_command.go Added fallback error handling for "name already exists" race condition during repository creation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dsyme dsyme merged commit 7b30ee5 into main Nov 14, 2025
9 checks passed
@dsyme dsyme deleted the g23 branch November 14, 2025 23:49
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.

2 participants