* fix: apply Sentry and PostHog telemetry settings correctly
Now we are very strict about telemetry config. If anything fails (plugin service is null, no/invalid config response, etc.), the flag falls back to false.
More details:
* Because we need to poll settings ourselves (via getSerializedProfileInfo), I created a new service that holds that setting.
* This service implements an interface to allow separation that enables us to write unit tests. Unit tests only cover PostHog telemetry behavior. I tried to write tests for Sentry, but it’s problematic because the initialization is static and I couldn’t mock it (mockkStatic doesn’t work). I decided not to spend more time on it, especially since the telemetry checks are identical to PostHog (it's just `if`). I think that should be enough.
* Status polling is lazy, so as long as no one asks for allowAnonymousTelemetry (so if no error occurs), polling is inactive. This is a side effect of having it as a service, but I think it’s a nice feature in this context.
* If telemetry is disabled but the user submits an error via the Report to Continue dialog, will be sent anyway (because this is an explicit decision). This action is one-time and does not change the global telemetry settings.
To summarize, we now have three services:
* ContinueTelemetryStatusService - holds state in a non-blocking way and handles polling itself
* ContinuePostHogService - previously TelemetryService
* ContinueSentryService - previously ContinueErrorService
* fix: retrieve telemetry status service from the first project
The tests use fixtures and operate on real files in a temp directory.
This change will allow us to confidently migrate from java.io.File to VFS.
Note: These tests are headless and starts the Continue binary. This gives us many possibilities because we can write fast and valuable tests without runIdeForUiTests.
The IntelliJ Platform plugin already includes classes like BasePlatformTestCase written in JUnit 3, which we should be using for unit testing.
We also have JUnit 5 for e2e testing. As a result, we had two different runners, which caused problems because we couldn’t use classes like UsefulTest since they required a different runner.
In order to fix that, I had to add `org.junit.vintage:junit-vintage-engine` to enable running both JUnit 3 and JUnit 5 tests.
Note: ideally, we should have a sourceSet named testIntegration with its own dependencies for E2E (robot, JUnit 5, video recorder).
That would give us a clean separation between E2E tests and unit tests. That would prevent accidental use of JUnit 5 classes in unit tests. We should do that in the future.
The new platform simplifies plugin config and allows us to remove some of the custom code.
I left the original Qodana and Kover configs, but looking at our workflow, i think it's currently dead code.
If we don’t plan to use them, I think we can remove these dependencies in the future.
Note: along with this migration, I had to bump a wrapper to latest version.
For some reason, we included the Kotlin standard library with the plugin, even though we had a property specifying we didn’t want to.
I saw no objections to removing this dependency, so I decided to do that.
From now on, we rely on older stdlib that's bundled with 2022.3+.
More context: https://github.com/continuedev/continue/pull/6431#issuecomment-3031838189
This proves my point regarding the removal of the standard library dependency.
I added plugin verification against versions 2022.3.3 (oldest) and 2025.1.4 (newest). Everything is working.
Plugin can be verified with `./gradlew verifyPlugin`. We can consider adding this to CI later.
I made a few small improvements that simplify the build scripts:
* Some properties were removed because they duplicated content from `plugin.xml` (e.g., supported version numbers, plugin ID, and similar - all were unnecessarily overridden inside `intellij {}`/`intellijPlatform {}`).
* I replaced `prepareSandbox` with a separate task that is now a dependency of all `runIde` tasks, so there is no need to declare each case individually.
* From now on, properties are read via delegation instead of calling our custom `properties(...)` function. This is type-safe (if a property is not declared, the build will fail).
* I removed the `kotlin("test")` dependency, which we were only using for `assertTrue`.
The e2e Autocomplete tests are very flaky, and unfortunately, I haven’t been able to find a solution yet. I will try to address this in upcoming fixes.
I believe that ultimately we should have max one e2e test describing the happy path, and the rest of the features should be tested with unit tests.
Our e2e tests are very inconvenient, which results in no one running them (because we hijack the input), so they should be kept to a minimum.
The rest of the e2e tests were already disabled (I assume I know why :D), so I didn't touch them.
Fun fact: with the removal of the standard library, we managed to remove all unnecessary dependencies except for Sentry and PostHog (which are included for obvious reasons).