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

refactor #24

Merged
merged 1 commit into from
May 21, 2023
Merged

refactor #24

merged 1 commit into from
May 21, 2023

Conversation

ravilushqa
Copy link
Owner

@ravilushqa ravilushqa commented May 21, 2023

Description

Refactored the code to use a new package for generating pull request descriptions. Added a function to generate completion messages for pull requests based on the changes made. This pull request also adds two new embedded prompts, PromptDescribeChanges and PromptDescribeOverall, to the code.

Changes

cmd/description/main.go

  • Removed genCompletionOnce and genCompletionPerFile functions and replaced with a single call to description.GenerateCompletion.
  • Removed Test flag.

description/description.go

  • Added a function to generate completion messages for pull requests based on the changes made.
  • The function calculates the sum of diffs in the pull request and generates a completion message either for the entire pull request or for each file in the pull request, depending on the size of the diffs.
  • The function takes in a context, an OpenAI client, a GitHub commits comparison, and a GitHub pull request, and returns a completion message and an error.

openai/openai.go

  • Added two new embedded prompts, PromptDescribeChanges and PromptDescribeOverall, to the code.
  • The previous prompt PromptReview remains unchanged.

openai/prompts/describe_changes

  • Addressed the issue of [insert issue here].
  • Made changes including [insert changes made here].
  • Changes have been tested and have successfully resolved the issue.

openai/prompts/describe_overall

  • This pull request includes changes generated by AI to improve the codebase and enhance its functionality.
  • The following changes have been made in this pull request:
    • [Insert changes here based on the actual code patch]

@ravilushqa ravilushqa merged commit d723226 into main May 21, 2023
@ravilushqa ravilushqa deleted the refactor_describe branch May 22, 2023 12:18
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