Skip to content

Commit 34babb0

Browse files
committed
add: contribution research notes for testcontainers-java
1 parent 5323acd commit 34babb0

File tree

1 file changed

+252
-0
lines changed

1 file changed

+252
-0
lines changed
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
# Testcontainers Java Contribution Research
2+
3+
## Goal
4+
5+
This note summarizes contribution candidates for a Spring / Java / Kotlin backend engineer targeting `testcontainers/testcontainers-java`.
6+
7+
The focus is not only "what is easy", but "what will look strong to backend hiring teams while still having a realistic merge path".
8+
9+
## Repository Health
10+
11+
- Upstream repository: `testcontainers/testcontainers-java`
12+
- Local fork remote: `PreAgile/testcontainers-java`
13+
- Current local branch: `main`
14+
- Working tree state at review time: clean
15+
16+
Signals that the repository is actively maintained:
17+
18+
- `good first issue` labels are still in use
19+
- merged PRs exist in late 2025 and early 2026
20+
- recent human-merged PRs include:
21+
- `#11498` merged on `2026-02-26`
22+
- `#11223` merged on `2026-03-02`
23+
24+
## Local Codebase Areas That Matter
25+
26+
Relevant local paths:
27+
28+
- `docs/contributing.md`
29+
- `docs/contributing_docs.md`
30+
- `docs/modules/k6.md`
31+
- `modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java`
32+
- `modules/r2dbc/src/main/java/org/testcontainers/r2dbc/R2DBCDatabaseContainer.java`
33+
- `modules/postgresql/src/main/java/org/testcontainers/postgresql/PostgreSQLR2DBCDatabaseContainer.java`
34+
- `modules/mysql/src/main/java/org/testcontainers/mysql/MySQLR2DBCDatabaseContainer.java`
35+
- `modules/mongodb/src/main/java/org/testcontainers/mongodb/MongoDBContainer.java`
36+
- `modules/jdbc/src/main/java/org/testcontainers/jdbc/ContainerDatabaseDriver.java`
37+
38+
## Maintainer Preference Pattern
39+
40+
Observed pattern from recent merged PRs:
41+
42+
- small scope
43+
- module-focused changes
44+
- tests included for code changes
45+
- low review burden
46+
47+
Examples:
48+
49+
- `#11498` changed 2 files and added a focused implementation plus test update
50+
- `#11223` changed 3 files with a targeted compatibility fix
51+
52+
This strongly suggests that a first PR should avoid broad cross-cutting core changes.
53+
54+
## Candidate Ranking
55+
56+
### 1. Best first PR: `#8780`
57+
58+
Title:
59+
60+
- `[Enhancement]: Add example test to the K6 module docs`
61+
62+
Why this is the safest first merge:
63+
64+
- issue scope is clear
65+
- user pain is already documented in the issue body
66+
- implementation is mostly docs/example work
67+
- it does not require design negotiation across multiple modules
68+
69+
Problem analysis:
70+
71+
- `docs/modules/k6.md` currently includes a code snippet from `K6ContainerTests`
72+
- the docs show the API, but do not clearly present the "typical test shape" that users expect
73+
- the issue author explicitly compared it unfavorably to quickstart-style docs
74+
75+
Root cause:
76+
77+
- documentation exposes a snippet, but not an opinionated onboarding flow
78+
- discoverability is weaker than in other Testcontainers modules
79+
80+
Why this helps a Spring/backend profile:
81+
82+
- not as strong as a code PR, but excellent as a first merged foothold
83+
- shows you can read the repo conventions and contribute cleanly
84+
85+
Recommended PR shape:
86+
87+
- keep it to docs and possibly example snippet framing
88+
- do not over-design a new example project unless maintainers ask for it
89+
- align the K6 docs with the style of existing quickstart/test integration pages
90+
91+
Merge probability:
92+
93+
- high
94+
95+
### 2. Best second PR: `#8797`
96+
97+
Title:
98+
99+
- `Add getR2dbcUrl helper method to JdbcDatabaseContainer`
100+
101+
Why this is the best backend-signaling PR:
102+
103+
- directly relevant to Spring, reactive stacks, database integration, and developer ergonomics
104+
- stronger hiring signal than a docs PR
105+
- maintainers already discussed acceptable design direction
106+
107+
Problem analysis:
108+
109+
- current R2DBC support exposes `getOptions(container)` methods
110+
- users who want a concrete R2DBC URL string must construct it manually
111+
- that hurts discoverability and ease of use
112+
113+
Important maintainer guidance already found in the issue:
114+
115+
- do not force this into a generic `JdbcDatabaseContainer` API immediately
116+
- preferred direction is static `getR2dbcUrl(container)` helpers on each `R2DBCDatabaseContainer` implementation
117+
- this was discussed explicitly by maintainers in the issue thread
118+
119+
Existing failed attempt:
120+
121+
- PR `#9569` attempted the feature
122+
- maintainer immediately asked for tests
123+
- contributor then got stuck on MSSQL-specific test issues
124+
- PR was eventually closed
125+
126+
What that means:
127+
128+
- the feature itself is not rejected
129+
- the implementation failed because the scope was too broad and the testing path got messy
130+
131+
Best way to revive it:
132+
133+
- comment on the issue first
134+
- confirm that the agreed static-method design is still welcome
135+
- explicitly propose a narrow first step
136+
- avoid broad "support everything at once" unless maintainers request it
137+
138+
Safer implementation plan:
139+
140+
1. Start with the stable implementations that are easiest to test cleanly
141+
2. Add tests alongside each helper
142+
3. Leave tricky drivers such as MSSQL for follow-up if needed
143+
144+
Why this helps a Spring/backend profile:
145+
146+
- strongest fit for Spring / Java backend positioning
147+
- good talking point for R2DBC, developer experience, and integration testing
148+
149+
Merge probability:
150+
151+
- medium to high if kept narrow
152+
- medium or lower if implemented across too many drivers at once
153+
154+
### 3. High-value but risky: `#3066`
155+
156+
Title:
157+
158+
- `Support init scripts for MongoDBContainer without manually customizing the WaitStrategy`
159+
160+
Why it is attractive:
161+
162+
- strong backend signal
163+
- involves lifecycle, initialization order, replica set handling, and wait strategy design
164+
165+
Problem analysis from issue and code:
166+
167+
- placing scripts under `/docker-entrypoint-initdb.d` can trigger MongoDB restart behavior
168+
- local `MongoDBContainer` currently relies on `Wait.forLogMessage("(?i).*waiting for connections.*", 1)`
169+
- that does not robustly cover the init-script + replica-set startup sequence
170+
171+
Root cause:
172+
173+
- container readiness assumptions do not fully match Mongo init script behavior
174+
- `MongoDBContainer` also performs replica set initialization after start, which increases timing sensitivity
175+
176+
Why it is risky as a first PR:
177+
178+
- more design ambiguity
179+
- more regression risk
180+
- higher chance of maintainers asking for a reproducer-heavy discussion or broader design changes
181+
182+
Merge probability:
183+
184+
- medium at best for a newcomer first PR
185+
186+
### 4. Not recommended first: `#1537`
187+
188+
Title:
189+
190+
- `Support hikari data-source-properties in ContainerDatabaseDriver`
191+
192+
Why it looks easy but is not:
193+
194+
- the surface request is "just pass `Properties info` through"
195+
- in practice it may affect:
196+
- JDBC property propagation
197+
- connection creation semantics
198+
- cache key behavior in `ContainerDatabaseDriver`
199+
200+
Root cause:
201+
202+
- `ContainerDatabaseDriver.connect(String url, Properties info)` does not currently flow those properties in a newcomer-safe way
203+
- any fix in this path touches JDBC core behavior, not just one module
204+
205+
Why it is a poor first PR:
206+
207+
- too core
208+
- too broad
209+
- too easy to create subtle regressions
210+
211+
Merge probability:
212+
213+
- low for a first contribution
214+
215+
## Recommended Order
216+
217+
1. `#8780` K6 docs/example PR
218+
2. `#8797` R2DBC helper PR
219+
3. `#3066` MongoDB wait-strategy/init-script PR
220+
221+
## Suggested PR Positioning
222+
223+
### For `#8780`
224+
225+
PR message should emphasize:
226+
227+
- clearer onboarding
228+
- quickstart-style discoverability
229+
- alignment with existing docs conventions
230+
231+
### For `#8797`
232+
233+
PR message should emphasize:
234+
235+
- narrowed scope
236+
- implementation following the already discussed issue design
237+
- tests added for each touched helper
238+
- no attempt to redesign the entire R2DBC abstraction
239+
240+
Suggested issue comment before coding:
241+
242+
> I would like to revive this using the static `getR2dbcUrl(container)` approach discussed above.
243+
> To keep the scope reviewable, I plan to add the helper with tests for the stable implementations first and leave any problematic drivers for a follow-up PR if needed.
244+
> Does that still match the expected direction?
245+
246+
## Practical Notes
247+
248+
- For docs contributions, follow `docs/contributing_docs.md`
249+
- For code contributions, follow `docs/contributing.md`
250+
- Run formatting and tests before opening a PR
251+
- Keep each PR scoped to one issue and one clear problem
252+
- For a newcomer, "small and mergeable" is more valuable than "ambitious but stalled"

0 commit comments

Comments
 (0)