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

ci: add openai to review the code #2511

Merged
merged 1 commit into from
Mar 17, 2023
Merged

ci: add openai to review the code #2511

merged 1 commit into from
Mar 17, 2023

Conversation

oilbeater
Copy link
Collaborator

What type of this PR

Examples of user facing changes:

  • CI

Which issue(s) this PR fixes:

Fixes #(issue-number)

@github-actions
Copy link
Contributor

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

1 similar comment
@github-actions
Copy link
Contributor

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: gpt-3.5-turbo
top_p: 1
temperature: 0.1 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

This code patch appears to be a GitHub Actions workflow file that triggers on pull request events and runs a job named "test" on an Ubuntu environment. The job uses the oilbeater/ChatGPT-CodeReview action, which likely performs some kind of code review using OpenAI's GPT-3 language model.

As for potential improvements, it would be helpful to include more information in the name field of the workflow file, such as the repository or project name. Additionally, it may be useful to add more steps to the job, such as running tests or linters, before invoking the code review action. Finally, it's worth noting that the use of third-party actions like oilbeater/ChatGPT-CodeReview carries some risk, so it's important to thoroughly vet any external dependencies before including them in a workflow.

OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MODEL: gpt-3.5-turbo
top_p: 1
temperature: 0.1 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

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

This code patch appears to be a GitHub Actions workflow file for performing code reviews using the ChatGPT language model from OpenAI. Here are some observations and suggestions:

  • The name field is not necessary, but it can be helpful for identifying the workflow in the Actions tab of the repository.
  • The permissions field is not necessary unless you want to restrict access to the workflow.
  • The on field specifies that the workflow should run on pull requests targeting the master branch or any branch starting with release-, but ignoring changes to files in the docs/ directory or any Markdown files. This seems reasonable, but you may want to adjust the branch names depending on your project's branching strategy.
  • The jobs field defines a single job called code-review that runs on an Ubuntu environment. The job consists of a single step that uses the oilbeater/ChatGPT-CodeReview action to perform the code review. The action requires several environment variables to be set, including the GitHub token and the OpenAI API key. The MODEL, top_p, and temperature variables control the behavior of the language model. These values seem reasonable, but you may want to experiment with different settings to see what works best for your project.
  • There is no newline at the end of the file, which may cause issues with some tools.

Overall, this code patch looks reasonable, but it's hard to say for sure without knowing more about the project and its requirements. Some potential improvements might include adding additional steps to the job (e.g., running linters or other static analysis tools), customizing the behavior of the ChatGPT action (e.g., by passing additional arguments), or adding more granular control over when the workflow runs (e.g., by using the schedule or workflow_dispatch events).

@oilbeater oilbeater merged commit 089d8cd into master Mar 17, 2023
@oilbeater oilbeater deleted the ci/code-review branch March 17, 2023 09:03
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