Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danger execution fails for PR assigned to a closed milestone #150

Closed
doodeec opened this issue Dec 9, 2020 · 1 comment · Fixed by #151
Closed

Danger execution fails for PR assigned to a closed milestone #150

doodeec opened this issue Dec 9, 2020 · 1 comment · Fixed by #151

Comments

@doodeec
Copy link

doodeec commented Dec 9, 2020

PR is in an inactive (closed) milestone. It seem to be the cause for a serialization error.

kotlinx.serialization.SerializationException: systems.danger.kotlin.models.github.GitHubMilestoneState does not contain element with name 'closed'
    at kotlinx.serialization.json.internal.TreeJsonDecoderKt.getElementIndexOrThrow(TreeJsonDecoder.kt:271)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeEnum(StreamingJsonDecoder.kt:225)
    at systems.danger.kotlin.models.github.GitHubMilestoneState$$serializer.deserialize(GitHub.kt)
    at systems.danger.kotlin.models.github.GitHubMilestoneState$$serializer.deserialize(GitHub.kt:304)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
    at systems.danger.kotlin.models.github.GitHubMilestone$$serializer.deserialize(GitHub.kt)
    at systems.danger.kotlin.models.github.GitHubMilestone$$serializer.deserialize(GitHub.kt:332)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:72)
    at systems.danger.kotlin.models.github.GitHubIssue$$serializer.deserialize(GitHub.kt)
    at systems.danger.kotlin.models.github.GitHubIssue$$serializer.deserialize(GitHub.kt:243)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
    at systems.danger.kotlin.models.github.GitHub$$serializer.deserialize(GitHub.kt)
    at systems.danger.kotlin.models.github.GitHub$$serializer.deserialize(GitHub.kt:14)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeNullableSerializableElement(AbstractDecoder.kt:72)
    at systems.danger.kotlin.models.danger.DangerDSL$$serializer.deserialize(DangerDSL.kt)
    at systems.danger.kotlin.models.danger.DangerDSL$$serializer.deserialize(DangerDSL.kt:15)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
    at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
    at systems.danger.kotlin.models.danger.DSL$$serializer.deserialize(DangerDSL.kt)
    at systems.danger.kotlin.models.danger.DSL$$serializer.deserialize(DangerDSL.kt:10)
    at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
    at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
    at kotlinx.serialization.json.Json.decodeFromString(Json.kt:85)
    at systems.danger.kotlin.MainDangerRunner.<init>(MainDangerRunner.kt:130)
    at systems.danger.kotlin.MainScriptKt.Danger(MainScript.kt:39)
    at Dangerfile_df.<init>(Dangerfile.df.kts:69)

dangerfile

danger(args) {
    onGitHub {
        // Milestone is required
        if (pullRequest.milestone == null) {
            fail("PR is required to have a milestone.")
        }
    }
}

Environment: GitHub Enterprise Server 2.22.4

@doodeec
Copy link
Author

doodeec commented Dec 9, 2020

probably a typo in


close -> closed

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 a pull request may close this issue.

1 participant