Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,36 @@ It captures practical rules that prevent avoidable CI and PR churn.
- Prefer asserting observable behavior instead of shared global mock state when possible.
- If a test must depend on shared/global mock state, use `it.sequential(...)` or `describe.sequential(...)`.

## Cross-language Implementations

Testcontainers is a family of libraries that share the same concepts (containers, wait
strategies, modules, Ryuk/reaper, networks, etc.) across many languages. When you are
unsure how to design or implement something here, it is often worth checking how the more
mature implementations solved the same problem. Their behavior is the de-facto reference,
and aligning with it keeps this port consistent with the rest of the ecosystem.

Use them as a sanity check in both directions:

- If a feature or behavior exists elsewhere, see how it was implemented, what edge cases
it handles, and what defaults it chose before designing your own version.
- If something is conspicuously absent, treat that as a signal. It may have been
deliberately omitted (unsupported by the Docker API, a footgun, deprecated, or
platform-specific). Investigate why before adding it here.

Implementations, roughly in order of maturity (most mature first):

- Java (the original reference implementation): https://github.com/testcontainers/testcontainers-java
- Go: https://github.com/testcontainers/testcontainers-go
- .NET: https://github.com/testcontainers/testcontainers-dotnet
- Python: https://github.com/testcontainers/testcontainers-python
- Node.js (this repository): https://github.com/testcontainers/testcontainers-node
- Rust: https://github.com/testcontainers/testcontainers-rs
- Ruby: https://github.com/testcontainers/testcontainers-ruby
- Haskell: https://github.com/testcontainers/testcontainers-hs

When you do borrow a decision from another implementation, note the source in the PR so
reviewers can follow the reasoning.

## Permission and Escalation

- `npm install` requires escalated permissions for outbound network access to npm registries.
Expand All @@ -65,6 +95,8 @@ It captures practical rules that prevent avoidable CI and PR churn.
- If signing fails (for example, passphrase/key issues), stop and ask the user to resolve signing, then retry.
8. Push branch. Ask for explicit user permission before any force push.
9. Open PR against `main` using a human-readable title (no `feat(...)` / `fix(...)` prefixes, and no agent-identifying prefixes or suffixes).
- Phrase titles in the imperative mood to match existing history, for example `Add Mosquitto module`, not `Adding Mosquitto module` (gerund/`-ing`) or `Added Mosquitto module` (past tense).
- For new modules the established form is `Add <Name> module` (see prior PRs such as `Add CouchDB module`, `Add Oracle Free module`).
- Default to a ready-for-review PR. Only open or keep a PR in draft when the user explicitly asks for a draft.
- When using `gh` to create/edit PR descriptions, prefer `--body-file <path>` over inline `--body`; this avoids shell command substitution issues when the body contains backticks.
10. Add labels for both change type and semantic version impact.
Expand All @@ -75,6 +107,16 @@ It captures practical rules that prevent avoidable CI and PR churn.
- if semver impact is not `major`, evidence that the change is not breaking
- `Closes #<issue>` only when the PR is intended to close a specific issue

## PR Review

When reviewing a PR (your own or someone else's), the review is not only about the diff:

- Check the PR title follows the conventions in step 9 of the PR Process: imperative mood,
no agent/`feat(...)`/`fix(...)` prefixes, and the `Add <Name> module` form for new
modules. Flag titles using the gerund (`Adding ...`) or past tense (`Added ...`).
- Check that labels (change type and semver impact) are present and correct.
- Check that docs were updated alongside any public API change.

## Labels

### Change type
Expand Down