Thanks for wanting to contribute to Cody! There are many ways to contribute, and we appreciate all of them!
First have a look at our existing issues. Try to find an issue, open or closed, that describes your problem, or a very similar one. If you can't find something related, then please open an issue.
Please try to include as much information as possible in your bug report.
Bugs are marked with the label T-bug
.
We welcome feature requests to fill gaps in workflows Cody currently covers, or to expand Cody to cover more workflows. Before opening a feature, try to find another issue that describes something similar to what you want. If you can't find something similar, then please open a new issue.
When opening a feature request, please try to include the following information:
- What do you want to do and how to you want Cody to help you do it?
- How do you think this can be added to Cody?
- What are some possible alternatives?
- What are some disadvantages?
Feature requests are marked with the label T-enhancement
.
For local development, Cody requires:
- Ruby
- Bundler
- Postgres 9.4+
- Node v8.4.0+
- Yarn 1.5.1+
- Redis
Run bundle install
to install the gem dependencies, and bin/yarn install
to
install the Javascript dependencies.
Copy the .env.sample
file to .env
and edit to replace the values there.
There are a lot of environment variables that Cody uses for different purposes. The following table tries to summarize them all.
Var | Description |
---|---|
CODY_GITHUB_ACCESS_TOKEN |
Regular personal access token |
CODY_GITHUB_INTEGRATION_IDENTIFIER |
GitHub App ID |
CODY_GITHUB_INTEGRATION_CLIENT_ID |
GitHub App OAuth client ID |
CODY_GITHUB_INTEGRATION_CLIENT_SECRET |
GitHub App OAuth client secret |
CODY_GITHUB_INTEGRATION_WEBHOOK_SECRET |
Webhook secret for webhooks received by the GitHub App |
CODY_GITHUB_PRIVATE_KEY |
Contents of the GitHub App .pem file |
CODY_GITHUB_PRIVATE_KEY_PATH |
Path to the GitHub App .pem file |
Historically, Cody used a personal access token to authenticate with the GitHub API.
Set up a personal access token for Cody by following these steps from the GitHub Help guide.
Cody uses a GitHub App to perform OAuth authorization of users.
-
For User authorization callback URL use
http://localhost:3000/auth/github/callback
, or whatever port you want to use to start the server. -
For Webhook URL use
http://localhost:3000/webhooks/integration
-
For Webhook secret generate a secret with
bin/rails secret
. Also place this secret in theCODY_GITHUB_INTEGRATION_WEBHOOK_SECRET
environment variable. -
Generate a private key for your App in the Private Key section and download the .pem file. Set one of:
CODY_GITHUB_PRIVATE_KEY
to the contents of the .pem file- or,
CODY_GITHUB_PRIVATE_KEY_PATH
to the path to the .pem file
These two variables are mutually exclusive, and
CODY_GITHUB_PRIVATE_KEY
takes precedence. -
Copy the ID in the right-hand sidebar into the
CODY_GITHUB_INTEGRATION_IDENTIFIER
environment variable. -
Copy the credentials from the OAuth credentials section into the corresponding environment variables.
Run bin/rails s
to start the Rails server.
Run bin/webpack-dev-server --hot
to compile all the Webpack assets and start
the Webpack dev server.
Run bin/sidekiq
to start the Sidekiq background worker.
- Fork the repository
- Checkout a new branch
- Make your changes
- Write tests
- Push your branch to your fork
- Open a Pull Request
For Ruby code, we use RuboCop to check style and other details. Please run RuboCop on your code before submitting Pull Requests. RuboCop also runs on every PR to report any warnings found.
For Javscript code, in addition to ESLint, we also use Prettier to format code. ESLint runs on Pull Requests to report problems.
We generally will not accept PRs from contributors with any lint problems, so please run the linters yourself!