Skip to content

⚡ Bolt: parallelize activity fetching and optimize date comparisons#60

Draft
Jobayer-c8 wants to merge 1 commit into
mainfrom
bolt-parallel-activity-report-11683754003691615724
Draft

⚡ Bolt: parallelize activity fetching and optimize date comparisons#60
Jobayer-c8 wants to merge 1 commit into
mainfrom
bolt-parallel-activity-report-11683754003691615724

Conversation

@Jobayer-c8

Copy link
Copy Markdown
Owner

💡 What:
Parallelized independent GitHub API calls (commits, pulls, issues) using Promise.all in the daily-activity-report.lock.yml workflow. Optimized the pull request filtering logic by replacing new Date() instantiation with direct ISO 8601 string comparison. Updated .github/workflows/daily-activity-report.md to 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:

  • Reduces total script execution time by approximately 66% for the data fetching phase (assuming equal response times for the three API calls).
  • Decreases memory overhead and CPU cycles by avoiding redundant Date object creations.

🔬 Measurement:

  • Workflow logs will show a significantly shorter duration for the "Gather recent activity and create issue" step.
  • The syntax was verified using node --check on an extracted version of the script with appropriate mocks.

PR created automatically by Jules for task 11683754003691615724 started by @Jobayer-c8

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>
@google-labs-jules

Copy link
Copy Markdown

👋 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.

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

Copy link
Copy Markdown

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 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.

Comment thread .jules/bolt.md
@@ -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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant