Skip to content

Latest commit

 

History

History
68 lines (42 loc) · 2.95 KB

CONTRIBUTING.md

File metadata and controls

68 lines (42 loc) · 2.95 KB

Contributing

Thanks for your interest in contributing to this project! PRs and issues are welcome, but please keep in mind that this project is still and alpha and the the implementation details and API will most likely change between now and a stable release.

For larger changes, please first make an RFC issue. You can follow along with the roadmap in the GitHub project.

How to contribute

First, make sure you can build and run the project

  1. Ensure you have Rust and Docker installed.
  2. Checkout this repo git clone https://github.com/railwayapp/nixpacks.git
  3. Build the source cargo build
  4. Run the tests cargo test
  5. Build an example cargo run -- build examples/node --name node
  6. Run the example docker run node

You should see Hello from Node printed to the console.

Debugging

When debugging it can be useful to see the intermediate files that Nixpacks generates (e.g. Dockerfile) You can do this my saving the build artifact to a specific directory instead of to a temp dir.

cargo run -- build examples/node --out test

The test directory will contain everything that would be built with Docker. All the files that Nixpacks generates are in .nixpacks. You can manually build the image with docker build test -f test/.nixpacks/Dockerfile.

Snapshot Tests

Nixpacks uses insta for snapshot tests. We use snapshot tests to generate and compare all build plans for the test apps in examples/. If a snapshot test fails due to a change to a provider, that is okay. It just means the snapshot needs to be reviewed and accepted. To test and review all snapshots, you can

First install insta

cargo install cargo-insta

Test and review the generate plan tests.

cargo insta test --review -- --test generate_plan_tests
# or
cargo snapshot

The snapshots are checked into CI and are reviewed as part of the PR. They ensure that a change to one part of Nixpacks does not unexpectedly change an unrelated part.

Read the docs for more information on cargo insta.

Contribution Ideas

The easiest way to contribute is to add support for new languages. There is a list of languages we would like to add here, but languages not on the list are welcome as well. To guage interest you can always create an issue before working on an implementation.

Making PRs

To make a PR follow GitHubs guide.

PRs are all checked with

  • cargo check
  • cargo test
  • cargo clippy

so you can run these locally to ensure CI passes.

Most PRs should include tests.