Skip to content

Jetbrains: release plugin v0.1.0 - #9

Merged
rahulmahadik merged 13 commits into
mainfrom
develop
Jul 24, 2026
Merged

rahulmahadik merged 13 commits into
mainfrom
develop

Conversation

@rahulmahadik

Copy link
Copy Markdown
Owner

Promotes the CI-green develop to main so the first JetBrains Marketplace
release (jetbrains-v0.1.0) can be tagged. All JetBrains CI jobs are green on
develop: isolation-guard, build-and-test, verifyPlugin, integration-test, parity,
and root-monorepo-unaffected.

What's included (13 commits)

New: AskSQL plugin for JetBrains IDEs

Standalone pure-Kotlin/JVM plugin for every IntelliJ-Platform IDE (IDEA, DataGrip,
PyCharm, WebStorm, GoLand, PhpStorm, Rider, CLion, RubyMine, RustRover, Android
Studio; since-build 252). Chat + Schema tool windows, read-only-by-construction
guard, six databases (Postgres/MySQL/SQLite/DuckDB/Oracle/MongoDB) plus DuckDB
file querying, bring-your-own-model. Parity-tested against @asksql/core. Ships
with its own CI (jetbrains-ci.yml) and signed, tag-triggered release
(jetbrains-release.yml).

Plugin fix

  • Serialize the DuckDB connection validity probe with query execution: isValid()
    ran a SELECT outside the per-connection lock and raced concurrent queries.

JetBrains CI / test hardening

  • Run integration tests through the platform test task (classloader isolation).
  • Pin Testcontainers' UnixSocket strategy to avoid the platform-JNA clash on CI.
  • Gate the full verifyPlugin IDE matrix behind a release-only flag (fast per-push CI).
  • Parity job: disable setup-node@v5 pnpm auto-detect.
  • Test-side: MySQL TLS readiness probe, Oracle ORA-01466 settle-wait, portable
    eval-test report dir + Ollama skip guard.

Also carried from develop

  • fix(mongodb): default separate-auth authSource to admin; clearer Atlas errors.
  • ci: deploy API docs from develop only.
  • chore: ignore generated docs/api.

Standalone Kotlin/JVM plugin bringing AskSQL to every IntelliJ-Platform IDE
(IDEA, DataGrip, PyCharm, WebStorm, GoLand, PhpStorm, Rider, CLion, RubyMine,
RustRover, Android Studio; since-build 252). No Node runtime: a pure-JVM
engine, parity-tested against the published @asksql/core guard and prompts.

- Chat and Schema tool windows: ask in plain language, review the generated
  SQL or Mongo pipeline, approve, then run.
- Read-only by construction: a JSqlParser AST guard plus an enforced read-only
  JDBC session, and an allowlist-based MongoGuard for MongoDB.
- Six databases (Postgres, MySQL, SQLite, DuckDB, Oracle, MongoDB) plus
  DuckDB-backed querying of CSV/TSV/JSON/Parquet/Excel files with no server.
- Bring your own model: OpenAI/Anthropic/Gemini/Groq/NVIDIA/Azure or a local
  Ollama/LM Studio endpoint, over streaming SSE.
- Secrets live in the OS keychain (PasswordSafe); zero telemetry.
- Bundled JDBC drivers are redistributable only (pgjdbc, MariaDB, SQLite,
  MongoDB, JSqlParser, Gson). Oracle and DuckDB are downloaded on first use
  from Maven Central and SHA-256 verified, never redistributed in the zip.

CI (jetbrains-ci.yml) runs an isolation guard keeping the package outside the
pnpm workspace, the Gradle build/test suite, the Plugin Verifier across the IDE
matrix, Docker-backed integration tests, and core parity vectors. Releases are
tag-triggered (jetbrains-v*), signed, and published to the JetBrains
Marketplace by jetbrains-release.yml.
…odetect, verify matrix)

- integrationTest reused `test`'s classpath but not its platform test JVM setup,
  so the IntelliJ Platform's bundled classes (JNA) failed to load under the Linux
  CI classloader and every integration test errored at initialization. Mirror
  `test`'s idea.force.use.core.classloader + heap onto integrationTest.
- setup-node@v5 now defaults package-manager-cache:true, which detected the
  repo-root pnpm and ran it inside the isolated npm-only parity job (no pnpm
  installed there), failing with "pnpm not found". Disable it for that job.
- verifyPlugin resolved the full 12-IDE matrix on every push (~10 cold IDE
  downloads). Gate the cross-IDE matrix behind ASKSQL_VERIFY_FULL, set by the
  release workflow; per-push CI now verifies the IC floor+latest only.
…ion failure

The default test console truncates at the first cause, hiding the JNA root cause
behind `ExceptionInInitializerError at Native.java:230`. Print the full chain
(showCauses/showStackTraces/FULL) so the CI log carries it. Also drops the
earlier idea.force.use.core.classloader attempt on integrationTest, which did not
change the outcome.
…opied one

The `integrationTest` task set its classpath to a copy of `test.classpath` but
did not inherit IPGP's platform test setup (the core-classloader isolation). On
the Linux CI runner the IntelliJ Platform's bundled coroutines and JNA then won
over the test dependencies, failing every integration test at initialization
(NoSuchMethodError runBlockingK$default; "incompatible JNA native library"); it
passed locally only because a warm configuration cache masked the difference.
Run the integration category through the `test` task itself via
-PintegrationTests=true so those tests get the same setup as the unit tests.
…brary

With the coroutines skew resolved, the integration tests still failed on the CI
runner with "There is an incompatible JNA native library installed on this
system" - JNA picked up a mismatched jnidispatch from the runner instead of the
one bundled in its jar. Set jna.nosys=true so JNA only uses its bundled native
library.
…clash

jna.nosys did not help: the incompatible jnidispatch is the IntelliJ Platform's
own bundled 7.0.2, loaded via the platform's jna.boot.library.path, while
Testcontainers' JNA (5.13.0) expects 6.1.6. The clash is only reached through
RootlessDockerClientProviderStrategy's LibC probe. The runner uses rootful
Docker, so pin the UnixSocket strategy, which never loads that JNA path. Drop the
ineffective jna.nosys.
DuckDB's JDBC connection rejects concurrent statement execution ("Attempting to
execute an unsuccessful or closed pending query result") where pgjdbc and mariadb
serialize internally, so concurrent queries against one shared connection failed.
Route DuckDB through the same per-connection lock already used for Oracle.
These tests never ran to completion on CI before (they died at load on the
coroutines/JNA classpath issues); with those cleared, several test-side problems
surfaced:
- MySqlSslIntegrationTest: Testcontainers' readiness probe connected without TLS
  against a server mandating it; force sslMode=REQUIRED on the probe URL.
- OracleJdbcIntegrationTest: reads right after a seed INSERT hit ORA-01466
  (delayed block cleanout under the read-only transaction); settle the block with
  a plain read on the writable session in setup, and after the mid-test insert.
- EdgeCaseAccuracyEvalTest / FailedQuestionsRetestTest: REPORT_DIR was a hardcoded
  machine/session scratchpad path (FileNotFoundException off that box); write to
  java.io.tmpdir and skip the DuckDB variants when Ollama is unreachable.

No plugin/production code changed; the read-only enforcement is untouched.
The concurrent-queries failure survived the per-connection query lock because
ConnectionRegistry.acquire()'s validity probe calls Connection.isValid(), which
on DuckDB runs a real SELECT on the connection - outside that lock. So every
withConnection() fired an unserialized statement racing the locked query on the
same native connection, which DuckDB rejects ("Attempting to execute an
unsuccessful or closed pending query result"). Route the DuckDB probe through a
shared JdbcExecutor.withConnectionLock (computeIfAbsent for a single Mutex per
connection), so the probe serializes with queries. Oracle path unchanged.
Both Oracle tests hit ORA-01466 on the fresh CI XE container but not locally:
customers is created then read under SET TRANSACTION READ ONLY within ~1-2s, and
Oracle's coarse (~3s) SCN-to-timestamp rounding maps the read-only snapshot to
before the table's DDL. Block cleanout was the wrong mechanism (reverted). Wait
in setup, on the DB clock (SYSDATE vs USER_OBJECTS.LAST_DDL_TIME), until the
newest DDL is >10s old, so any later read-only snapshot maps strictly after it.
Bounded (~10s) and privilege-free; the plugin's read-only arming is untouched.
@rahulmahadik
rahulmahadik merged commit 08c799f into main Jul 24, 2026
11 checks passed
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