You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: governance pack — security policy, contributing, dependabot, version single-source, CI hardening
- SECURITY.md: private vulnerability reporting (enabled on repo), SLA, scope
- CONTRIBUTING.md: build/test setup, test conventions, AOT constraints, PR expectations
- Issue templates (bug/feature/config), PR template, dependabot.yml (weekly, grouped NuGet minor+patch)
- Version single source: version.txt -> Directory.Build.props (core+client csproj), release workflow reads it per job (hardcoded RELEASE_VERSION removed), npm-publish syncs package.json, postinstall.js derives download URL from its own package version
- RELEASING.md: full release checklist, version model, secrets, hotfix procedure
- CI: PostgreSQL 15/16/17 matrix in test.yml; AOT smoke test (--version + --validate against live PostgreSQL) in build-linux before asset upload
- README: Contributing and Security sections link the new docs
Prerequisites: **.NET 10 SDK** and a local **PostgreSQL** (any recent version; CI tests 15/16/17) listening on `localhost:5432` with user `postgres` / password `postgres`. The test run creates and drops its own database (`npgsql_rest_test`); connection constants live in `NpgsqlRestTests/Setup/Database.cs`.
18
+
19
+
```sh
20
+
dotnet build
21
+
dotnet test NpgsqlRestTests/NpgsqlRestTests.csproj
22
+
```
23
+
24
+
## Test conventions (please follow these — PRs that don't will be asked to change)
25
+
26
+
-**Assert full response strings**, not fragments. A test pins the exact wire output.
27
+
-**SQL setup lives in the same file as the assertions**: add a `public static void YourTests()` method on the `Database` partial class appending your `create function …` to the shared script (it is auto-registered via reflection), with the `[Collection("TestFixture")]` test class below it. Copy the pattern from any file in `NpgsqlRestTests/BodyTests/`.
28
+
- Pitfalls: don't name test routines after PostgreSQL built-ins (`to_date`, …); `NameSimilarTo` treats `_` as a wildcard; response JSON keys are camelCase.
29
+
- Tests must be deterministic — no fixed sleeps; await observable conditions with timeouts.
30
+
31
+
## Code constraints
32
+
33
+
-**AOT/trim-safe only.** The client publishes with `PublishAot=true` + `TrimMode=full`: no reflection-based serialization or libraries, JSON via source-generated/`System.Text.Json.Nodes` patterns. (Note: `JsonArray.Add(x)` needs an explicit `(JsonNode?)` cast.)
34
+
- Match the surrounding code's style and comment density. Comments explain constraints, not narrate lines.
35
+
- Public API of the core library is a published NuGet surface — breaking changes need a strong justification and a changelog entry under "Breaking Changes".
36
+
37
+
## Pull requests
38
+
39
+
1. Open an issue first for anything non-trivial — agreeing on the approach saves everyone time.
40
+
2. Include tests for behavior changes (see conventions above).
41
+
3. Add a changelog entry to `changelog/v<next-version>.md` describing the change in user-facing terms.
42
+
4. Keep PRs focused — one logical change per PR.
43
+
5. CI must be green (build + full test suite on PostgreSQL 15/16/17).
44
+
45
+
## Reporting bugs
46
+
47
+
Use the bug-report issue template. The single most useful thing you can provide is a **minimal reproduction**: the SQL (`create function …` + comment annotations or `.sql` file), the relevant config section, the request, and the expected vs. actual full response.
48
+
49
+
## Security issues
50
+
51
+
**Do not open public issues for vulnerabilities** — see [SECURITY.md](SECURITY.md).
52
+
53
+
## Labels
54
+
55
+
-`good-first-issue` — small, well-scoped, a good entry point
56
+
-`help-wanted` — larger items looking for a contributor
0 commit comments