Skip to content

⚡ Bolt: Remove redundant API call to list folders#99

Closed
google-labs-jules[bot] wants to merge 1 commit intomainfrom
bolt-remove-redundant-call-8645823406996589605
Closed

⚡ Bolt: Remove redundant API call to list folders#99
google-labs-jules[bot] wants to merge 1 commit intomainfrom
bolt-remove-redundant-call-8645823406996589605

Conversation

@google-labs-jules
Copy link

💡 What: Modified sync_profile to track existing folders locally after initial fetch and deletion, and pass this map to get_all_existing_rules.
🎯 Why: get_all_existing_rules was calling list_existing_folders (GET /groups) which was already called in sync_profile. This redundancy wasted an API call and network round-trip.
📊 Impact: Reduces total API calls by 1 per profile.
🔬 Measurement: Verified with a test script reproduce_issue.py (and test_fix.py) that the number of calls to /groups endpoint reduced from 2 to 1. Correctness verified with main.py --dry-run.


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

Refactored `get_all_existing_rules` to accept `existing_folders_map`.
Updated `sync_profile` to maintain and pass the local folder state instead of re-fetching it.
This reduces the number of API calls per profile sync by 1.
@google-labs-jules
Copy link
Author

👋 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 Jan 13, 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.

return {}

def get_all_existing_rules(client: httpx.Client, profile_id: str) -> Set[str]:
def get_all_existing_rules(

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing function or method docstring Warning

Missing function or method docstring
return {}

def get_all_existing_rules(client: httpx.Client, profile_id: str) -> Set[str]:
def get_all_existing_rules(

Check warning

Code scanning / Pylint (reported by Codacy)

Missing function docstring Warning

Missing function docstring

def get_all_existing_rules(client: httpx.Client, profile_id: str) -> Set[str]:
def get_all_existing_rules(
client: httpx.Client,

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 get_all_existing_rules(
client: httpx.Client,
profile_id: str,
existing_folders_map: Optional[Dict[str, str]] = 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).
@abhimehro
Copy link
Owner

Superseded: API call optimizations already in main.

@abhimehro abhimehro closed this Jan 18, 2026
@google-labs-jules
Copy link
Author

Superseded: API call optimizations already in main.

Understood. Acknowledging that this work is now obsolete and stopping work on this task.

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