diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 16811904..1cb52377 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,6 +21,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents - [Reporting Bugs](#reporting-bugs) - [Suggesting Enhancements](#suggesting-enhancements) - [Your First Code Contribution](#your-first-code-contribution) +- [Reviewing Copilot PRs](#reviewing-copilot-prs) - [Styleguides](#styleguides) @@ -164,6 +165,10 @@ When creating a PR, please include as much context as possible. At minimum, this If your PR is a work in progress, please label it as a draft and include 'WIP' at the beginning of the PR title. +#### Reviewing Copilot PRs + +For guidance on how to review pull requests that were authored by GitHub Copilot, please refer to our [Reviewing Copilot PRs](./docs/REVIEWING_COPILOT_PR.md) guide. + diff --git a/docs/REVIEWING_COPILOT_PR.md b/docs/REVIEWING_COPILOT_PR.md new file mode 100644 index 00000000..d287f3ec --- /dev/null +++ b/docs/REVIEWING_COPILOT_PR.md @@ -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 +``` + +### 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/) \ No newline at end of file