Skip to content

🎨 Palette: Add ETA to progress bars#427

Closed
abhimehro wants to merge 1 commit intomainfrom
palette/eta-progress-bar-6933896620626637858
Closed

🎨 Palette: Add ETA to progress bars#427
abhimehro wants to merge 1 commit intomainfrom
palette/eta-progress-bar-6933896620626637858

Conversation

@abhimehro
Copy link
Owner

  • 💡 What: Added Estimated Time of Arrival (ETA) to CLI progress bars and fixed a critical syntax error in validate_folder_data.
  • 🎯 Why: To reduce user anxiety during long operations (cache warming, rule pushing) and to restore application functionality.
  • 📸 Before/After: Progress bars now show — ETA: 00m 05s.
  • ♿ Accessibility: Provides better predictability for users waiting on long tasks.

PR created automatically by Jules for task 6933896620626637858 started by @abhimehro

Co-authored-by: abhimehro <84992105+abhimehro@users.noreply.github.com>
@google-labs-jules
Copy link

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@trunk-io
Copy link

trunk-io bot commented Feb 25, 2026

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@github-actions
Copy link

👋 Development Partner is reviewing this PR. Will provide feedback shortly.

@gemini-code-assist
Copy link

Summary of Changes

Hello @abhimehro, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the user experience by integrating ETA into command-line progress bars, which helps manage user expectations during potentially lengthy background tasks. Concurrently, it addresses and rectifies a critical syntax issue in a data validation function, ensuring the application's stability and correct operation.

Highlights

  • Enhanced Progress Bars: Added Estimated Time of Arrival (ETA) to CLI progress bars, providing users with better predictability for long-running operations like cache warming and rule pushing.
  • Critical Bug Fix: Resolved a critical syntax error within the validate_folder_data function, restoring application functionality related to data validation.
Changelog
  • main.py
    • Modified render_progress_bar to accept an optional start_time parameter and calculate/display ETA.
    • Implemented logic to calculate and format ETA based on elapsed time and current progress.
    • Corrected a syntax error and improved error message formatting within the validate_folder_data function.
    • Updated calls to render_progress_bar in _validate_and_fetch and process_batch to pass the start_time for ETA calculation.
Activity
  • PR created automatically by Jules for task 6933896620626637858, initiated by @abhimehro.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a helpful ETA display for progress bars, improving user experience during long operations. It also includes a critical fix for a syntax error in validate_folder_data. The implementation is well-done. I have one minor suggestion to simplify the time formatting logic for the ETA for better readability and maintainability.

Comment on lines +540 to +546
eta_seconds = int(remaining / rate)
minutes, seconds = divmod(eta_seconds, 60)
if minutes >= 60:
hours, minutes = divmod(minutes, 60)
eta_str = f" — ETA: {hours}h {minutes:02d}m"
else:
eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s"

Choose a reason for hiding this comment

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

medium

The logic for formatting the ETA string can be simplified to be more direct and slightly more efficient. Instead of calculating total minutes and then deriving hours, you can directly check if the total seconds exceed an hour's worth of seconds and format accordingly. This also avoids calculating seconds when the ETA is over an hour and they are not displayed.

Suggested change
eta_seconds = int(remaining / rate)
minutes, seconds = divmod(eta_seconds, 60)
if minutes >= 60:
hours, minutes = divmod(minutes, 60)
eta_str = f" — ETA: {hours}h {minutes:02d}m"
else:
eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s"
eta_seconds = int(remaining / rate)
if eta_seconds >= 3600:
hours, remainder = divmod(eta_seconds, 3600)
minutes, _ = divmod(remainder, 60)
eta_str = f" — ETA: {hours}h {minutes:02d}m"
else:
minutes, seconds = divmod(eta_seconds, 60)
eta_str = f" — ETA: {minutes:02d}m {seconds:02d}s"

# Use \033[K to clear line residue
sys.stderr.write(
f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}"
f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){eta_str}{Colors.ENDC}"

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (110/100) Warning

Line too long (110/100)
render_progress_bar(
0, total, "Warming up cache", prefix="⏳", start_time=start_time
)

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (120/100) Warning

Line too long (120/100)

def render_progress_bar(
current: int, total: int, label: str, prefix: str = "🚀"
current: int,

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong hanging indentation before block (add 4 spaces). Warning

Wrong hanging indentation before block (add 4 spaces).
def render_progress_bar(
current: int, total: int, label: str, prefix: str = "🚀"
current: int,
total: int,

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong hanging indentation before block (add 4 spaces). Warning

Wrong hanging indentation before block (add 4 spaces).
current: int, total: int, label: str, prefix: str = "🚀"
current: int,
total: int,
label: str,

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong hanging indentation before block (add 4 spaces). Warning

Wrong hanging indentation before block (add 4 spaces).
current: int,
total: int,
label: str,
prefix: str = "🚀",

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong hanging indentation before block (add 4 spaces). Warning

Wrong hanging indentation before block (add 4 spaces).
total: int,
label: str,
prefix: str = "🚀",
start_time: Optional[float] = None,

Check warning

Code scanning / Pylint (reported by Codacy)

Wrong hanging indentation before block (add 4 spaces). Warning

Wrong hanging indentation before block (add 4 spaces).
# Use \033[K to clear line residue
sys.stderr.write(
f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){Colors.ENDC}"
f"\r\033[K{Colors.CYAN}{prefix} {label}: [{bar}] {percent}% ({current}/{total}){eta_str}{Colors.ENDC}"

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (110/100) Warning

Line too long (110/100)
render_progress_bar(
0, total, "Warming up cache", prefix="⏳", start_time=start_time
)

Check warning

Code scanning / Pylint (reported by Codacy)

Line too long (120/100) Warning

Line too long (120/100)
@abhimehro
Copy link
Owner Author

🤖 Automated PR Review — Closing due to merge conflict

This PR has a merge conflict with main after merging several prior PRs. The ETA progress bar feature is valuable — consider re-submitting as a fresh PR against current main (without the syntax fix, which is now already on main).

@abhimehro abhimehro closed this Feb 28, 2026
@google-labs-jules
Copy link

🤖 Automated PR Review — Closing due to merge conflict

This PR has a merge conflict with main after merging several prior PRs. The ETA progress bar feature is valuable — consider re-submitting as a fresh PR against current main (without the syntax fix, which is now already on main).

Understood. Acknowledging that the previous work had a merge conflict and the syntax error was resolved on main. I will create a fresh PR for the ETA progress bar feature.

@abhimehro abhimehro deleted the palette/eta-progress-bar-6933896620626637858 branch February 28, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant