Add "Get help" on local tooling failures + Crisp trigger events#5383
Merged
Conversation
Some signups never reach their first cloud build because setup happens
locally and the server is blind to why people give up. This adds a
user-initiated support path: when a local step fails (install /
create_project / configure / local_run / build_submit), the tooling shows
a "Get help" affordance; running `mvn cn1:get-help` opens a dialog that
pre-fills the account email, gathers the failure context automatically,
and — only on an explicit Send — POSTs it to
`cloud.codenameone.com/api/v2/tooling/help`. Nothing is ever sent without
an explicit action.
Client (maven plugin, package com.codename1.maven.help, Java 1.7):
- ToolingHelpReport: context capture + client-side truncation (short<=64,
medium<=512, errorDetail<=16KB), hand-rolled JSON, email omitted when
unknown.
- ToolingHelpClient: POST + flat-JSON parse, step->help-article map, never
throws (offline/non-2xx -> UNREACHABLE fallback). Sends a real
User-Agent — the WAF 403s the default "Java/<ver>" agent, which would
silently fail every send from a JDK 8 machine (this feature's audience).
- Response contract {ticketId, token, chatUrl}. Two paths:
* email present -> "We've got it — #{ticketId}. We'll reply to {email}."
* no email -> open the browser to {chatUrl}#t={token} (token-gated
page drops the user into a live Crisp chat carrying the report); never
a false "we'll reply" promise.
Forward-compatible: missing token degrades to the bare chat URL.
- errorDetail is the reproduction support reads: env/command header
(step, exact command, JAVA_HOME, java.home, proxy, versions) + full
stack trace.
- Goal cn1:get-help (GetHelpMojo, requiresProject=false) replays the
persisted failure; capture wired via the AbstractCN1Mojo.execute() choke
point + helpStep()/helpAction() overrides, plus a direct hook in
GenerateAppProjectMojo. BrowserOpener is injectable so tests never launch
a browser.
- 30 JUnit4 tests (truncation, JSON, token/deep-link, both response paths,
network-failure fallback, User-Agent, EOF/decline = no send).
Website (docs/website/assets/js/cn1-crisp.js): fire Crisp session:events for
the T1-T5 automated campaigns, inside loadCrisp() so they only run once chat
consent is given. Once-per-view + once-per-session dedupe. Events:
ConsoleDwell60, SigningScreenView, GettingStartedDwell, PricingEvaluator
(+ exit-intent), and a window.cn1CrispEvents hook for BuildError (which is
fired by the external console app, not this repo).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Cloudflare Preview
|
Collaborator
Author
|
Compared 145 screenshots: 145 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 168 screenshots: 168 matched. |
The EOF signal used a String sentinel compared with `==`, which SpotBugs flags (ES_COMPARING_STRINGS_WITH_EQ) and failed build-test (8). The sentinel literal had also picked up a stray NUL byte. Replace it with a plain null-for-EOF contract (empty string already means "user chose no email"), removing both the reference comparison and the NUL. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 138 screenshots: 138 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 144 screenshots: 144 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 216 screenshots: 216 matched. |
Collaborator
Author
|
Compared 139 screenshots: 139 matched. |
Collaborator
Author
|
Compared 143 screenshots: 143 matched. Benchmark Results
Detailed Performance Metrics
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Some signups never reach their first cloud build. Setup happens locally (install tooling → create project → build), so the server is blind to why people give up. This adds a user-initiated support path on local failures — nothing is telemetry, nothing is sent without an explicit click — and finally gives us visibility into where local setup breaks.
What
Get Help client (Maven plugin,
com.codename1.maven.help, Java 1.7)install/create_project/configure/local_run/build_submit) the tooling prints a "Get help" affordance. Runningmvn cn1:get-helpopens a dialog that pre-fills the signed-in account email (from Preferences/com/codename1/ui), auto-gathers the failure context, and — only on an explicit Send — POSTs tocloud.codenameone.com/api/v2/tooling/help.{ticketId, token, chatUrl}, two paths:We've got it — #{ticketId}. We'll reply to you at {email}.(optional Chat-live →{chatUrl}#t={token}).{chatUrl}#t={token}; the token-gated page fetches the report and drops the user into a live Crisp chat. Never a false "we'll reply" promise.tokendegrades to the bare chat URL.errorDetailis the reproduction support reads: an env/command header (step, exact failing command,JAVA_HOME,java.home, proxy, versions) + the full stack trace, truncated client-side to 16 KB.AbstractCN1Mojo.execute()choke point +helpStep()/helpAction()overrides, plus a direct hook inGenerateAppProjectMojo.BrowserOpeneris injectable so tests never launch a browser.Crisp trigger events (
docs/website/assets/js/cn1-crisp.js)Fire the named
session:events that launch the T1–T5 automated campaigns, insideloadCrisp()so they only run once chat consent is given. Once-per-view and once-per-session dedupe:ConsoleDwell60,SigningScreenView,GettingStartedDwell,PricingEvaluator(dwell + upward exit-intent).BuildErroris fired by the external console app (not this repo); exposed here aswindow.cn1CrispEvents.buildError().Testing
help/(truncation caps, JSON + email-omission, token/deep-link parsing, both response paths, network-failure fallback, User-Agent, EOF/decline = nothing sent). Full suite: 47/47, no regressions on the touched mojos.cn1:runfailure → affordance →cn1:get-help→ no-email send returned a token and openedhttps://cloud.codenameone.com/tooling-help.html#t=<token>.Follow-ups (not in this PR)
help.codenameone.comarticle slugs inToolingHelpClient.HELP_ARTICLES(safe defaults for now).scripts/) aren't wired yet; the core here is UI-agnostic and reusable for them.🤖 Generated with Claude Code