Skip to content

Implement generate_commit_message_parallel main function #84

@oleander

Description

@oleander

Task

Create the main entry point function generate_commit_message_parallel in src/multi_step_integration.rs that coordinates the two-phase parallel processing approach.

Requirements

  • Accept OpenAI client reference, model string, diff content, and optional max message length
  • Return Result with final commit message
  • Call corrected parse_diff function to extract individual files
  • Construct vector of futures for parallel file analysis
  • Use join_all from futures crate to execute analyses concurrently
  • Graceful error handling:
    • Log warnings for failed individual analyses
    • Continue with successful results
    • Only fail if no analyses succeed
  • Format successful results into readable enumeration
  • Construct synthesis prompt with file summaries
  • Send synthesis request as simple completion (no function calling)
  • Extract and return final commit message
  • Instrument with profile! macro for performance measurement

Success Criteria

  • Demonstrates measurable performance improvements:
    • Single file: ~4 seconds (down from 4.58s)
    • Five files: ~4.3 seconds (vs ~16s sequential)
  • Resilient to individual file analysis failures
  • Works correctly for commits ranging from 1 to dozens of files

Part of #81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions