danger / kotlin

⚠️ Stop saying "you forgot to …" in code review
MIT License
490 stars 48 forks source link

MissingFieldException: Field 'issue' is required, but it was missing #165

Open VictorPascualV opened 3 years ago

VictorPascualV commented 3 years ago

I'm getting this error when trying to run Danger from CI (Github Actions):

Executing $(which danger) ci --process danger-kotlin --passURLForDSL --failOnErrors --no-publish-check - pid 1
Executing kotlinc -script-templates systems.danger.kts.DangerFileScript -cp /usr/local/lib/danger/danger-kotlin.jar -script Dangerfile.df.kts /tmp/danger-dsl.json danger_out.json - pid 24

kotlinx.serialization.MissingFieldException: Field 'issue' is required, but it was missing

    at systems.danger.kotlin.models.github.GitHub.<init>(GitHub.kt)
    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:225)

Could it be related to our organisation not using Github Issues feature at all? 🤔

I only found that issue when running Danger in CI, it was working as a charm when using: danger-kotlin pr https://github.com/myOrg/myRepo/pull/123 from my machine.

gianluz commented 3 years ago

looks an optional field marked as required to me 🤔

cmunaro commented 3 years ago

Hi, I'm facing the same problem, how can It be solved?

orta commented 3 years ago

Send a PR which changes the right field to optional is probably your best solution 👍🏻

tegorov commented 3 years ago

Hi, @munez07. Can you please show the workflow file?

gianluz commented 1 year ago

@VictorPascualV is this still an issue for you?

AdminQQZ commented 1 month ago

me too

Roha911 commented 2 weeks ago

Learn novin project Instagram admin