🎨 Palette: Add progress indicator to cache warm-up#108
Conversation
- Implemented a TTY-aware progress spinner for the `warm_up_cache` function. - Updates in place using `\r` to keep the CLI output clean. - Handles logging interruptions by clearing and restoring the progress line. - Falls back to standard logging for non-TTY environments. This improves the user experience during the initial phase of the sync, especially when fetching many remote resources.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Merging to
|
| for future in concurrent.futures.as_completed(futures): | ||
| completed += 1 | ||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.CYAN}⏳ Warming up cache: {completed}/{total}...{Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (107/100) Warning
|
|
||
| if USE_COLORS: | ||
| # Restore progress | ||
| sys.stderr.write(f"\r{Colors.CYAN}⏳ Warming up cache: {completed}/{total}...{Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (111/100) Warning
| sys.stderr.flush() | ||
|
|
||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.GREEN}✅ Warming up cache: {total}/{total} Done! {Colors.ENDC}\n") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (106/100) Warning
| for future in concurrent.futures.as_completed(futures): | ||
| completed += 1 | ||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.CYAN}⏳ Warming up cache: {completed}/{total}...{Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (111/100) Warning
|
|
||
| if USE_COLORS: | ||
| # Restore progress | ||
| sys.stderr.write(f"\r{Colors.CYAN}⏳ Warming up cache: {completed}/{total}...{Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (107/100) Warning
| sys.stderr.flush() | ||
|
|
||
| if USE_COLORS: | ||
| sys.stderr.write(f"\r{Colors.GREEN}✅ Warming up cache: {total}/{total} Done! {Colors.ENDC}\n") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (106/100) Warning
|
|
||
| total = len(urls_to_fetch) | ||
| if not USE_COLORS: | ||
| log.info(f"Warming up cache for {total} URLs...") |
Check notice
Code scanning / Pylintpython3 (reported by Codacy)
Use lazy % formatting in logging functions Note
🎨 Palette: CLI Progress Indicator
What: Added a real-time progress counter (e.g.,
⏳ Warming up cache: 5/23...) to the cache warm-up phase.Why: The previous implementation was silent during the network-heavy fetching phase, leaving users wondering if the tool was stuck.
UX:
(No dependencies added, purely standard library)
PR created automatically by Jules for task 11370702366396698307 started by @abhimehro