PY-77813: Report new project type broken in NPW.

FUS statistics consists of two parts:
1. Interpreter (i.e "venv" or "conda")
2. Project generator type ("Django" or "Flask")

`com.jetbrains.python.newProjectWizard.collector.PythonNewProjectWizardCollector.GENERATOR_FIELD` was a class without any limitation and `DirectoryProjectGenerator` instance was reported (i.e one for Django).

When migrated to NPW, we:
1. Dropped most old generator classes
2. Called this function providing `this::class` by accident, and it was `CoroutineScope`, so we finished with lots of `CoroutineScope` as generator type in FUS.

We must:
1. Provide old names for project types to preserve statistics.
2. Make it type-safe this time.

We also found that interpreter statistics is nullable for `PySdkCreator` which isn't true: SDK creation statistics is always not null.

So we:
* Introduce interface for project generators that reports "name for the statistics"
* Implement it both for DS and PyCharm by returning class name by default
* Overwrite it for several well-known generators to preserve statistics (use old named of now-deleted classes)
* Make interpreter statistics not null.


(cherry picked from commit bdfa73ba043d3584c6ba1871bca7a464a550bc21)

KT-CR-19191

GitOrigin-RevId: 53f874c18d67d33083cf8508a58be257b5e89ab7
This commit is contained in:
Ilya.Kazakevich
2024-12-03 01:05:02 +01:00
committed by intellij-monorepo-bot
parent fa7590530b
commit 5666495862
12 changed files with 127 additions and 41 deletions

View File

@@ -158,5 +158,7 @@
<orderEntry type="library" name="kotlinx-datetime-jvm" level="project" />
<orderEntry type="module" module-name="intellij.platform.ide.remote" />
<orderEntry type="module" module-name="intellij.platform.ide.ui" />
<orderEntry type="library" name="jackson-module-kotlin" level="project" />
<orderEntry type="library" name="ap-validation" level="project" />
</component>
</module>