Skip to content

Commit

Permalink
add contribution.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Stanga committed Nov 24, 2024
1 parent 10ab72b commit 382f1b4
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copy this file to .env and set the variables
# The variables are only used when running locally

# REQUIRED: Set this as your Github personal access token
GITHUB_TOKEN=

# REQUIRED: LLM API
LLM_API_KEY= # API key from your LLM provider (ie Anthropic, Google, OpenAI)
LLM_MODEL= # Model name from your LLM provider (ie claude-3-5-sonnet-20241022, gemini-1.5-flash-latest, gpt-4o-mini)

# Simulate a Pull Request open event
GITHUB_ACTION=ai-reviewer
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_ACTION=created
GITHUB_REPOSITORY=presubmit/ai-reviewer # update with your fork
GITHUB_PULL_REQUEST=1 # update with your pull request number
GITHUB_COMMENT_ID=1111111 # update with your comment id

# Simulate a Pull Request review comment event
# GITHUB_ACTION=ai-reviewer
# GITHUB_EVENT_NAME=pull_request_review_comment
# GITHUB_EVENT_ACTION=created
# GITHUB_REPOSITORY=presubmit/ai-reviewer # update with your fork
# GITHUB_PULL_REQUEST=1 # update with your pull request number
# GITHUB_COMMENT_ID=1111111 # update with your comment id
76 changes: 76 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributing to AI PR Reviewer

Thank you for your interest in contributing to AI PR Reviewer! This document provides guidelines and instructions for contributing to the project.

## Getting Started

1. Fork the repository
2. Clone your fork locally
3. Install dependencies with `pnpm install`
4. Create a new branch for your feature/fix: `git checkout -b feature-name`

## Development Setup

### Prerequisites

- Node.js (LTS version recommended) + Typescript
- [Github personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
- LLM API key from OpenAI, Anthropic or GoogleAI
- (recommended) pnpm package manager

## Development Workflow

1. Make your changes in a feature branch
2. Commit your changes using conventional commits:
- `feat: add new feature`
- `fix: resolve bug`
- `docs: update documentation`
- `test: add tests`
- `refactor: improve code structure`
3. Open Pull Request against main repo

## Testing

1. Copy the `.env.example` file to `.env`:

```bash
cp .env.example .env
```

2. Configure your environment variables in `.env`:

```env
# Required: Choose your AI provider
AI_PROVIDER=anthropic # or openai
# Required: Set your API key and model based on the chosen provider
LLM_API_KEY=...
LLM_MODEL=...
# Required: Github personal access token
GITHUB_TOKEN=...
```

And uncomment one of the events that you want to test: `pull_request` or `pull_request_review_comment`

3. Run `pnpm dev` to test the updated reviewer in the Pull Request specied in .env

## Pull Request Process

1. Update the README.md with details of significant changes if applicable
2. Ensure your PR description clearly describes the problem and solution
3. Link any related issues using GitHub keywords (e.g., "Fixes #123")
4. Make sure all checks pass on your PR
5. Request review from maintainers

## Questions or Need Help?

- Open an issue for questions
- Join our community discussions
- Reach out on [X/Twitter](https://x.com/bdstanga)

## License

By contributing to AI PR Reviewer, you agree that your contributions will be licensed under the same license as the project.

Thank you for contributing to make AI PR Reviewer better! 🚀

0 comments on commit 382f1b4

Please sign in to comment.