⚡ Bolt: parallelize activity fetching and optimize date comparisons#60
⚡ Bolt: parallelize activity fetching and optimize date comparisons#60Jobayer-c8 wants to merge 1 commit into
Conversation
This commit optimizes the Daily Activity Report workflow by parallelizing independent API calls and using direct string comparison for date filtering. - Parallelized `listCommits`, `pulls.list`, and `listForRepo` calls. - Replaced `new Date(p.merged_at) >= new Date(since)` with `p.merged_at >= since`. - Updated documentation in `daily-activity-report.md`. - Initialized Bolt performance journal in `.jules/bolt.md`. Co-authored-by: Jobayer-c8 <290884056+Jobayer-c8@users.noreply.github.com>
|
👋 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. |
There was a problem hiding this comment.
Code Review
This pull request adds a documentation entry in .jules/bolt.md detailing learnings about parallel API fetching and direct string comparison for ISO 8601 dates. The review feedback correctly notes that lexicographical string comparison of ISO 8601 dates can be unsafe without normalizing the format and precision of both timestamps first.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| @@ -0,0 +1,3 @@ | |||
| ## 2025-05-14 - Parallel API Fetching in GitHub Scripts | |||
| **Learning:** Parallelizing independent GitHub API calls using 'Promise.all' in 'actions/github-script' significantly reduces workflow execution time. Direct string comparison for ISO 8601 dates (e.g., 'p.merged_at >= since') is more efficient than instantiating 'new Date()' objects inside filter loops. | |||
There was a problem hiding this comment.
While lexicographical string comparison of ISO 8601 dates is indeed more efficient than instantiating Date objects, it is only safe if both timestamps are guaranteed to have the exact same format and precision.
For example, if one string contains milliseconds and the other does not, lexicographical comparison can yield incorrect results because . (ASCII 46) is sorted before Z (ASCII 90):
"2023-10-27T10:00:00.000Z" < "2023-10-27T10:00:00Z" evaluates to true even though they represent the same instant.
Additionally, if either string has a different timezone offset (e.g., +01:00 vs Z), the comparison will be incorrect. It is recommended to normalize both strings to the same format (e.g., both UTC with/without milliseconds) before performing direct string comparisons.
💡 What:
Parallelized independent GitHub API calls (commits, pulls, issues) using
Promise.allin thedaily-activity-report.lock.ymlworkflow. Optimized the pull request filtering logic by replacingnew Date()instantiation with direct ISO 8601 string comparison. Updated.github/workflows/daily-activity-report.mdto reflect these changes and added a performance journal entry in.jules/bolt.md.🎯 Why:
The previous implementation performed API calls sequentially, causing unnecessary delay in the workflow execution. Additionally, it instantiated a
new Date()object for every pull request in the filter loop, which is inefficient compared to direct string comparison for standardized timestamps.📊 Impact:
Dateobject creations.🔬 Measurement:
node --checkon an extracted version of the script with appropriate mocks.PR created automatically by Jules for task 11683754003691615724 started by @Jobayer-c8