feat(integration): add Java (Spring Boot) as a full example-based variant - #270
Conversation
🧙 Wizard CIRun the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands: Test all apps:
Test all apps in a directory:
Test an individual app:
Show more apps
Results will be posted here when complete. |
…iant Add a Java integration variant anchored on a real Spring Boot example app (example-apps/java-spring-boot): the posthog-server client is exposed as a singleton @bean configured from the environment, flushed and closed on shutdown via destroyMethod="close". A controller identifies users, captures events, evaluates feature flags with evaluateFlags, and reports errors as an explicit event (the Java server SDK has no automatic exception capture, documented honestly rather than faked). Ships a full Spring Boot example rather than docs-only so the wizard has a concrete shape to match for the most common Java backend framework. Adds a java-server commandments block, keyed java-server (not java) so these backend rules never fold into the Android skill, which carries the java tag; the variant is tagged [java, java-server]. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
7f36566 to
7dfb504
Compare
|
Full e2e run of this PR pair (wizard #948 + context-mill #270, both with main merged in) against spring-projects/spring-petclinic. Set up, one honest conflict — the runner has no JRE so the agent could not self-verify. Idiomatic Spring: Dashboard and notebook created through prod MCP. Compiles clean, but petclinic's own Note: the context-mill branch as filed fails at the dashboard step — its agent prompts predate the |
evaluateFlags() makes a network call. Wrap it in try/catch so a slow or down PostHog can't 500 the /dashboard page (fall back to the flag off), matching the Elixir example's behavior. Add a note that a real app should cache/bound the call rather than fetch per render. Also document that distinctId must come from an authenticated principal, not an unverified request parameter, so the copied pattern doesn't invite person-property spoofing. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2c4d668 to
c566706
Compare

























Adds a full example-based Java integration variant (not docs-only), anchored on a real, compiling Spring Boot app at
example-apps/java-spring-boot— the most common Java backend framework, called out specifically in review.What's here:
example-apps/java-spring-boot/—posthog-serverclient as a singleton@Beanconfigured from the environment, flushed + closed on shutdown viadestroyMethod="close". A controller identifies users, captures events, evaluates feature flags withevaluateFlags, and reports errors as an explicit event (the Java server SDK has no automatic exception capture — documented, not faked).gradle compileJavaclean.config.yaml: newjavafull variant, tagged[java, java-server].commandments.yaml:java-serverblock — keyedjava-server(notjava) so backend rules never fold into the Android skill, which carries thejavatag.Ships as a pair with the wizard detection PR PostHog/wizard#948.