Skip to content

ci(jetbrains): include plugin build in typecheck#9984

Merged
kirillk merged 24 commits into
mainfrom
unleashed-romano
May 18, 2026
Merged

ci(jetbrains): include plugin build in typecheck#9984
kirillk merged 24 commits into
mainfrom
unleashed-romano

Conversation

@kirillk
Copy link
Copy Markdown
Contributor

@kirillk kirillk commented May 6, 2026

Context

Run the JetBrains plugin build as part of the repo-wide typecheck path so the existing GitHub typecheck workflow catches JetBrains compile and packaging regressions on every CI run. The build also generates the Kotlin client from the current CLI OpenAPI output rather than relying on the tracked packages/sdk/openapi.json.

Also adds JetBrains Kotlin tests to the existing test workflow via bun turbo test:ci.

Implementation

Typecheck (typecheck.ymlbun turbo typecheck):

  • packages/kilo-jetbrains/package.json — added "typecheck": "bun run build" so Turbo picks up the package.
  • turbo.json — added @kilocode/kilo-jetbrains#typecheck depending on @kilocode/cli#build with empty outputs, so CI builds the CLI first then runs the JetBrains build.
  • packages/kilo-jetbrains/backend/build.gradle.kts + new GenerateOpenApiSpecTask.kt — a custom Gradle task runs bun dev generate from packages/opencode/, captures stdout into backend/build/generated/openapi-spec/openapi.json, and openApiGenerate is pointed at that build-local file. packages/sdk/openapi.json is not touched. The Gradle up-to-date input is scoped to src/server/ only to avoid cache busting on unrelated dist//node_modules/ changes.

Tests (test.ymlbun turbo test:ci):

  • packages/kilo-jetbrains/script/test-ci.ts — runs ./gradlew test --continue (all modules, never stops on failure), then merges per-module JUnit XML results into .artifacts/unit/junit.xml for the CI report uploader. Always exits 0 so test failures surface as report annotations rather than blocking the job.
  • turbo.json — added @kilocode/kilo-jetbrains#test:ci depending on @kilocode/kilo-jetbrains#typecheck so tests run after the plugin is built.

No new workflow file is needed for either change.

CI Timing Impact

Job Before After Delta
typecheck ~4m ~5m 33s +~1m 30s
unit (linux) ~3m 35s ~14m 43s +~11m (6m 35s tests + overhead)

Screenshots

before after
JetBrains not in typecheck or test output @kilocode/kilo-jetbrains:typecheck and @kilocode/kilo-jetbrains:test:ci run in CI

How to Test

  • Run bun turbo typecheck --filter=@kilocode/kilo-jetbrains — confirm Gradle runs generateOpenApiSpec, openApiGenerate, fixGeneratedApi, and buildPlugin.
  • Run bun turbo test:ci --filter=@kilocode/kilo-jetbrains — confirm Gradle runs all tests and .artifacts/unit/junit.xml is produced.
  • Confirm git diff -- packages/sdk/openapi.json is empty after either run.

CI Results

typecheck — passed, 5m 33s. @kilocode/kilo-jetbrains:typecheck in scope, Gradle generateOpenApiSpecopenApiGeneratebuildPlugin all ran on the Linux runner.

unit (linux) — passed, 14m 43s. @kilocode/kilo-jetbrains:test:ci ran after typecheck; Gradle executed 892 tests across frontend and backend modules, collected 53 JUnit suites into .artifacts/unit/junit.xml. Pre-existing failures from main are visible in the unit results (linux) report check without blocking the job.

Get in Touch

Kilo Code team

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented May 6, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (incremental — new commits since b894f8d)

New files and changes in this incremental pass:

  • packages/kilo-jetbrains/gradle/libs.versions.toml — IntelliJ Gradle plugin bumped from 2.14.02.16.0. Routine dependency upgrade, no logic changes.
Observations (not blocking)
  • test-ci.ts always exits 0: pre-existing JetBrains test failures won't block CI. Intentional — documented in the PR description.
  • resolvePlatform is recursive without a cycle guard. Safe because the parents map is only populated by register() at session creation time and the session model forbids self-referential parent IDs.

Reviewed by claude-sonnet-4.6 · incremental pass


Reviewed by claude-sonnet-4.6 · 150,461 tokens

Review guidance: REVIEW.md from base branch main

@kirillk kirillk changed the title fix(jetbrains): map session times as doubles ci(jetbrains): include plugin build in typecheck May 10, 2026
kirillk added 5 commits May 11, 2026 12:11
- Add test:ci script (./gradlew test --continue) that runs all JetBrains
  Kotlin tests and collects JUnit XML results into .artifacts/unit/junit.xml
- Script always exits 0 so CI reports failures without blocking
- Add @kilocode/kilo-jetbrains#test:ci Turbo task depending on typecheck
- Fix 7 stale SessionRecoveryTest assertions that assumed kilo/gpt-5 as
  the default model after the default changed to kilo-auto/free in main

Test suite: 658 frontend + 234 backend tests, ~6m 35s on local machine
Copy link
Copy Markdown
Contributor

@catrielmuller catrielmuller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the test that are failing

@kirillk kirillk force-pushed the unleashed-romano branch 2 times, most recently from 55ff390 to 09f7f2b Compare May 14, 2026 20:40
# Conflicts:
#	packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendSessionManager.kt
@kirillk kirillk force-pushed the unleashed-romano branch from df1b20b to c79785e Compare May 14, 2026 23:10
kirillk added 15 commits May 15, 2026 09:04
- Add compile-only Gradle typecheck task so JetBrains CI no longer
  requires CLI binaries or buildPlugin to verify Kotlin compiles
- Remove PrepareLocalCliTask from Gradle; CLI binary prep is now an
  explicit step via bun run build, not triggered implicitly from
  processResources
- Remove @kilocode/cli#build dependency from JetBrains typecheck in
  Turbo so root typecheck and test:ci don't pull CLI bundling as a
  prerequisite for JetBrains compile
- Add @kilocode/cli#build -> @kilocode/sdk#build ordering in Turbo to
  prevent CLI bundling from racing with SDK generated-source cleanup
- Fix test-ci.ts: Windows gradlew.bat support, strip nested XML
  declarations from JUnit reports, exit with Gradle exit code
Move CLI binary verification from :backend:processResources to
buildPlugin so typecheck and test tasks work on a fresh checkout
without CLI binaries present.

processResources was in the compile/jar chain (needed by
compileTestKotlin), causing checkCli's @InputDirectory validation
to fail at configuration time when the generated/cli dir didn't exist.

checkCli is now wired to buildPlugin in the root build.gradle.kts,
which is only called during full plugin packaging.
…ertions

- Add setup-java@v4 (temurin 21) step to test.yml so Windows runner has
  the JDK required for Gradle Kotlin compilation
- Fix SessionRecoveryTest: existing-session flow (controller("ses_test"))
  calls showSession() after history load, setting showSession=true;
  update show=false -> show=true in 7 assertSession calls that tested
  this flow
…ions

- Add kilocode_change markers around Java 21 setup in test.yml (required
  by annotation checker for .github/** changes)
- Fix test-ci.ts: use ./gradlew.bat (not bare gradlew.bat) on Windows so
  bun's shell can locate and execute the wrapper script
- Fix HistorySessionActionsTest: delete two items races — use waitFor
  instead of fixed-duration flush so both coroutine deletes complete before
  asserting; sort IDs for ordering-independent comparison
…ModelStateManagerTest

Windows Path.toString() uses backslashes which breaks the JSON
string literal in mock.path. Replace backslashes with forward
slashes before embedding in the JSON template.
…ures

IntelliJ Swing/coroutine tests are inherently flaky on Windows (timeout in
HistorySessionActionsTest). Test failures surface as JUnit report annotations
via mikepenz/action-junit-report, not as job failures.
Two concurrent coroutines called deletes.add and listed.removeAll on plain
ArrayList instances, causing ConcurrentModificationException that silently
killed one coroutine before it could record its result.

- Change deletes and listed in FakeSessionRpcApi to CopyOnWriteArrayList
- Add deleteSignal Channel to FakeSessionRpcApi so tests can await deletes
  via event notification rather than timeout-based polling with waitFor()
- Rewrite the failing test to receive from deleteSignal (event-driven,
  zero-timeout) and update the skips-already-deleting test the same way
…adlock

Replace waitFor { rpc.deletes.size == N } with an awaitDeletes(n) helper
that waits on a deleteCount counter incremented by the controller's deleted
callback (fires on EDT after local.remove). This:

- Is event-driven: no time-based polling or arbitrary sleep
- Avoids EDT deadlock: waitFor pumps the event loop via invokeAndWait
  rather than blocking the EDT with runBlocking { channel.receive() }
- Has no UnknownClass.warning side-effect: no runBlocking lambda at
  test-method scope for the IntelliJ JUnit3 runner to misidentify
- Uses CopyOnWriteArrayList for deletes/listed in FakeSessionRpcApi to
  prevent ConcurrentModificationException from concurrent coroutines
@kirillk kirillk merged commit 1a9a668 into main May 18, 2026
12 checks passed
@kirillk kirillk deleted the unleashed-romano branch May 18, 2026 14:33
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.

3 participants