Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add GetCommits endpoint for efficient multiple commits fetching #3529

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

marcsanmi
Copy link
Contributor

@marcsanmi marcsanmi commented Aug 29, 2024

This PR introduces a significant enhancement to the VCS service by adding a new endpoint for parallel fetching of multiple commits. This change improves performance and efficiency when retrieving commit information for multiple refs while maintaining full backwards compatibility

Key changes

  • Added a new GetCommits endpoint in the proto definition to handle multiple refs in a single request
  • Implemented a new getCommits function that fetches commits in parallel using goroutines and channels
  • Updated the service layer to handle partial successes and provide detailed logging for the new endpoint
  • Added comprehensive tests for the new functionality
  • Maintained the existing GetCommit endpoint for full backwards compatibility

Main benefits

  1. Reduced network overhead: The frontend can now request multiple commits in a single API call, significantly reducing the number of HTTP requests.
  2. Improved performance: Parallel fetching of commits leads to faster overall response times, especially when dealing with multiple refs.
  3. Better error handling: The service now provides detailed information about both successful and failed commit fetches.
  4. Backwards compatibility: Existing integrations using the GetCommit endpoint remain fully functional and unchanged.

Frontend impact

  • No breaking changes for existing frontend code
  • Frontend can update their code to use the new GetCommits endpoint to fetch multiple commits at once.

@marcsanmi marcsanmi requested a review from a team as a code owner August 29, 2024 09:30
api/vcs/v1/vcs.proto Outdated Show resolved Hide resolved
@marcsanmi marcsanmi force-pushed the update-get-commit-resolve-many-commits branch from 4124011 to caed0e6 Compare August 29, 2024 11:18
@marcsanmi marcsanmi requested a review from a team as a code owner August 29, 2024 11:18
@marcsanmi marcsanmi force-pushed the update-get-commit-resolve-many-commits branch from caed0e6 to 0e047d0 Compare August 29, 2024 11:22
@marcsanmi marcsanmi changed the title feat: implement parallel fetching of multiple commits in VCS service feat: add GetCommits endpoint for efficient multiple commits fetching Aug 29, 2024
Copy link
Collaborator

@kolesnikovae kolesnikovae left a comment

Choose a reason for hiding this comment

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

Awesome job, it looks great!

@marcsanmi marcsanmi merged commit 45c58c3 into main Aug 29, 2024
18 checks passed
@marcsanmi marcsanmi deleted the update-get-commit-resolve-many-commits branch August 29, 2024 15:08
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.

3 participants