Improve Docker Compose progress output for better user experience#103
Open
snickerjp wants to merge 10 commits into
Open
Improve Docker Compose progress output for better user experience#103snickerjp wants to merge 10 commits into
snickerjp wants to merge 10 commits into
Conversation
Replace cluttered Docker Compose progress output with clean dot-based progress indication by default. Add --debug (-g) option to show detailed Docker progress when needed. Default behavior: - Shows user-friendly messages with dot progress - Clean terminal output Debug mode (--debug): - Shows full Docker Compose progress output - Useful for troubleshooting installation issues
When installation fails in default (clean) mode, show a helpful error message suggesting users run with --debug flag for detailed output. Features: - Clear error indication with emoji - Actionable troubleshooting advice - Maintains clean UX while providing debugging path - Applied to critical Docker Compose operations This helps users quickly identify and resolve installation issues.
Address all 6 issues identified in Copilot review: 1. Add signal traps to prevent process leaks on interruption 2. Fix race condition in exit status handling with explicit STATUS check 3. Apply consistent progress suppression to database creation step 4. Suppress docker compose up output in non-debug mode for consistency 5. Use consistent comparison operators (x = xyes pattern) 6. Preserve error messages using temporary files while suppressing progress Key improvements: - Robust background process management with proper cleanup - Complete progress output suppression in clean mode - Error details automatically shown on failure (--debug less critical) - Maintains clean UX while providing excellent troubleshooting info
Address cubic-dev-ai feedback: docker compose up -d now captures and displays error details consistently with other docker operations. Previously: - docker compose pull/run: captured errors to temp file, displayed details - docker compose up -d: discarded all error output (>/dev/null 2>&1) Now all docker operations consistently capture and display error details while maintaining clean progress output in non-debug mode.
Address Copilot feedback on code duplication: - Extract repeated progress display pattern into run_with_progress() function - Eliminates 40+ lines of duplicated code between pull and create_db operations - Fixes ERROR_LOG variable reuse issue with proper scoping - Improves maintainability and reduces bug risk - Each operation now uses independent ERROR_LOG variables This refactoring maintains identical functionality while significantly improving code quality and maintainability.
Address remaining Copilot feedback: - Reorder help text to match usage line order for better readability - Capture script name at startup to handle symlinks and different invocations - Use SCRIPT_NAME variable in error messages and help text for consistency These improvements enhance user experience and ensure correct script references regardless of how the script is invoked.
Address cubic-dev-ai feedback on POSIX compliance: - Remove 'local' keyword which is a bashism, not POSIX-compliant - Use unique variable names (RWP_MESSAGE, RWP_COMMAND) instead - Maintains compatibility with strict POSIX shells - Script continues to use #!/usr/bin/env sh as intended This ensures the script works on all POSIX-compliant shells, not just bash and dash.
…l pull High priority fixes: - Remove unconditional 'docker_compose pull' for offline environment support Docker Compose automatically pulls missing images during 'run' and 'up' Medium priority fixes: - Capture both stdout and stderr to ERROR_LOG for complete error diagnostics Changed from '>/dev/null 2>"$ERROR_LOG"' to '>"$ERROR_LOG" 2>&1' These changes improve offline installation support and error reporting.
There was a problem hiding this comment.
Pull request overview
This PR updates the setup.sh installer to reduce terminal noise during Docker image pulls and container startup by introducing a clean progress mode by default, while adding a --debug option to preserve full verbose Docker Compose output when troubleshooting.
Changes:
- Adds a
--debugflag and new helper functions (handle_error,run_with_progress) to control verbosity and improve failure messaging. - Runs selected Docker Compose operations with “progress dots” output in non-debug mode while capturing logs for error reporting.
- Refines help text and startup error handling paths to align with the new debug/non-debug behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
1 issue found across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…eanup - Fix set -e bypassing error handling: use 'wait $PID || STATUS=$?' pattern so that background process failures are properly caught and reported - Remove eval in run_with_progress: use "$@" for safer command execution - Replace Unicode emoji with ASCII text for terminal compatibility
Displaying help is not an error condition. Conventional behavior is to exit with 0 when --help is requested.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve Docker Compose progress output for better user experience
Fixes #96
This PR enhances the setup script's user experience by providing cleaner terminal output during Docker image downloads while maintaining full debugging capabilities when needed.
Problem
The current setup script produces cluttered terminal output during Docker image downloads, making it difficult to follow installation progress:
Example of Current Cluttered Output
Solution
Implemented a dual-mode progress display system:
Default Mode (Clean UX)
Debug Mode (
--debugflag)./setup.sh --debugShows full Docker Compose progress output for troubleshooting.
Key Features
--debugflagError Handling Enhancement
When installation fails in clean mode, users get actionable guidance:
Additional Improvements
Based on review feedback:
set -e+waitinteraction: Background process failures are now properly caught and reported instead of silently exitingevalusage:run_with_progressnow uses"$@"for safer command execution--helpexit code: Return 0 instead of 1 (displaying help is not an error)Testing
Benefits
This enhancement significantly improves the user experience while maintaining full debugging capabilities for advanced users and troubleshooting scenarios.