Skip to content

Commit

Permalink
Refactor AICodeBot CLI testing and configuration
Browse files Browse the repository at this point in the history
In an effort to streamline the process and improve the efficiency of our code, the CLI testing and configuration in `aicodebot_action.py` have been refactored. The CLI testing has been moved to an earlier stage in the script, ensuring that it is executed before the code review process begins. Additionally, the configuration of the aicodebot has been updated to use the OPENAI_API_KEY. This change should enhance the overall performance and reliability of the AICodeBot.
  • Loading branch information
TechNickAI committed Jul 13, 2023
1 parent f076378 commit 38a3029
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions aicodebot_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@
# Set up the git configuration. Allow the user to override the safe directory
subprocess.run(["git", "config", "--global", "--add", "safe.directory", "/github/workspace"])

# Test the CLI
cli_runner = CliRunner()
result = cli_runner.invoke(cli, ["-V"])
print("AICodeBot version:", result.output)
assert result.exit_code == 0

# ---------------------------------------------------------------------------- #
# Run the code review #
# ---------------------------------------------------------------------------- #

# Set up the aicodebot configuration from the OPENAI_API_KEY
cli_runner = CliRunner()
result = cli_runner.invoke(cli, ["-V"])
print("AICodeBot version:", result.output)
result = cli_runner.invoke(cli, ["configure", "--openai-api-key", openai_api_key])
assert result.exit_code == 0

# Run a code review on the current commit
Expand Down

0 comments on commit 38a3029

Please sign in to comment.