Code Monkey home page Code Monkey logo

Comments (15)

gianluz avatar gianluz commented on July 28, 2024 1

could you try only on pull-request and remove temporarily on push? because danger is made to work on pull requests only.. should check your code before merging something, in a pull-request, not when you push a branch..

from kotlin.

f-meloni avatar f-meloni commented on July 28, 2024 1

Also I wonder if is related to this danger/danger-js#1042

from kotlin.

gianluz avatar gianluz commented on July 28, 2024

#95 should solve, could you try from danger/kotlin@github-issue-optional please?

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

Thanks!
I'll try it and let you know
(Probably on Sunday)

from kotlin.

f-meloni avatar f-meloni commented on July 28, 2024

We don't have issue optional on danger-swift. https://github.com/danger/swift/blob/master/Sources/Danger/GitHubDSL.swift#L17
Danger-Swift is been around for a while now and we never hit a problem like that, I'm then curious to know why.
@pinkasey Is is possible (unless it is private), to share the PR where this is happening?

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

It's a private repo from my work-place.
What does issue represent? an issue in github?
if so, that explains it -
We don't work with github-issues in my company.
We work with Jira.

from kotlin.

f-meloni avatar f-meloni commented on July 28, 2024

AFAIK PR is always also an issue, if you try to get an issue (https://developer.github.com/v3/issues/#get-an-issue) using a PR number it will show you the issue data for that PR.
Take for example the PR @gianluz just opened https://api.github.com/repos/danger/kotlin/issues/95 this is the issue data related to that PR.
I don't understand why it is missing in your case.

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

What you say makes sense.
If only there was more info in the output, we could understand better what's going on...

I've tried println("args: $args"),
but that only gave me something like
args: [Ljava.lang.String;@50406145

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

I've ran it with danger/kotlin@github-issue-optional

Now I get this error:

com.squareup.moshi.JsonDataException: Required value 'pullRequest' missing at $.danger.github
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:96)
	at com.squareup.moshi.JsonAdapter$2.fromJson(JsonAdapter.java:137)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:83)
	at com.squareup.moshi.JsonAdapter$2.fromJson(JsonAdapter.java:137)
	at com.squareup.moshi.kotlin.reflect.KotlinJsonAdapter.fromJson(KotlinJsonAdapter.kt:83)
	at com.squareup.moshi.JsonAdapter$2.fromJson(JsonAdapter.java:137)
	at com.squareup.moshi.JsonAdapter.fromJson(JsonAdapter.java:41)
	at systems.danger.kotlin.DangerRunner.<init>(DangerRunner.kt:125)
	at systems.danger.kotlin.DangerRunnerKt.Danger(DangerRunner.kt:238)
	at Dangerfile_df.<init>(Dangerfile.df.kts:14)
Uncaught Kotlin exception: kotlin.Exception: Command 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 exited with code 768

Obviously, it's not about the issue -
the content of /tmp/danger-dsl.json is completely wrong. I'm guessing it's completely empty.

I'll try to output it's content to console and post it here.

I think a take-away from this thread, is that if deserializing the input json fails - better print a more verbose error message, something like

"something is wrong with the input-file for Danger (/tmp/danger-dsl.json), which is calculated in a previous step (which?). here's the error: "...missing issue...", here's the file content: ..."

from kotlin.

gianluz avatar gianluz commented on July 28, 2024

May i ask how you are triggering the job?? is against a pull request? i'm suspecting is failing because there is not pull request here..

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

yes, on a pull-request:

name: danger-detekt

on:
  push:
    branches: [ my_branch ]
  pull_request:
    branches: [ my_branch ]

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

I'm trying both -
removed 'push' and added DANGER_GITHUB_API_BASE_URL

For now, it seems like github doesn't think he needs to run the action at all:
Uploading image.png…
It's been like that for ~10 minutes.
I'll update if it makes progress..

If you guys can point me to an example repo where danger/kotlin does work - that might also help.

from kotlin.

pinkasey avatar pinkasey commented on July 28, 2024

OK
I've changed my main.yml (workflow file) to the one in this repo (danger.yml) - now it seems to run successfully.
I'll work my way from here.

I guess the problem was here, in my workflow yml:

on:
  push:

fix:

on: [pull_request]

Thanks for the replies.
I still suggest a more helpful error-message in the case that I've encounter, I'll try to open a PR.

from kotlin.

mokagio avatar mokagio commented on July 28, 2024

I'll try to open a PR

Thanks ✨ 👍

from kotlin.

gianluz avatar gianluz commented on July 28, 2024

Looks like this issue was solved! closing

from kotlin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.