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

Added ChatGPT-CodeReview workflow #649

Merged
merged 2 commits into from
Apr 6, 2023
Merged

Added ChatGPT-CodeReview workflow #649

merged 2 commits into from
Apr 6, 2023

Conversation

Olshansk
Copy link
Member

@Olshansk Olshansk commented Apr 4, 2023

As seen on https://github.com/anc95/ChatGPT-CodeReview.

Triggered by adding the gpt review label so its not too expensive and doesn't run every time.

@Olshansk Olshansk added documentation Improvements or additions to documentation gpt review Triggers a code review from https://github.com/anc95/ChatGPT-CodeReview labels Apr 4, 2023
@Olshansk Olshansk requested a review from dylanlott April 4, 2023 18:22
@Olshansk Olshansk self-assigned this Apr 4, 2023
@cr-gpt
Copy link

cr-gpt bot commented Apr 4, 2023

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

@reviewpad
Copy link

reviewpad bot commented Apr 4, 2023

AI-Generated Pull Request Summary: This pull request adds a new GitHub Workflow called "GPT Review". The workflow is triggered when a pull request is opened, reopened, or synchronized, and only runs if the pull request contains a label with the name "gpt review". It uses the ChatGPT-CodeReview action with the GPT-4 model to perform automated code reviews in the English language, utilizing the GitHub and OpenAI API keys for authentication.

LANGUAGE: English
MODEL: gpt-4
# top_p: 1
# temperature: 1
Copy link

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 for an automated GPT-based code review. Here's a brief overview of the code and potential improvements:

  1. Naming: The name 'GPT Review' for the action is suitable, but consider providing a more informative, specific name if needed.

  2. Events: The action is triggered when pull requests are opened, reopened or synchronized. This configuration is suitable for most use cases.

  3. Condition: The action will only run when there is a label "gpt review" present in the event. This is a reasonable condition to avoid running actions unnecessarily.

  4. Action Environment: It runs using 'ubuntu-latest', which should work for most scenarios.

  5. Custom Action: The custom action used is 'anc95/ChatGPT-CodeReview@main'. Ensure that this repository is maintained and updated.

  6. API Keys: Make sure you have set up the required GitHub and OpenAI API keys in your secrets. Be cautious with sharing these keys and never expose them in public repositories. Also, revise the secret name you pass as OPENAI_API_KEY (it currently says OPENAI_API_KEY_OLSHANSKY, you might want it to be more generic).

  7. Optional Settings: Currently, the optional settings LANGUAGE, MODEL, top_p, and temperature are commented out. Uncomment and set desired values if needed.

Potential improvements:

  1. Use a specific version of the custom action (e.g., 'anc95/ChatGPT-CodeReview@v1.0') instead of 'main' for consistent behavior.

  2. For better security, don't use branch names in context expressions (github.event.*.labels.*.name). Instead, directly reference the github.event.pull_request.labels variable.

Overall, the code looks good and follows standard practices for a GitHub action. Just consider the suggested improvements to enhance its reliability and security.

Copy link
Contributor

Choose a reason for hiding this comment

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

With how young this package is, I suspect that version changes will be frequent. Do we want to ride on main and accept the bumps or pin to a version?

@reviewpad
Copy link

reviewpad bot commented Apr 4, 2023

Reviewpad Report

⚠️ Warnings

  • Please link an issue to the pull request

Copy link
Contributor

@dylanlott dylanlott left a comment

Choose a reason for hiding this comment

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

No showstoppers, approving for now.

LANGUAGE: English
MODEL: gpt-4
# top_p: 1
# temperature: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

With how young this package is, I suspect that version changes will be frequent. Do we want to ride on main and accept the bumps or pin to a version?

@reviewpad reviewpad bot requested a review from h5law April 4, 2023 19:55
@h5law
Copy link
Contributor

h5law commented Apr 4, 2023

This is so cool.

@cr-gpt
Copy link

cr-gpt bot commented Apr 6, 2023

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

@Olshansk
Copy link
Member Author

Olshansk commented Apr 6, 2023

@dylanlott I updated the first suggestion but think we should ride on main as this thing is really new and I expect it to be improving quickly

@reviewpad
Copy link

reviewpad bot commented Apr 6, 2023

AI-Generated Summary: This pull request consists of two patches:

  1. The first patch adds a new GitHub workflow called "GPT Review" which is triggered by pull requests with the "gpt review" label. It sets up the necessary permissions, and specifies the environment variables needed for the ChatGPT-CodeReview action. Additionally, it includes some optional parameters such as the language, model, and advanced settings for GPT.

  2. The second patch modifies the workflow by updating the condition to only use the labels of pull requests instead of all events. This ensures the GPT Review workflow is only triggered when the 'gpt review' label is present on pull requests.

@Olshansk Olshansk removed waiting-for-review gpt review Triggers a code review from https://github.com/anc95/ChatGPT-CodeReview labels Apr 6, 2023
@Olshansk Olshansk merged commit 336cbf2 into main Apr 6, 2023
@Olshansk Olshansk deleted the gpt_review branch April 6, 2023 18:45
bryanchriswhite added a commit that referenced this pull request Apr 10, 2023
* pokt/main:
  [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622)
  [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652)
  [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654)
  [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533)
  Update reviewpad.yml
  Added ChatGPT-CodeReview workflow (#649)
  Update reviewpad.yml
  Added default reviewpad.yml file (#648)
  [DevNet] tweaks for remote environments (#601)
  [Documentation] Swap validator and non-validator triggers when finished synching (#646)
  [Consensus] Configuration entry point state sync (#528)
bryanchriswhite added a commit to bryanchriswhite/pocket that referenced this pull request Apr 10, 2023
…p-modules

* pokt/main:
  [Utility][RPC][CLI] Querying governance parameters (Issue pokt-network#619) (pokt-network#622)
  [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue pokt-network#508 (pokt-network#652)
  [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (pokt-network#654)
  [PERSISTENCE] SavePoints and Rollbacks design document (Issue pokt-network#493) (pokt-network#533)
  Update reviewpad.yml
  Added ChatGPT-CodeReview workflow (pokt-network#649)
  Update reviewpad.yml
  Added default reviewpad.yml file (pokt-network#648)
  [DevNet] tweaks for remote environments (pokt-network#601)
  [Documentation] Swap validator and non-validator triggers when finished synching (pokt-network#646)
  [Consensus] Configuration entry point state sync (pokt-network#528)
bryanchriswhite added a commit that referenced this pull request Apr 12, 2023
…p-modules

* pokt/main:
  update pocket repo read.me (#667)
  Update reviewpad.yml
  [KEYBASE] Add improve comment on keybase config (#665)
  [E2E] Chore: Doc updates (#663)
  [E2E] Adds staking, unstaking, and sending tests (#653)
  [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622)
  [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652)
  [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654)
  [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533)
  Update reviewpad.yml
  Added ChatGPT-CodeReview workflow (#649)
  Update reviewpad.yml
  Added default reviewpad.yml file (#648)
  [DevNet] tweaks for remote environments (#601)
  [Documentation] Swap validator and non-validator triggers when finished synching (#646)
  [Consensus] Configuration entry point state sync (#528)
bryanchriswhite added a commit that referenced this pull request Apr 12, 2023
…p-modules

* pokt/main:
  update pocket repo read.me (#667)
  Update reviewpad.yml
  [KEYBASE] Add improve comment on keybase config (#665)
  [E2E] Chore: Doc updates (#663)
  [E2E] Adds staking, unstaking, and sending tests (#653)
  [Utility][RPC][CLI] Querying governance parameters (Issue #619) (#622)
  [Persistence][Utility] Separate all CreateAndApply functions into more functional components - Issue #508 (#652)
  [Persistence][Utility] Pools Address hack removal + state accessor fix for params and flags (#654)
  [PERSISTENCE] SavePoints and Rollbacks design document (Issue #493) (#533)
  Update reviewpad.yml
  Added ChatGPT-CodeReview workflow (#649)
  Update reviewpad.yml
  Added default reviewpad.yml file (#648)
  [DevNet] tweaks for remote environments (#601)
  [Documentation] Swap validator and non-validator triggers when finished synching (#646)
  [Consensus] Configuration entry point state sync (#528)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants