Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

use octokit throttling plugin instead of retry plugin #192

Merged
merged 4 commits into from
Apr 18, 2023
Merged

Conversation

harjotgill
Copy link
Contributor

@harjotgill harjotgill commented Apr 18, 2023

Summary by OpenAI

Release Notes

  • Refactor: Replaces the retry plugin with the throttling plugin to improve performance and reliability of GitHub API requests. Simplifies logic for posting review comments, adds support for start_line, and improves error handling and modularity.

"Retry no more, throttling galore! Code simplified, errors no more.
Performance improved, modularity soared. Celebrate this PR, we've scored!"

@github-actions
Copy link
Contributor

github-actions bot commented Apr 18, 2023

🤖 OpenAI

High-level Summary

The changes in this pull request replace the retry plugin with the throttling plugin from @octokit/plugin-throttling to improve the performance and reliability of the GitHub API requests. The code also simplifies the logic for posting review comments, adds support for start_line, and improves error handling and modularity. Additionally, the code retrieves the token from the environment instead of using a hardcoded value.

Files Summary

File Summary
package.json Replaces the "@octokit/plugin-retry" dependency with "@octokit/plugin-throttling" in the "package.json" file.
src/commenter.ts Replaces the retry plugin with the throttling plugin in the octokit instance and simplifies the logic for posting review comments by removing batching and adding support for start_line.
src/octokit.ts Imports the throttling plugin from @octokit/plugin-throttling and uses it to create a new Octokit instance with token authentication. The retry plugin is no longer used.
src/review-comment.ts Removes the import of the retry plugin and replaces the octokit instance creation with an import from a separate file. The handleReviewComment function handles pull request review comments, checks if the comment was created and not edited or deleted, and replies to the comment with a summary of the PR.
src/review.ts Removes the retry plugin import and replaces it with a custom octokit instance that uses the throttling plugin. It also removes the token variable and instead retrieves the token from the environment.

Chat with 🤖 OpenAI Bot (@openai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @openai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Files ignored due to filter (1)

Ignored files

  • dist/index.js
Files not summarized due to errors (1)

Failed to summarize

  • package-lock.json (diff tokens exceeds limit)

@harjotgill harjotgill merged commit b78b1ab into main Apr 18, 2023
@harjotgill harjotgill deleted the timeout branch April 18, 2023 19:08
shoyuf pushed a commit to maybeLab/openai-mr-reviewer-gltlab that referenced this pull request Jun 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant