Skip to content

Commit 95c616e

Browse files
committed
Merge branch 'docs/contributor-research'
2 parents 326987f + 95a2ce7 commit 95c616e

File tree

2 files changed

+792
-0
lines changed

2 files changed

+792
-0
lines changed
Lines changed: 387 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,387 @@
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+
## First PR Recommendation
222+
223+
### Recommended first merged PR
224+
225+
Issue:
226+
227+
- `#8780` `[Enhancement]: Add example test to the K6 module docs`
228+
229+
Link:
230+
231+
- `https://github.com/testcontainers/testcontainers-java/issues/8780`
232+
233+
Why this is the best first PR:
234+
235+
- the issue scope is concrete
236+
- the user pain is already written clearly in the issue
237+
- it avoids deep design arguments
238+
- it matches the small-PR preference observed in recent merged work
239+
240+
Problem analysis:
241+
242+
- `docs/modules/k6.md` already exposes API usage through codeinclude
243+
- however, it still does not clearly show the "expected JUnit-style test shape" that users look for
244+
- the issue reporter explicitly compared the docs to quickstart-style guidance and found the current page harder to follow
245+
246+
Root cause:
247+
248+
- the docs expose a runnable snippet
249+
- but the onboarding flow is weaker than in more polished Testcontainers pages
250+
- the page answers "what API exists" better than "how should I write my first test"
251+
252+
Recommended solution shape:
253+
254+
1. Update `docs/modules/k6.md`
255+
2. Reuse the existing runnable snippet from `modules/k6/src/test/java/org/testcontainers/k6/K6ContainerTests.java`
256+
3. Add a short JUnit-style explanation section
257+
4. Keep the change limited to docs and snippet framing unless maintainers request more
258+
259+
Why this should merge well:
260+
261+
- it is easy to review
262+
- it improves user onboarding directly
263+
- it does not expand the public API
264+
- it does not create cross-module risk
265+
266+
Estimated merge probability:
267+
268+
- high, assuming the PR stays small and aligned with existing docs conventions
269+
270+
## Maintainer Interaction Strategy
271+
272+
### Who is most likely to matter
273+
274+
Based on issue and PR review activity observed during research:
275+
276+
- `eddumelendez`
277+
- `kiview`
278+
279+
This does not mean directly targeting them personally. It means:
280+
281+
- write the issue comment in a way that makes review easy for maintainers who already triage this area
282+
- keep scope explicit
283+
- make it obvious that the change is intentionally narrow
284+
285+
### Best way to approach `#8780`
286+
287+
Suggested issue comment:
288+
289+
> I’d like to work on this.
290+
> My plan is to improve the K6 docs by adding a clearer JUnit-style example section based on the existing module test, while keeping the change small and aligned with the current docs/codeinclude style.
291+
292+
This is strong because:
293+
294+
- it signals ownership
295+
- it shows you read the existing docs structure
296+
- it reduces reviewer uncertainty
297+
298+
### Best PR description style for `#8780`
299+
300+
Suggested PR structure:
301+
302+
```md
303+
## Summary
304+
Improve the K6 module documentation with a clearer JUnit-style example test.
305+
306+
## Problem
307+
The current docs show the API usage, but it is still hard to understand the expected test structure quickly.
308+
309+
## Changes
310+
- add a clearer example section to the K6 docs
311+
- reuse the existing runnable test snippet
312+
- keep the documentation aligned with the current codeinclude style
313+
314+
## Why
315+
This makes the module easier to adopt for users looking for a quickstart-like testing example.
316+
```
317+
318+
## Second PR Recommendation
319+
320+
### Best first code PR after the docs PR
321+
322+
Issue:
323+
324+
- `#8797` `Add getR2dbcUrl helper method to JdbcDatabaseContainer`
325+
326+
Link:
327+
328+
- `https://github.com/testcontainers/testcontainers-java/issues/8797`
329+
330+
Why this is the strongest backend-signaling follow-up:
331+
332+
- aligns closely with Spring / reactive database usage
333+
- gives a better hiring signal than docs-only work
334+
- maintainers already discussed an acceptable design direction
335+
336+
Important caution:
337+
338+
- a previous attempt, PR `#9569`, was closed
339+
- the feature was not rejected
340+
- the attempt appears to have become too broad and got stuck in tests, especially around MSSQL
341+
342+
Best way to revive it:
343+
344+
Suggested issue comment:
345+
346+
> I’d like to revive this using the static `getR2dbcUrl(container)` approach discussed above.
347+
> To keep the scope reviewable, I plan to start with the stable implementations first and include tests for each one, leaving any problematic driver-specific follow-up for a separate PR if needed.
348+
> Does that still match the expected direction?
349+
350+
Why this approach should improve merge odds:
351+
352+
- it respects prior maintainer discussion
353+
- it shows you learned from the closed PR
354+
- it reduces fear of a large cross-driver change
355+
356+
## Suggested PR Positioning
357+
358+
### For `#8780`
359+
360+
PR message should emphasize:
361+
362+
- clearer onboarding
363+
- quickstart-style discoverability
364+
- alignment with existing docs conventions
365+
366+
### For `#8797`
367+
368+
PR message should emphasize:
369+
370+
- narrowed scope
371+
- implementation following the already discussed issue design
372+
- tests added for each touched helper
373+
- no attempt to redesign the entire R2DBC abstraction
374+
375+
Suggested issue comment before coding:
376+
377+
> I would like to revive this using the static `getR2dbcUrl(container)` approach discussed above.
378+
> 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.
379+
> Does that still match the expected direction?
380+
381+
## Practical Notes
382+
383+
- For docs contributions, follow `docs/contributing_docs.md`
384+
- For code contributions, follow `docs/contributing.md`
385+
- Run formatting and tests before opening a PR
386+
- Keep each PR scoped to one issue and one clear problem
387+
- For a newcomer, "small and mergeable" is more valuable than "ambitious but stalled"

0 commit comments

Comments
 (0)