From 83ab85fb04e49ab323923e97a9834cbbffc356ef Mon Sep 17 00:00:00 2001 From: Shahidh K Muhammed Date: Wed, 11 Jul 2018 10:27:03 +0530 Subject: [PATCH] update readme and contributing guides (#90) --- CONTRIBUTING.md | 20 ++++++++++++++++++++ README.md | 12 ++++++++++++ cli/CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++-- server/CONTRIBUTING.md | 3 +++ 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 server/CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..6cd68930114 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,20 @@ +# Contributing + +[hasura/graphql-engine](https://github.com/hasura/graphql-engine) is a mono-repo consisting of 3 components. Each have their own contributing guides: + +1. [Server (Haskell)](server/CONTRIBUTING.md) +2. [CLI (Go)](cli/CONTRIBUTING.md) +3. [Console (JavaScript)](console/CONTRIBUTING.md) + +All of the three components have a single version, denoted by either the git tag or a combination of branch name and git commit sha. + +## Common guidelines + +- Please make sure there is an issue associated with the work the work you're doing. +- If you're working on an issue, please comment that you are doing so to prevent duplicate work by others also. +- Squash your commits and refer to the issue using `fix #` or `close #` in the commit message. +- Commit messages: + - Please keep the it under 100 characters. This allows the message to be easier to read on github as well as in various git tools and produces a nice, neat commit log + - Use the imperative present tense: "change" not "changed" nor "changes" + - Don't capitalize the first letter + - Do not add a dot (.) at the end \ No newline at end of file diff --git a/README.md b/README.md index cc72c3ea849..302e7aaeafd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # Hasura GraphQL Engine +[![CircleCI](https://circleci.com/gh/hasura/graphql-engine.svg?style=svg)](https://circleci.com/gh/hasura/graphql-engine) + Source code for Hasura's GraphQL Engine, including CLI, API Console and Server. + +## Getting started + +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/hasura/graphql-engine-heroku) + +Follow the [official docs](https://docs.hasura.io/1.0/graphql/manual/getting-started/index.html). + +## Contributing + +Checkout our [contributing guide](CONTRIBUTING.md) for more details. \ No newline at end of file diff --git a/cli/CONTRIBUTING.md b/cli/CONTRIBUTING.md index 8c5ed343d9a..606917b94bc 100644 --- a/cli/CONTRIBUTING.md +++ b/cli/CONTRIBUTING.md @@ -1,17 +1,27 @@ # Contributing +Thanks for you interest in Hasura GraphQL Engine CLI. + +## Pre-requisites + +- [Go 1.10](https://golang.org/doc/install) +- [GNU Make](https://www.gnu.org/software/make/) + + You can follow your existing Golang workflow to fork, work on a branch and submit PR. If you're new to forking and working on Golang repositories, please -follow the instructions below to make sure the import paths are correct. +follow the instructions below to make sure the import paths are correct: -- Fork the repo +- Fork the repo on GitHub - `mkdir -p $GOPATH/src/github.com/hasura` - `cd $GOPATH/src/github.com/hasura` - `git clone https://github.com//graphql-engine` - `cd graphql-engine` - `git remote add upstream https://github.com/hasura/graphql-engine` - `git checkout -b ` +- `make deps` - Work on the feature/fix +- If you modify files in `assets/`, run `make assets` - Add tests and ensure all tests are passing (`make test`) - Commit, push and submit PR @@ -32,3 +42,24 @@ workflow. The `.realize.yaml` config is already included in the repo. `realize` watches the directory for changes and rebuilds the cli whenever a new change happens. The cli is installed to `$GOPATH/bin/hasura`, which should already be in your `PATH`. The config is located at `.realize/realize.yaml`. + +## Tests + +When you're adding a new feature, it is encouraged to add integration tests (unit tests also if possible) for the functions/api. You should run all the test and make sure everything passes before submitting the PR. + +The tests expect a GraphQL Engine server instance to be running. You can point the tests to any GraphQL Engine server but please note that **the database should be empty**. The easiest way to do this is to run an Postgres and GraphQL Engine using [Docker Compose](https://github.com/hasura/graphql-engine-install-manifests). Once the server is running, you can run the tests by executing the make command: + +```bash +HASURA_GRAPHQL_TEST_ENDPOINT=http://localhost:8080 make test +``` + +## Builds + +To build a binary, execute the following command: + +```bash +# make deps to install all go packages +make build +``` + +This will output cross-platform binaries to `_output` directory. \ No newline at end of file diff --git a/server/CONTRIBUTING.md b/server/CONTRIBUTING.md new file mode 100644 index 00000000000..0e28ebda276 --- /dev/null +++ b/server/CONTRIBUTING.md @@ -0,0 +1,3 @@ +# Contributing + +TODO \ No newline at end of file