JetBrains / gradle-changelog-plugin

Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Apache License 2.0
266 stars 42 forks source link

Comparison method violates its general contract! #171

Closed JavierSegoviaCordoba closed 2 months ago

JavierSegoviaCordoba commented 1 year ago

Describe the bug

Caused by: java.lang.IllegalArgumentException: Comparison method violates its general contract!
    at kotlin.collections.CollectionsKt__MutableCollectionsJVMKt.sortWith(MutableCollectionsJVM.kt:42)
    at kotlin.sequences.SequencesKt___SequencesKt$sortedWith$1.iterator(_Sequences.kt:639)
    at kotlin.collections.MapsKt__MapsKt.putAll(Maps.kt:428)
    at kotlin.collections.MapsKt__MapsKt.toMap(Maps.kt:596)
    at kotlin.collections.MapsKt__MapsKt.toMap(Maps.kt:590)
    at org.jetbrains.changelog.Changelog.getLinks(Changelog.kt:163)
    at org.jetbrains.changelog.Changelog$renderItem$$inlined$with$lambda$1.invokeSuspend(Changelog.kt:183)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:129)
    at kotlin.sequences.SequencesKt___SequencesKt.joinTo(_Sequences.kt:2874)
    at kotlin.sequences.SequencesKt___SequencesKt.joinToString(_Sequences.kt:2896)
    at kotlin.sequences.SequencesKt___SequencesKt.joinToString$default(_Sequences.kt:2895)
    at org.jetbrains.changelog.Changelog.renderItem(Changelog.kt:223)
    at org.jetbrains.changelog.ChangelogPluginExtension.renderItem(ChangelogPluginExtension.kt:173)

To Reproduce

Patch this changelog with another alpha release

Details

``` # Changelog ## [Unreleased] ### Added ### Changed ### Deprecated ### Removed ### Fixed ### Updated - `org.jetbrains.intellij.plugins:gradle-intellij-plugin -> 1.14.0` - `org.jetbrains.intellij.plugins:gradle-changelog-plugin -> 2.1.0` - `org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin -> 0.7.1` - `io.insert-koin:koin-logger-slf4j -> 3.4.1` - `io.insert-koin:koin-ktor -> 3.4.1` - `io.insert-koin:koin-android -> 3.4.1` - `org.sonarqube:org.sonarqube.gradle.plugin -> 4.2.0.3129` - `org.sonarsource.scanner.gradle:sonarqube-gradle-plugin -> 4.2.0.3129` - `io.ktor:ktor-serialization-kotlinx-json -> 2.3.1` - `io.ktor:ktor-client-okhttp -> 2.3.1` - `io.ktor:ktor-client-mock -> 2.3.1` - `io.ktor:ktor-client-core -> 2.3.1` - `io.ktor:ktor-client-content-negotiation -> 2.3.1` - `io.ktor:ktor-client-cio -> 2.3.1` - `io.insert-koin:koin-test-junit5 -> 3.4.1` - `io.insert-koin:koin-test-junit4 -> 3.4.1` - `io.insert-koin:koin-test -> 3.4.1` - `io.insert-koin:koin-core -> 3.4.1` - `io.insert-koin:koin-androidx-compose -> 3.4.5` - `app.cash.sqldelight:sqlite-driver -> 2.0.0-rc01` - `app.cash.sqldelight:native-driver -> 2.0.0-rc01` - `app.cash.sqldelight:jdbc-driver -> 2.0.0-rc01` - `app.cash.sqldelight:gradle-plugin -> 2.0.0-rc01` - `app.cash.sqldelight:coroutines-extensions -> 2.0.0-rc01` - `app.cash.sqldelight:android-driver -> 2.0.0-rc01` - `app.cash.sqldelight:app.cash.sqldelight.gradle.plugin -> 2.0.0-rc01` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.24` ## [0.1.1-alpha.6] - 2023-05-26 ### Added - `com.github.adriankuta:tree-structure -> 3.0.1` ## [0.1.1-alpha.5] - 2023-05-25 ### Updated - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.3` - `com.android.library:com.android.library.gradle.plugin -> 8.0.2` - `com.android.application:com.android.application.gradle.plugin -> 8.0.2` - `com.android.tools.build:gradle -> 8.0.2` ## [0.1.1-alpha.4] - 2023-05-25 ### Updated - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.22` ## [0.1.1-alpha.3] - 2023-05-25 ### Updated - `androidx.activity:activity-ktx -> 1.7.2` - `androidx.activity:activity-compose -> 1.7.2` - `com.diffplug.spotless:spotless-plugin-gradle -> 6.19.0` - `io.gitlab.arturbosch.detekt:detekt-gradle-plugin -> 1.23.0` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.21` - `org.gradle:test-retry-gradle-plugin -> 1.5.3` - `com.javiersc.gradle:gradle-test-extensions -> 1.0.0-alpha.32` - `com.javiersc.gradle:gradle-extensions -> 1.0.0-alpha.32` ## [0.1.1-alpha.2] - 2023-05-14 ### Updated - `org.jetbrains.kotlinx:kotlinx-coroutines-test -> 1.7.1` - `org.jetbrains.kotlinx:kotlinx-coroutines-core -> 1.7.1` - `org.jetbrains.kotlinx:kotlinx-coroutines-android -> 1.7.1` - `com.squareup.moshi:moshi -> 1.15.0` - `app.cash.turbine:turbine -> 0.13.0` - `org.jetbrains.kotlinx:kotlinx-serialization-json -> 1.5.1` - `org.jetbrains.kotlinx:kotlinx-serialization-core -> 1.5.1` - `androidx.compose.material3:material3-window-size-class -> 1.1.0` - `androidx.compose.material3:material3 -> 1.1.0` - `io.kotest:kotest-runner-junit5 -> 5.6.2` - `io.kotest:kotest-runner-junit4 -> 5.6.2` - `io.kotest:kotest-property -> 5.6.2` - `io.kotest:kotest-assertions-sql -> 5.6.2` - `io.kotest:kotest-assertions-json -> 5.6.2` - `io.kotest:kotest-assertions-core -> 5.6.2` - `androidx.core:core-ktx -> 1.10.1` - `com.github.triplet.gradle:play-publisher -> 3.8.3` - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.2` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.16` ## [0.1.1-alpha.1] - 2023-05-06 ### Updated - `org.jetbrains.kotlinx:kotlinx-coroutines-test -> 1.7.0` - `org.jetbrains.kotlinx:kotlinx-coroutines-core -> 1.7.0` - `org.jetbrains.kotlinx:kotlinx-coroutines-android -> 1.7.0` - `org.jetbrains.kotlin:kotlin-test-testng -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-junit5 -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-junit -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-annotations-common -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test -> 1.8.21` - `org.jetbrains.kotlin:kotlin-gradle-plugin-api -> 1.8.21` - `androidx.compose.compiler:compiler -> 1.4.7` - `org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.android:org.jetbrains.kotlin.android.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin:kotlin-serialization -> 1.8.21` - `org.jetbrains.kotlin:kotlin-gradle-plugin -> 1.8.21` - `androidx.compose.ui:ui-util -> 1.4.3` - `androidx.compose.ui:ui-tooling-preview -> 1.4.3` - `androidx.compose.ui:ui-tooling -> 1.4.3` - `androidx.compose.ui:ui-test-manifest -> 1.4.3` - `androidx.compose.ui:ui-test -> 1.4.3` - `androidx.compose.ui:ui -> 1.4.3` - `androidx.compose.runtime:runtime-saveable -> 1.4.3` - `androidx.compose.runtime:runtime -> 1.4.3` - `androidx.compose.material:material-ripple -> 1.4.3` - `androidx.compose.material:material-icons-extended -> 1.4.3` - `androidx.compose.material:material-icons-core -> 1.4.3` - `androidx.compose.material:material -> 1.4.3` - `androidx.compose.foundation:foundation-layout -> 1.4.3` - `androidx.compose.foundation:foundation -> 1.4.3` - `androidx.compose.animation:animation-graphics -> 1.4.3` - `androidx.compose.animation:animation-core -> 1.4.3` - `androidx.compose.animation:animation -> 1.4.3` - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.1` - `com.android.library:com.android.library.gradle.plugin -> 8.0.1` - `com.android.application:com.android.application.gradle.plugin -> 8.0.1` - `com.android.tools.build:gradle -> 8.0.1` - `com.facebook:ktfmt -> 0.44` - `com.javiersc.gradle:gradle-test-extensions -> 1.0.0-alpha.31` - `com.javiersc.gradle:gradle-extensions -> 1.0.0-alpha.31` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.12` - `com.github.triplet.gradle:play-publisher -> 3.8.2` - `org.junit.jupiter:junit-jupiter-params -> 5.9.3` - `org.junit.jupiter:junit-jupiter-api -> 5.9.3` - `io.kotest.extensions:kotest-assertions-arrow -> 1.3.3` - `io.kotest.extensions:kotest-extensions-spring -> 1.1.3` - `io.kotest.extensions:kotest-extensions-embedded-kafka -> 2.0.0` - `gradle -> 8.1.1` - `org.jetbrains.intellij.deps:intellij-coverage-agent -> 1.0.716` - `androidx.core:core-splashscreen -> 1.0.1` - `androidx.activity:activity-ktx -> 1.7.1` - `androidx.activity:activity-compose -> 1.7.1` - `io.ktor:ktor-serialization-kotlinx-json -> 2.3.0` - `io.ktor:ktor-client-okhttp -> 2.3.0` - `io.ktor:ktor-client-mock -> 2.3.0` - `io.ktor:ktor-client-core -> 2.3.0` - `io.ktor:ktor-client-content-negotiation -> 2.3.0` - `io.ktor:ktor-client-cio -> 2.3.0` - `io.insert-koin:koin-androidx-compose -> 3.4.4` - `com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter -> 1.0.0` - `io.kotest:kotest-runner-junit5 -> 5.6.1` - `io.kotest:kotest-runner-junit4 -> 5.6.1` - `io.kotest:kotest-property -> 5.6.1` - `io.kotest:kotest-assertions-sql -> 5.6.1` - `io.kotest:kotest-assertions-json -> 5.6.1` - `io.kotest:kotest-assertions-core -> 5.6.1` - `io.kotest.extensions:kotest-assertions-konform -> 1.0.2` - `org.jetbrains.kotlinx:binary-compatibility-validator -> 0.13.1` [Unreleased]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.6...HEAD [0.1.1-alpha.6]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.5...c0.1.1-alpha.6 [0.1.1-alpha.5]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.4...c0.1.1-alpha.5 [0.1.1-alpha.4]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.3...c0.1.1-alpha.4 [0.1.1-alpha.3]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.2...c0.1.1-alpha.3 [0.1.1-alpha.2]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1-alpha.1...c0.1.1-alpha.2 [0.1.1-alpha.1]: https://github.com/JavierSegoviaCordoba/hubdle/commits/c0.1.1-alpha.1 ```

Expected behavior It shouldn't crash

Environment:

Additional context Add any other context about the problem here.

JavierSegoviaCordoba commented 1 year ago

Note: Curiously, the changelog is correctly patched, even with the task failing.

Another sample with only final releases when trying to patch with the 0.1.2 version.

Details

```markdown # Changelog ## [Unreleased] ### Added ### Changed ### Deprecated ### Removed ### Fixed ### Updated - `org.jetbrains.intellij.plugins:gradle-intellij-plugin -> 1.14.1` ## [0.1.1] - 2023-06-07 ### Updated - `com.javiersc.semver:com.javiersc.semver.gradle.plugin -> 0.5.0-rc.1` - `io.insert-koin:koin-core -> 3.4.2` - `io.insert-koin:koin-android -> 3.4.2` - `org.jetbrains.dokka:dokka-gradle-plugin -> 1.8.20` - `com.javiersc.kotlin:kotlin-test-testng -> 0.1.0-alpha.15` - `com.javiersc.kotlin:kotlin-test-junit5 -> 0.1.0-alpha.15` - `com.javiersc.kotlin:kotlin-test-junit -> 0.1.0-alpha.15` - `com.javiersc.kotlin:kotlin-stdlib -> 0.1.0-alpha.15` - `org.jetbrains.kotlinx:binary-compatibility-validator -> 0.13.2` - `com.javiersc.kotlin:kotlin-test-testng -> 0.1.0-alpha.14` - `com.javiersc.kotlin:kotlin-test-junit5 -> 0.1.0-alpha.14` - `com.javiersc.kotlin:kotlin-test-junit -> 0.1.0-alpha.14` - `com.javiersc.kotlin:kotlin-stdlib -> 0.1.0-alpha.14` - `org.jetbrains.intellij.plugins:gradle-intellij-plugin -> 1.14.0` - `org.jetbrains.intellij.plugins:gradle-changelog-plugin -> 2.1.0` - `org.jetbrains.kotlinx.kover:org.jetbrains.kotlinx.kover.gradle.plugin -> 0.7.1` - `io.insert-koin:koin-logger-slf4j -> 3.4.1` - `io.insert-koin:koin-ktor -> 3.4.1` - `io.insert-koin:koin-android -> 3.4.1` - `org.sonarqube:org.sonarqube.gradle.plugin -> 4.2.0.3129` - `org.sonarsource.scanner.gradle:sonarqube-gradle-plugin -> 4.2.0.3129` - `io.ktor:ktor-serialization-kotlinx-json -> 2.3.1` - `io.ktor:ktor-client-okhttp -> 2.3.1` - `io.ktor:ktor-client-mock -> 2.3.1` - `io.ktor:ktor-client-core -> 2.3.1` - `io.ktor:ktor-client-content-negotiation -> 2.3.1` - `io.ktor:ktor-client-cio -> 2.3.1` - `io.insert-koin:koin-test-junit5 -> 3.4.1` - `io.insert-koin:koin-test-junit4 -> 3.4.1` - `io.insert-koin:koin-test -> 3.4.1` - `io.insert-koin:koin-core -> 3.4.1` - `io.insert-koin:koin-androidx-compose -> 3.4.5` - `app.cash.sqldelight:sqlite-driver -> 2.0.0-rc01` - `app.cash.sqldelight:native-driver -> 2.0.0-rc01` - `app.cash.sqldelight:jdbc-driver -> 2.0.0-rc01` - `app.cash.sqldelight:gradle-plugin -> 2.0.0-rc01` - `app.cash.sqldelight:coroutines-extensions -> 2.0.0-rc01` - `app.cash.sqldelight:android-driver -> 2.0.0-rc01` - `app.cash.sqldelight:app.cash.sqldelight.gradle.plugin -> 2.0.0-rc01` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.24` - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.3` - `com.android.library:com.android.library.gradle.plugin -> 8.0.2` - `com.android.application:com.android.application.gradle.plugin -> 8.0.2` - `com.android.tools.build:gradle -> 8.0.2` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.22` - `androidx.activity:activity-ktx -> 1.7.2` - `androidx.activity:activity-compose -> 1.7.2` - `com.diffplug.spotless:spotless-plugin-gradle -> 6.19.0` - `io.gitlab.arturbosch.detekt:detekt-gradle-plugin -> 1.23.0` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.21` - `org.gradle:test-retry-gradle-plugin -> 1.5.3` - `com.javiersc.gradle:gradle-test-extensions -> 1.0.0-alpha.32` - `com.javiersc.gradle:gradle-extensions -> 1.0.0-alpha.32` - `org.jetbrains.kotlinx:kotlinx-coroutines-test -> 1.7.1` - `org.jetbrains.kotlinx:kotlinx-coroutines-core -> 1.7.1` - `org.jetbrains.kotlinx:kotlinx-coroutines-android -> 1.7.1` - `com.squareup.moshi:moshi -> 1.15.0` - `app.cash.turbine:turbine -> 0.13.0` - `org.jetbrains.kotlinx:kotlinx-serialization-json -> 1.5.1` - `org.jetbrains.kotlinx:kotlinx-serialization-core -> 1.5.1` - `androidx.compose.material3:material3-window-size-class -> 1.1.0` - `androidx.compose.material3:material3 -> 1.1.0` - `io.kotest:kotest-runner-junit5 -> 5.6.2` - `io.kotest:kotest-runner-junit4 -> 5.6.2` - `io.kotest:kotest-property -> 5.6.2` - `io.kotest:kotest-assertions-sql -> 5.6.2` - `io.kotest:kotest-assertions-json -> 5.6.2` - `io.kotest:kotest-assertions-core -> 5.6.2` - `androidx.core:core-ktx -> 1.10.1` - `com.github.triplet.gradle:play-publisher -> 3.8.3` - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.2` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.16` - `org.jetbrains.kotlinx:kotlinx-coroutines-test -> 1.7.0` - `org.jetbrains.kotlinx:kotlinx-coroutines-core -> 1.7.0` - `org.jetbrains.kotlinx:kotlinx-coroutines-android -> 1.7.0` - `org.jetbrains.kotlin:kotlin-test-testng -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-junit5 -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-junit -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test-annotations-common -> 1.8.21` - `org.jetbrains.kotlin:kotlin-test -> 1.8.21` - `org.jetbrains.kotlin:kotlin-gradle-plugin-api -> 1.8.21` - `androidx.compose.compiler:compiler -> 1.4.7` - `org.jetbrains.kotlin.plugin.serialization:org.jetbrains.kotlin.plugin.serialization.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin.android:org.jetbrains.kotlin.android.gradle.plugin -> 1.8.21` - `org.jetbrains.kotlin:kotlin-serialization -> 1.8.21` - `org.jetbrains.kotlin:kotlin-gradle-plugin -> 1.8.21` - `androidx.compose.ui:ui-util -> 1.4.3` - `androidx.compose.ui:ui-tooling-preview -> 1.4.3` - `androidx.compose.ui:ui-tooling -> 1.4.3` - `androidx.compose.ui:ui-test-manifest -> 1.4.3` - `androidx.compose.ui:ui-test -> 1.4.3` - `androidx.compose.ui:ui -> 1.4.3` - `androidx.compose.runtime:runtime-saveable -> 1.4.3` - `androidx.compose.runtime:runtime -> 1.4.3` - `androidx.compose.material:material-ripple -> 1.4.3` - `androidx.compose.material:material-icons-extended -> 1.4.3` - `androidx.compose.material:material-icons-core -> 1.4.3` - `androidx.compose.material:material -> 1.4.3` - `androidx.compose.foundation:foundation-layout -> 1.4.3` - `androidx.compose.foundation:foundation -> 1.4.3` - `androidx.compose.animation:animation-graphics -> 1.4.3` - `androidx.compose.animation:animation-core -> 1.4.3` - `androidx.compose.animation:animation -> 1.4.3` - `com.gradle.enterprise:com.gradle.enterprise.gradle.plugin -> 3.13.1` - `com.android.library:com.android.library.gradle.plugin -> 8.0.1` - `com.android.application:com.android.application.gradle.plugin -> 8.0.1` - `com.android.tools.build:gradle -> 8.0.1` - `com.facebook:ktfmt -> 0.44` - `com.javiersc.gradle:gradle-test-extensions -> 1.0.0-alpha.31` - `com.javiersc.gradle:gradle-extensions -> 1.0.0-alpha.31` - `com.javiersc.hubdle:com.javiersc.hubdle.gradle.plugin -> 0.5.0-alpha.12` - `com.github.triplet.gradle:play-publisher -> 3.8.2` - `org.junit.jupiter:junit-jupiter-params -> 5.9.3` - `org.junit.jupiter:junit-jupiter-api -> 5.9.3` - `io.kotest.extensions:kotest-assertions-arrow -> 1.3.3` - `io.kotest.extensions:kotest-extensions-spring -> 1.1.3` - `io.kotest.extensions:kotest-extensions-embedded-kafka -> 2.0.0` - `gradle -> 8.1.1` - `org.jetbrains.intellij.deps:intellij-coverage-agent -> 1.0.716` - `androidx.core:core-splashscreen -> 1.0.1` - `androidx.activity:activity-ktx -> 1.7.1` - `androidx.activity:activity-compose -> 1.7.1` - `io.ktor:ktor-serialization-kotlinx-json -> 2.3.0` - `io.ktor:ktor-client-okhttp -> 2.3.0` - `io.ktor:ktor-client-mock -> 2.3.0` - `io.ktor:ktor-client-core -> 2.3.0` - `io.ktor:ktor-client-content-negotiation -> 2.3.0` - `io.ktor:ktor-client-cio -> 2.3.0` - `io.insert-koin:koin-androidx-compose -> 3.4.4` - `com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter -> 1.0.0` - `io.kotest:kotest-runner-junit5 -> 5.6.1` - `io.kotest:kotest-runner-junit4 -> 5.6.1` - `io.kotest:kotest-property -> 5.6.1` - `io.kotest:kotest-assertions-sql -> 5.6.1` - `io.kotest:kotest-assertions-json -> 5.6.1` - `io.kotest:kotest-assertions-core -> 5.6.1` - `io.kotest.extensions:kotest-assertions-konform -> 1.0.2` - `org.jetbrains.kotlinx:binary-compatibility-validator -> 0.13.1` [Unreleased]: https://github.com/JavierSegoviaCordoba/hubdle/compare/c0.1.1...HEAD [0.1.1]: https://github.com/JavierSegoviaCordoba/hubdle/commits/c0.1.1 ```