⚡ Bolt: Remove redundant API call to list folders#99
⚡ Bolt: Remove redundant API call to list folders#99google-labs-jules[bot] wants to merge 1 commit intomainfrom
Conversation
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.
|
👋 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
|
| 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
|
|
||
| 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
| 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
|
Superseded: API call optimizations already in main. |
Understood. Acknowledging that this work is now obsolete and stopping work on this task. |
💡 What: Modified
sync_profileto track existing folders locally after initial fetch and deletion, and pass this map toget_all_existing_rules.🎯 Why:
get_all_existing_ruleswas callinglist_existing_folders(GET /groups) which was already called insync_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(andtest_fix.py) that the number of calls to/groupsendpoint reduced from 2 to 1. Correctness verified withmain.py --dry-run.PR created automatically by Jules for task 8645823406996589605 started by @abhimehro