Skip to content

ADFA-4128 (2/11): shared plumbing Quick Build builds on - #1714

Draft
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-01-docsfrom
feature/ADFA-4128-qb-02-plumbing
Draft

ADFA-4128 (2/11): shared plumbing Quick Build builds on#1714
fryanpan wants to merge 2 commits into
feature/ADFA-4128-qb-01-docsfrom
feature/ADFA-4128-qb-02-plumbing

Conversation

@fryanpan

@fryanpan fryanpan commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Part 2/11 of the stacked split of #1669 (requested by Akash). Base: feature/ADFA-4128-qb-01-docs. Stack overview + review mechanics: PR 1 (#1713). Terms are defined in quickbuild/README.md (lands in PR 1).

Lays the groundwork in Code on the Go that the rest of Quick Build needs, including the flag that keeps it hidden until it is ready. Nothing here changes what a user sees.

flowchart TB
    subgraph host["<b>This PR: host-side surface inside existing modules</b>"]
        ff["FeatureFlags<br/>dark-ship gate<br/><i>FeatureFlags.kt</i>"]
        tm["ToolsManager<br/>stages daemon jar +<br/>runtime AAR from assets<br/><i>ToolsManager.java</i>"]
        bs["BuildService<br/>hand-back hook after a<br/>standard Gradle build<br/><i>BuildService.kt</i>"]
        fb["FlashbarActivityUtils<br/>keyed debouncing action<br/><i>FlashbarActivityUtils.kt</i>"]
        pm["ProjectManagerImpl.generateSources<br/>now reports dispatched vs refused<br/><i>ProjectManagerImpl.kt</i>"]
        ui["QB toolbar icons, strings,<br/>TooltipTag help entry"]
    end
    later["Quick Build proper (PRs 3-11)"] -. "reads the flag" .-> ff
    later -. "extracts tools" .-> tm
    later -. "receives hand-back" .-> bs
    later -. "shows notices" .-> fb
    classDef thisPrBox fill:#dbeafe,stroke:#93c5fd,color:#1e3a5f
    classDef inPr fill:#ffffff,stroke:#64748b,color:#000
    class host thisPrBox
    class ff,tm,bs,fb,pm,ui inPr
Loading

What to review

  • ProjectManagerImpl.kt — generateSources now reports dispatched vs refused. Return-contract change; review closely.
  • FeatureFlags.kt — the dark-ship flag gating every Quick Build surface.
  • ToolsManager.java, BuildService.kt, FlashbarActivityUtils.kt — asset staging, build hand-back, debounced notices. Skim.
  • settings.gradle.kts — untouched here; each module PR adds its own include.
  • analyze.yml — REQUIRE_BUILD_TOOLCHAIN=1 turns a missing SDK into a hard failure.

Coverage — no JVM-measured files. All 12 source files this PR touches are edits to modules the pass does not instrument (common, editor, subprojects/projects, subprojects/flashbar, idetooltips, gradle-plugin-config, build-logic); the pass covers app, gradle-plugin, and quickbuild/* only. The PR's four new unit tests run in their own modules' suites.

Review fixes (2026-08-22)

A review-fixes commit addresses the code-review findings. One change here deliberately ships to all users, with the Experiments flag off (approved):

  • Tooling-jar hardening. Benefit: the IDE can no longer be permanently broken by an interrupted first launch. CoGo copies its build engine (a jar) out of the app package onto disk at startup. It used to copy straight to the final location -- killed mid-copy, a half-written jar sat there looking valid, and every project build failed until reinstall. Now it copies to a temp file and atomically renames, so the jar on disk is always either the old one or the complete new one, never torn; a version stamp skips the copy when it's already current, so startup is faster too. This can't usefully be gated: a torn jar breaks every user regardless of the flag. The flashbar dismissal change, by contrast, is now gated behind the flag.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W

…set staging, build-service hooks, shared utilities

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-02-plumbing branch from 0f2943d to f2bab90 Compare August 22, 2026 06:41
Important 1 (flashbar tap/swipe dismissal shipped flag-off): gated behind
FeatureFlags.isExperimentsEnabled via indefiniteErrorBarDismissesOnTouch()
(new FlashbarDismissGate.kt, JVM-pure so unit tests can load it). The change
was Quick-Build-driven (bar occludes the toolbar's Run/Quick Build buttons);
for flag-off users an accidental brush must not dismiss an unread error, so
they keep Dismiss-button-only until this ships on its own sign-off. Covered
by FlashbarDismissGateTest (flag-off test fails without the gate).

Important 2 (tooling-jar stamp-skip + atomic rename shipped flag-off): left
un-gated, with a code comment saying why — a torn jar kills project init for
every user, Quick Build or not, so gating it would leave flag-off users
exposed. Marked "ships flag-off — needs Bryan sign-off". Logic extracted into
isToolingJarCurrent/extractToolingJar (@VisibleForTesting) so it is
JVM-testable; behavior unchanged.

Test gap (ToolsManager.updateToolingJar): ToolsManagerToolingJarTest covers
stamp-match skip, stamp-mismatch/missing-jar/missing-stamp/null-stamp
re-extract, atomic copy leaving no .part and stamping only after the rename,
and the rename-failure path writing no stamp (fails if the stamp were
written before the rename).

Test gap (FeatureFlags semantics): FeatureFlagsTest covers the loaded latch,
failed-read-retries-on-next-initialize, and refresh() replacing a latched
all-false (direct-boot) snapshot. Enabled by a JVM test seam
(flagFileResolver + resetForTest; downloadsDir made lazy) instead of
Robolectric — common has no Robolectric dep and none was added.

Test gap (generateSources Boolean contract):
ProjectManagerImplGenerateSourcesTest pins false on null service / server
down / build in progress and true on dispatch, which the later Quick Build
deferral keys its retry off.

Adjacent minors while editing those lines: log ignored stamp-write failure
in ToolsManager; reworded the dangling GenerateSourcesDeferral KDoc link in
ProjectManagerImpl.generateSources to prose.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kj9YeCDHGp9DU8LPtfWJ7W
@fryanpan
fryanpan force-pushed the feature/ADFA-4128-qb-02-plumbing branch from f2bab90 to 0a584d0 Compare August 22, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant