detekt / detekt

Static code analysis for Kotlin
https://detekt.dev
Apache License 2.0
6.27k stars 773 forks source link

Publish previous JSON Schema versions to the JSON Schema Store #5895

Open VictorIreri opened 1 year ago

VictorIreri commented 1 year ago

Context

The JSON schema URL, specified in configurations.md, is now versioned and the docs were recently updated for the latest version in https://github.com/detekt/detekt/pull/5881. However, only the latest JSON schema (1.22.0) is available in the Schema Store.

Expected behaviour

  1. All supported versions of detekt should have their schemas uploaded to the JSON Schema Store.
  2. The JSON schema itself should support multiple versions so that supported IDEs can automatically source and apply the correct one.
  3. Document the release strategy for patch versions in CONTRIBUTING.md and consider if releasing patches 1.21.1 & 1.22.1 to update the broken JSON Schema URLs in the versioned website docs is worthwhile or, if possible, the change is trivial enough to update the existing versions.   v1.21.0 https://github.com/detekt/detekt/blob/f081ebe6f99d9069a3a7aa43e354c4aff4a7bc59/website/versioned_docs/version-1.21.0/introduction/configurations.md?plain=1#L165 v1.22.0 https://github.com/detekt/detekt/blob/f081ebe6f99d9069a3a7aa43e354c4aff4a7bc59/website/versioned_docs/version-1.22.0/introduction/configurations.md?plain=1#L182 main branch https://github.com/detekt/detekt/blob/f081ebe6f99d9069a3a7aa43e354c4aff4a7bc59/website/docs/introduction/configurations.md?plain=1#L182

Actual behaviour

Users on detekt versions prior to 1.22.0 are not informed of where to get the JSON schema from since the schemas don't exist in the Schema Store. Also, some IDEs automatically source and apply the latest schema (1.22.0) regardless of the detekt version in the project which may lead to confusion.

cortinico commented 1 year ago

Related to #4162

TWiStErRob commented 1 year ago

Also, some IDEs automatically source and apply the latest schema (1.22.0) regardless of the detekt version in the project which may lead to confusion.

Probably a feature request for detekt/detekt-intellij-plugin...

3flex commented 1 year ago

All supported versions of detekt should have their schemas uploaded to the JSON Schema Store

We only support the latest version, so in a way we're already do this :)

Instead of going back to populate old versions we could instead make updating this part of the release process and make sure all future releases are versioned.

BraisGabin commented 1 year ago

Do we even publish those? I think that right now we are not doing it.

3flex commented 1 year ago

It's current as there is a schema for 1.22 already available. I'm saying we should update and version the schema with each new release from now on but not go back and provide older schemas, just to limit the scope of work.

cortinico commented 1 year ago

I'm saying we should update and version the schema with each new release from now on but not go back and provide older schemas, just to limit the scope of work.

Agree. If we hook this in the release workflow I can take care of it 👍

detekt-ci commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Please comment or this will be closed in 7 days.