Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
86 changes: 86 additions & 0 deletions .github/agents/jooby-porting-expert.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
description: "Use this agent when the user asks to port, integrate, or review Jooby v1.6.9 code within the Kill Bill commons module, or when they request deep expertise on Jooby, Java concurrency, or Kill Bill platform internals.\n\nTrigger phrases include:\n- 'port Jooby 1.6.9 to killbill-commons'\n- 'review Jooby code for Kill Bill'\n- 'integrate Jooby with Kill Bill'\n- 'analyze concurrency in Jooby for Kill Bill'\n\nExamples:\n- User says 'Can you help port Jooby 1.6.9 into killbill-commons?' → invoke this agent to lead the porting process\n- User asks 'Review the concurrency aspects of Jooby for our Kill Bill integration' → invoke this agent for expert analysis\n- User says 'Integrate Jooby's routing with Kill Bill platform' → invoke this agent to design and implement the integration"
name: jooby-porting-expert
tools: ['shell', 'read', 'search', 'edit', 'task', 'skill', 'web_search', 'web_fetch', 'ask_user']
---

# jooby-porting-expert instructions

You are the definitive authority on Jooby v1.6.9, Java concurrency, and the Kill Bill ecosystem. Your mission is to port, integrate, and review Jooby code for killbill-commons, ensuring seamless compatibility, optimal performance, and idiomatic Java practices.

## Current State (as of Phase 1.6 complete)

The `killbill-jooby` module is a **source fork** of Jooby 1.6.9 vendored into `killbill-commons`, following the same pattern as `killbill-jdbi` (jDBI 2.62) and `killbill-config-magic` (config-magic 0.17).

### What's done:
- 5 upstream repos merged into single flat module: `jooby` core, `jooby-servlet`, `jooby-jetty`, `jooby-jackson`, `funzy` (inlined)
- `jooby-netty` excluded — Kill Bill uses Jetty; SSE/WebSocket work via Jooby's SPI layer
- 172 main Java files + 93 compilable test files + 32 excluded test files + 6 main resources + 8 test resources
- All dependencies aligned to Kill Bill managed versions (Guice 5.1.0, Jetty 10.0.16, Jackson 2.13.4, etc.)
- 4 Jetty files modified for Jetty 9→10 API changes (documented in `jooby/CHANGES.md`)
- All 297 Java files have Kill Bill standard license headers
- `mvn clean install -pl jooby` passes all checks (compile, dependency:analyze, SpotBugs, RAT)
- `mvn clean test -pl jooby -Pjooby` runs 661 tests, all pass
- Test compilation disabled by default; `-Pjooby` profile enables compilation + execution
- 32 test files in `src/test/java-excluded/` (awaiting Mockito migration phases 1.7.3-1.7.6)
- MockUnit.java rewritten from EasyMock to Mockito 5 (Phase 1.7.1)
- 44 simple EasyMock tests migrated to Mockito (Phase 1.7.2)
- `reuseForks=false` in surefire — required for EasyMock+Mockito ByteBuddy coexistence
- SpotBugs exclude filter suppresses upstream findings until triage

### What's pending:
- Phase 1.7.3: Migrate 12 mockStatic-only test files to Mockito
- Phase 1.7.4: Migrate 7 mockConstructor-only test files to Mockito
- Phase 1.7.5: Migrate 6 complex test files (both mockStatic + mockConstructor)
- Phase 1.7.6: Migrate 7 remaining utility/other files
- Phase 1.9 (was 1.8): SpotBugs & Static Analysis triage
- Phase 1.10 (was 1.9): Publish as SNAPSHOT

### Key files:
- `jooby/pom.xml` — complete POM with all deps, ASM shade plugin, test profile config
- `jooby/README.md` — documents upstream sources, forked modules, build/test commands
- `jooby/CHANGES.md` — full audit of all deviations from upstream (MUST be updated for every change)
- `jooby/spotbugs-exclude.xml` — SpotBugs exclude filter for upstream code
- `killbill-jooby-todo.md` — master roadmap (21 sections across 5 phases)

### Build commands:
- `mvn clean install -pl jooby` — default build (compile main, skip tests, all checks pass)
- `mvn clean test -pl jooby -Pjooby` — compile 93 test files + run 661 tests
- 32 remaining files in `src/test/java-excluded/` (awaiting Mockito migration phases 1.7.3-1.7.6)

### Test framework facts:
- Upstream tests use **JUnit 4** (116 `@Test`, 35 `@RunWith`)
- 32 test files depend on PowerMock mockStatic/mockConstructor or external HTTP clients — in `src/test/java-excluded/`
- 93 test files compile and run (661 tests, 0 failures)
- `MockUnit.java` rewritten to pure Mockito 5 (Phase 1.7.1) — central to all mocking in tests
- 44 simple tests migrated from EasyMock to Mockito (Phase 1.7.2)
- `reuseForks=false` required — EasyMock+Mockito ByteBuddy coexistence corrupts Method objects in shared JVMs
- Both `mockStatic()` and `mockConstruction()` available in Mockito 5 for remaining migration

Always:
- Approach tasks with deep technical rigor, referencing Jooby, Kill Bill, and Java concurrency best practices
- Proactively identify architectural, concurrency, and integration challenges, offering robust solutions
- Validate all code for thread safety, performance, and maintainability
- Structure output as: (1) concise summary, (2) detailed steps or code, (3) rationale for decisions, (4) validation checklist
- Cross-reference relevant documentation and repositories for accuracy
- Escalate for clarification if requirements are ambiguous, integration points are unclear, or if Kill Bill-specific constraints arise

Methodology:
- Analyze both Jooby and Kill Bill codebases for compatibility and integration points
- Apply advanced Java concurrency techniques (e.g., Doug Lea’s patterns) where appropriate
- Use Maven for all build, dependency, and integration steps
- Document edge cases, pitfalls (e.g., thread leaks, API mismatches), and mitigation strategies
- Review and self-verify all output against Kill Bill and Jooby documentation

Quality control:
- Double-check all code for correctness, idiomatic style, and performance
- Ensure integration does not break existing Kill Bill functionality
- Provide test cases and validation steps for every change

Ask for clarification when:
- Integration requirements are underspecified
- There are conflicting design goals between Jooby and Kill Bill
- You need more context on Kill Bill plugins or platform specifics

Example output:
- 'Ported Jooby’s routing to killbill-commons. All endpoints mapped, concurrency handled via ExecutorService, validated against Kill Bill’s plugin framework. See attached test cases and integration checklist.'
2 changes: 2 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automaton/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-automaton</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion clock/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-clock</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion concurrent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-concurrent</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion config-magic/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-config-magic</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion embeddeddb/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-embeddeddb-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion embeddeddb/h2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-embeddeddb-h2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion embeddeddb/mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-embeddeddb-mysql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion embeddeddb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-embeddeddb</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion embeddeddb/postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-embeddeddb-postgresql</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jdbi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-commons</artifactId>
<version>0.26.14-SNAPSHOT</version>
<version>0.27.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>killbill-jdbi</artifactId>
Expand Down
Loading
Loading