Contributing
Thanks for taking the time to contribute. This guide covers the moving parts — branching, versioning, CI, and the local dev loop — so your first PR lands without surprises.
Prerequisites
Section titled “Prerequisites”- .NET SDK 10.0.x — the SDK can build the library for
net8.0,net9.0, andnet10.0. - Node.js 20+ (only needed if you’re editing the documentation site under
site/) - A running Neo4j instance — only required for the
example/project and ad-hoc experimentation. Unit tests run fully in-memory against mocked sessions.
Getting the code
Section titled “Getting the code”git clone https://github.com/ambystechcom/Ambystech.Neo4j.Repository.gitcd Ambystech.Neo4j.Repositorydotnet restore Ambystech.Neo4j.Repository.slnRepository layout
Section titled “Repository layout”| Path | What lives there |
|---|---|
contracts/ | Ambystech.Neo4j.Repository.Contracts — attributes, base node, search models |
lib/ | Ambystech.Neo4j.Repository — driver wiring, repository, converters |
example/ | Console app demonstrating a User / Post social graph |
unit-tests/ | MSTest suite |
site/ | Astro Starlight documentation site (this site) |
.github/workflows/ | CI: PR gate, NuGet publish, docs deploy |
Branching & versioning
Section titled “Branching & versioning”The repo uses GitVersion in Mainline mode. You don’t edit <Version> by hand — GitVersion computes it from branch and merge-commit messages.
main— released packages. Each push publishes a stable NuGet version (patch bump by default).develop— prerelease packages tagged-beta. Pushes publish prerelease NuGets with a minor bump.- Feature branches — open PRs against
developfor new work, or againstmainfor fixes that should ship immediately.
Override the bump level from a merge commit message:
| Message fragment | Bump |
|---|---|
+semver: breaking or major | Major |
+semver: feature or minor | Minor |
+semver: fix or patch | Patch |
Plain commits on a feature branch don’t bump the version — only the merge commit into main or develop does.
Local dev loop
Section titled “Local dev loop”Build and test
Section titled “Build and test”dotnet build Ambystech.Neo4j.Repository.sln --configuration Releasedotnet test Ambystech.Neo4j.Repository.sln --configuration ReleaseThe PR gate runs exactly this. If it’s green locally, CI will be green too.
Run the example
Section titled “Run the example”Configure a Neo4j instance via user secrets and run:
cd exampledotnet user-secrets set "Neo4j-Uri" "bolt://localhost:7687"dotnet user-secrets set "Neo4j-User" "neo4j"dotnet user-secrets set "Neo4j-Password" "your-password"dotnet runEdit the docs site
Section titled “Edit the docs site”cd sitenpm installnpm run dev # http://localhost:4321/Ambystech.Neo4j.Repository/npm run build # production build into site/dist/Coding guidelines
Section titled “Coding guidelines”- Target
net8.0,net9.0, andnet10.0for code undercontracts/andlib/— don’t introduce APIs that only exist on a newer TFM without a conditional compilation guard (e.g.#if NET10_0_OR_GREATER). - Public types and members need XML docs —
GenerateDocumentationFileis on, so missing docs surface as CS1591 warnings. - Keep the repository surface small. New public members on
IBaseGraphRepository<T>are a breaking change for consumers that implement the interface directly. - Prefer a new test in
unit-tests/over a manual repro. The suite uses MSTest + AutoFixture + Moq — follow the style already in place.
Pull requests
Section titled “Pull requests”- Fork or branch, commit your change.
- Open a PR against
develop(new features) ormain(fixes). Describe the change and link any related issue. - The Build & Test check runs automatically — it restores the solution, builds in Release, runs
dotnet test, and uploads a.trxartifact. - A failing check blocks the merge. Fix the code, not the guard.
- On merge:
- PRs into
developpublish a new-betaprerelease NuGet forAmbystech.Neo4j.Repository. - PRs into
mainpublish a stable NuGet and, forlib/changes, cut a GitHub release with a tag, changelog, and the.nupkgattached. - PRs under
contracts/publish the contracts package on merge tomain. - Changes confined to
site/trigger a GitHub Pages deploy and skip the NuGet pipeline.
- PRs into
What to avoid
Section titled “What to avoid”- Don’t bump
<Version>manually — GitVersion owns that. - Don’t re-add
pull_requesttriggers to the deploy workflows. The PR gate is the PR gate; the deploy workflows run on push only. - Don’t commit secrets. Use
dotnet user-secrets, environment variables, or GitHub Actions secrets. - Don’t land breaking changes on
mainwithout the+semver: breakingmarker on the merge commit.
Reporting bugs & asking questions
Section titled “Reporting bugs & asking questions”Open an issue on GitHub. A minimal repro — ideally a failing test or a small snippet — is the fastest path to a fix.