Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 3, 2025

This PR adds support for printing progress information during resource availability checks by introducing a new --verbose flag that toggles the feature.

Changes Made

New --verbose Flag

  • Added --verbose CLI flag with environment variable support (WAITFOR_VERBOSE)
  • When enabled, provides detailed progress information during resource checks
  • Maintains backward compatibility - normal mode behavior is unchanged

Progress Reporting Features

When verbose mode is enabled, the CLI now displays:

  • Number of resources being checked with maximum attempt configuration
  • Individual resource URLs being tested (with numbered progress indicators)
  • Retry configuration details (interval and max interval settings)
  • Real-time timing information for resource availability tests
  • Success/failure status with precise execution timing
  • Command execution notifications

Example Output

$ waitfor --verbose -r postgres://localhost:5432/db -r http://localhost:8080 npm start
waitfor: checking 2 resource(s) with 5 max attempts
waitfor: [1/2] checking postgres://localhost:5432/db
waitfor: [2/2] checking http://localhost:8080
waitfor: retry interval: 5s, max interval: 60s
waitfor: starting resource availability tests...
waitfor: all resources available after 145ms
waitfor: executing command: npm

Documentation Updates

  • Updated command line options table in README.md
  • Added verbose output section with usage examples
  • Updated full command reference with the new flag

Environment Variable Support

The verbose mode can also be enabled via environment variable:

export WAITFOR_VERBOSE=true
waitfor -r http://localhost:8080 ./start-app.sh

This enhancement addresses the need for better visibility into waitfor's operation, especially useful for debugging resource availability issues and understanding retry behavior in CI/CD pipelines and container orchestration scenarios.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits September 3, 2025 16:40
Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com>
Co-authored-by: ziflex <1607148+ziflex@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support of printing the proigress and a new flag verbose that toggles the feature. Add verbose flag for progress reporting during resource availability checks Sep 3, 2025
Copilot AI requested a review from ziflex September 3, 2025 16:43
@ziflex ziflex marked this pull request as ready for review September 3, 2025 16:45
@ziflex ziflex closed this Sep 3, 2025
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