graphql-engine/v3/CONTRIBUTING.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

81 lines
2.4 KiB
Markdown
Raw Normal View History

# V3 Contributing Guide
## Getting Started
### Using Docker
Start a development container (which includes NDC agents for testing):
```
docker compose run --build --rm dev_setup bash
```
### Without Docker
You will need to install some packages:
- The Rust compiler
- `protobuf-compiler`
For development, you may need to install some additional tools such as
`nextest`. See the [Dockerfile](Dockerfile).
### Building the source
If the dependencies are correctly installed as above, you should now be able to
run
```
cargo build
```
From here, you can follow the instructions in <README.md> to set up a working
server.
## Installing project dependencies with Nix
We maintain a [Nix Flake](flake.nix) that will install all of the project
dependencies required to work on `v3-engine`.
To use it:
1. [Install Nix](https://github.com/DeterminateSystems/nix-installer)
2. Run `nix develop` in the project root. This starts a new shell which exposes
the Nix project dependencies on your `$PATH`, and can be exited with `exit`.
3. Type `echo $IN_NIX_SHELL` to confirm you're in a Nix shell. It should print
"impure".
4. Run `which rustc` to verify that the Rust compiler is being provided by Nix.
You should see a path starting with `/nix/store/` and ending in `/bin/rustc`.
We also supply configuration for [direnv](https://direnv.net/) to allow
autoloading the Nix dependencies upon entering the project folder.
To use this:
1. Install direnv:
1. [Install the direnv program](https://direnv.net/docs/installation.html)
1. [Add the direnv hook to your shell](https://direnv.net/docs/hook.html)
1. Open a new terminal
1. `cp .envrc.local.example .envrc.local`
1. Run `direnv allow`
1. Nix should now install project dependencies and put them in your `$PATH`
whenever you enter the project folder.
1. Type `echo $IN_NIX_SHELL` to confirm you're in a Nix shell. It should print
"impure".
1. Run `which rustc` to verify that the Rust compiler is being provided by Nix.
You should see a path starting with `/nix/store/` and ending in `/bin/rustc`.
Add UNSTABLE_FEATURES env var (#652) <!-- Thank you for submitting this PR! :) --> ## Description We'd like to be able to test new WIP experimental features. This adds a `UNSTABLE_FEATURES` env var / command line arg that can be passed a comma separated list of names. Currently we accept `UNSTABLE_FEATURES=enable-boolean-expression-types` but in future users could pass `UNSTABLE_FEATURES=some-fancy-feature,other-feature,great`. <!-- Questions to consider answering: 1. What user-facing changes are being made? 2. What are issues related to this PR? (Consider adding `(close #<issue-no>)` to the PR title) 3. What is the conceptual design behind this PR? 4. How can this PR be tested/verified? 5. Does the PR have limitations? 6. Does the PR introduce breaking changes? --> ## Changelog - Add a changelog entry (in the "Changelog entry" section below) if the changes in this PR have any user-facing impact. See [changelog guide](https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide). - If no changelog is required ignore/remove this section and add a `no-changelog-required` label to the PR. ### Product _(Select all products this will be available in)_ - [x] community-edition - [x] cloud <!-- product : end : DO NOT REMOVE --> ### Type <!-- See changelog structure: https://github.com/hasura/graphql-engine-mono/wiki/Changelog-Guide#structure-of-our-changelog --> _(Select only one. In case of multiple, choose the most appropriate)_ - [ ] highlight - [x] enhancement - [ ] bugfix - [ ] behaviour-change - [ ] performance-enhancement - [ ] security-fix <!-- type : end : DO NOT REMOVE --> ### Changelog entry <!-- - Add a user understandable changelog entry - Include all details needed to understand the change. Try including links to docs or issues if relevant - For Highlights start with a H4 heading (#### <entry title>) - Get the changelog entry reviewed by your team --> Add `UNSTABLE_FEATURES` environment variable <!-- changelog-entry : end : DO NOT REMOVE --> <!-- changelog : end : DO NOT REMOVE --> V3_GIT_ORIGIN_REV_ID: 3562c1341d4ea3a512626110dbd2b055425c1d60
2024-06-03 11:49:49 +03:00
## Unstable features
When starting the engine, you can use the `UNSTABLE_FEATURES` env var to enable
work in progress features. Currently available:
- `enable-boolean-expression-types` - allow the new `BooleanExpressionType`
metadata kind
## Additional Reading
- [Architecture](docs/architecture.md)
- [Roles and Annotations](docs/roles-and-annotations.md)
- [Errors](docs/errors.md)