-
Notifications
You must be signed in to change notification settings - Fork 22
Add documentation for reviewing GitHub Copilot authored PRs #263
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
Open
Copilot
wants to merge
3
commits into
main
Choose a base branch
from
copilot/fix-262
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # Reviewing GitHub Copilot Authored Pull Requests | ||
|
|
||
| This guide explains how to review pull requests that have been authored by GitHub Copilot. GitHub Copilot is an AI pair programmer that can help you write code faster and with fewer errors. It can also be assigned to issues to implement solutions and submit pull requests for review. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Before you begin reviewing a Copilot-authored PR, ensure you have: | ||
|
|
||
| - A GitHub account with permissions to review PRs in the repository | ||
| - Basic familiarity with Git and GitHub PR workflow | ||
| - Basic understanding of the Innovation Engine project structure | ||
|
|
||
| ## Step-by-Step Guide | ||
|
|
||
| ### 1. Opening the PR and Starting the Review | ||
|
|
||
| 1. Navigate to the Pull Requests tab in the repository | ||
| 2. Locate the PR created by GitHub Copilot (usually with "Copilot" as the author) | ||
| 3. Click on the PR title to open it | ||
| 4. Read through the PR description to understand what changes Copilot has made | ||
| 5. Review the "Files changed" tab to get an overview of which files were modified | ||
|
|
||
| ### 2. Using GitHub Codespaces for Review | ||
|
|
||
| GitHub Codespaces provides a complete, configurable dev environment directly within GitHub, making it ideal for reviewing PRs: | ||
|
|
||
| 1. From the PR page, click on the "Code" dropdown button | ||
| 2. Select "Review in codespace" option | ||
| 3. Wait for the codespace to be created and initialized | ||
| 4. Once the codespace is ready, you'll have a full VS Code environment in your browser | ||
|
|
||
| ### 3. Setting Up the Environment | ||
|
|
||
| If you plan to run test scripts that include Azure CLI commands, you'll need to install the Azure CLI. Note that many test scenarios can be run without this dependency: | ||
|
|
||
| ```bash | ||
| # Install Azure CLI | ||
| curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | ||
| ``` | ||
|
|
||
| Verify the installation: | ||
|
|
||
| ```bash | ||
| az --version | ||
| ``` | ||
|
|
||
| If you installed the Azure CLI and need to use it for testing, you'll need to login: | ||
|
|
||
| ```bash | ||
| # Login to Azure using device code authentication | ||
| az login --use-device-code | ||
| ``` | ||
|
|
||
| ### 4. Building Innovation Engine | ||
|
|
||
| Build the Innovation Engine using the make command: | ||
|
|
||
| ```bash | ||
| # Build the Innovation Engine CLI | ||
| make build-ie | ||
| ``` | ||
|
|
||
| This will compile the Innovation Engine binary to `bin/ie`. | ||
|
|
||
| ### 5. Running Tests | ||
|
|
||
| Once the build completes successfully, run the tests to ensure the changes don't introduce regression issues: | ||
|
|
||
| ```bash | ||
| # Run all tests | ||
| make test-all | ||
| ``` | ||
|
|
||
| For more targeted testing, you can run specific tests: | ||
|
|
||
| ```bash | ||
| # For example, to test a specific scenario | ||
| ./bin/ie test <specific-scenario-path> | ||
| ``` | ||
|
|
||
| ### 6. Verifying the Changes | ||
|
|
||
| After building and testing: | ||
|
|
||
| 1. Verify that the changes implemented by Copilot match the requirements specified in the issue | ||
| 2. Check if the code style is consistent with the rest of the codebase | ||
| 3. Ensure the changes are minimal and focused on the specific issue | ||
| 4. Verify that documentation is updated if necessary | ||
|
|
||
| ### 7. Providing Feedback | ||
|
|
||
| If you've found issues or have suggestions: | ||
|
|
||
| 1. Go to the "Files changed" tab | ||
| 2. Click on the line number where you want to comment | ||
| 3. Add your feedback or suggestion | ||
| 4. Once you've reviewed everything, click "Review changes" at the top right | ||
| 5. Choose "Comment", "Approve", or "Request changes" based on your assessment | ||
| 6. Submit your review | ||
|
|
||
| ## Best Practices for Reviewing Copilot PRs | ||
|
|
||
| When reviewing PRs authored by Copilot, keep the following in mind: | ||
|
|
||
| - **Look for edge cases**: AI might miss unusual scenarios that human developers would consider | ||
| - **Check for security considerations**: Verify that the changes don't introduce security vulnerabilities | ||
| - **Verify testing coverage**: Ensure that Copilot has added or updated tests as needed | ||
| - **Review documentation updates**: Check if documentation has been properly updated to reflect code changes | ||
| - **Verify code style consistency**: Make sure the changes follow the project's coding style guidelines | ||
|
|
||
| ## Common Issues with Copilot-Authored PRs | ||
|
|
||
| - Boilerplate or redundant code | ||
| - Overly complex solutions for simple problems | ||
| - Missing edge case handling | ||
| - Incomplete test coverage | ||
| - Code that doesn't follow project conventions | ||
|
|
||
| ## References | ||
|
|
||
| - [GitHub Codespaces Documentation](https://docs.github.com/en/codespaces) | ||
| - [Innovation Engine Contribution Guide](https://github.com/Azure/InnovationEngine/blob/main/CONTRIBUTING.md) | ||
| - [Azure CLI Documentation](https://docs.microsoft.com/en-us/cli/azure/) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.