We take Pull Requests!
- Contact the contributors via the Discord channel or the Github Issue to make sure that this is issue or bug should be handled with proposed way. Send details of your case and explain the details of the proposed solution.
- Once you get approval from one of the maintainers, you can start to work on your code change.
- After your changes are ready, make sure that you covered your case with automated tests and verify that you have limited the number of breaking changes to a bare minimum.
- We also highly appreciate any relevant updates to the documentation.
- Make sure that your code is compiling and all automated tests are passing.
- Make sure that you applied or answered all the feedback from the maintainers.
- We're trying to be as much responsive as we can, but if we didn't respond to you, feel free to ping us on the Discord channel.
- Pull request will be merged when you get approvals from at least 2 of the maintainers (and no rejection from others). Pull request will be tagged with the target Marten version in which it will be released. We also label the Pull Requests with information about the type of change.
We try to limit the number of necessary setup to a minimum, but few steps are still needed:
1. .NET Core SDK 6.0+
Available here
2. PostgreSQL 13 or above database
13 is a hard floor rather than a recommendation: the async daemon calls pg_current_snapshot(), which
arrived in PostgreSQL 13, so an older server fails those tests with
42883: function pg_current_snapshot() does not exist. CI runs postgres:15-alpine and
postgres:latest.
The fastest possible way to develop with Marten is to run PostgreSQL in a Docker container. Assuming that you have Docker running on your local box, type:
docker compose up
at the command line to spin up a PostgreSQL database. docker-compose.yml builds its image from
docker/postgres/Dockerfile, which layers PostGIS 3 and pgvector onto the official postgres:17
image so the extension test projects have what they need.
The default Marten test configuration finds that database automatically. To use a different one, set
the marten_testing_database environment variable to its connection string (see the
Npgsql documentation for the format),
and make sure the login you connect with is a member of the postgres role.
Once you have the codebase and the connection string file, run the build command or use the dotnet CLI to restore and build the solution.
You are now ready to contribute to Marten.
Node.js
If you want to update or add new documentation, you need to have Node.js installed on your machine. The recommended version is the latest LTS version. You can download it from the official website or using a version manager like nvm.
After installing Node.js, you can install the required packages by running the following command in the root directory of this repository:
npm install- Fork the repository.
- Create a feature branch from the
masterbranch. - We're not squashing the changes and using rebase strategy for our branches (see more in Git documentation). Having that, we highly recommend using clear commit messages. Commits should also represent the unit of change.
- Before sending PR to make sure that you rebased the latest
masterbranch from the main Marten repository. - When you're ready to create the Pull Request on GitHub.
Coding rules are set up in the .editorconfig file. This file is supported by all popular IDE (eg. Microsoft Visual Studio, Rider, Visual Studio Code) so if you didn't disable it manually they should be automatically applied after opening the solution. We also recommend turning automatic formatting on saving to have all the rules applied.
If you want to update or add new documentation, you can find the documentation in the docs directory.
We're using MarkdownSnippets to include the C# code examples in the documentation.
If you want to add code examples to the documentation, you have to add a C# file which includes the code example or annotate existing files with a unique C# #region/#endregion pair:
#region sample_my_unique_name
// Your code example here
#endregionThen you can refer to the code example in the Markdown file by using the following syntax:
After adding the code example, you can run the following command to update the documentation:
npm run mdsnippetsYou can find examples if you search this repository for "sample_" or "snippet:".
By contributing to Marten:
- You assert that contribution is your original work.
- You assert that you have the right to assign the copyright for the work.
- You are accepting the License.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
