Thank you for considering contributing to Tailcall! This document outlines the steps and guidelines to follow when contributing to this project.
- Fork the Repository: Start by forking the repository to your personal account on GitHub.
- Clone the Forked Repository: Once you have forked the repository, clone it to your local machine.
git clone https://github.com/tailcallhq/tailcall.git
-
Install Rust: If you haven't already, install Rust using rustup. Install the
nightly
toolchain as well, as it's used for linting. -
Install Prettier: Install Prettier too as this is also used for linting.
-
Build the Application: Navigate to the project directory and build the application.
cd tailcall cargo build
-
Start the Server: To start the server, use the following command:
cargo run -- start ./examples/jsonplaceholder.graphql
Once the server is running, you can access the GraphiQL interface at http://localhost:8000/graphiql.
-
Create a New Branch: Always create a new branch for your changes.
git checkout -b feature/your-feature-name
-
Write Clean Code: Ensure your code is clean, readable, and well-commented.
-
Follow Rust Best Practices: Adhere to the Rust API Guidelines.
-
Use Title Case in Job Names: When adding new CI jobs to
.github/workflows
, please use title case e.g. Close Stale Issues and PR.
- Write Tests: For every new feature or bugfix, ensure that you write appropriate tests.
- Run Tests: Before submitting a pull request, ensure all tests pass.
cargo test
-
Important: Make sure all the commits are done.
-
Install packages: Install cargo-criterion rust-script.
cargo install cargo-criterion rust-script
-
Comparing Benchmarks: You need to follow the following steps to compare benchmarks between
main
(Baseline) and your branch.git checkout main cargo criterion --message-format=json > main.json git checkout - cargo criterion --message-format=json > feature.json ./scripts/criterion_compare.rs base.json main.json table
-
Check the Results: If the benchmarks show more than 10% degradation, the script will exit with an error. Please check "benches/benchmark.md" file to identify the benchmarks that failed and investigate the code changes that might have caused the degradation.
- Update README: If your changes necessitate a change in the way users interact with the application, update the README accordingly.
- Inline Documentation: Add inline documentation to your code where necessary.
- Atomic Commits: Make sure each commit is atomic (i.e., it does one thing). This makes it easier to review and revert if necessary.
- Commit Message Guidelines: Write meaningful commit messages. Start with a short summary (50 chars max), followed by a blank line and then a detailed description if needed.
-
Push to Your Fork: Push your changes to your fork on GitHub.
git push origin feature/your-feature-name
-
Open a Pull Request: Navigate to the original repository on GitHub and open a pull request against the
main
ordevelop
branch. -
Describe Your Changes: In the pull request description, explain the changes you made, the issues they resolve, and any other relevant information.
-
Wait for Review: Maintainers will review your pull request. Address any comments or feedback they provide.
- Star the Repository: If you find this project useful, please give it a star on GitHub. This helps increase its visibility and encourages more people to contribute.
- Tweet About Your Contribution: Share your contributions and experiences with the wider community on Twitter. Use the hashtag
#TailcallContributor
and tag@tailcallhq
to let us know!
- Be Respectful: Please remember that this is an open-source project and the community is welcoming and respectful to all members.
Thank you for contributing! Your efforts help improve the application for everyone.