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

Error after updating Peril #351

Open
jlengstorf opened this issue Aug 16, 2018 · 12 comments
Open

Error after updating Peril #351

jlengstorf opened this issue Aug 16, 2018 · 12 comments

Comments

@jlengstorf
Copy link

Using Heroku, we followed the steps to pull the latest from danger/peril@master and push to Heroku.

After the update, we're now getting an error:

Aug 15 18:28:42 peril-gatsbyjs app/web.1: info: ## issues.opened on unknown on gatsbyjs/peril-gatsbyjs 
Aug 15 18:28:42 peril-gatsbyjs app/web.1: info:    2 runs needed: org/emptybody.ts, org/labeler.ts 
Aug 15 18:28:43 peril-gatsbyjs heroku/router: at=info method=POST path="/webhook" host=peril-gatsbyjs.herokuapp.com request_id=10aeb0fa-bfd0-40fd-a8db-e5fcbbd66a6e fwd="192.30.253.29" dyno=web.1 connect=0ms service=981ms status=200 bytes=353 protocol=https 
Aug 15 18:28:43 peril-gatsbyjs app/web.1: info: [runner] - Commenting, with results:  
Aug 15 18:28:43 peril-gatsbyjs app/web.1: mds: 0 
Aug 15 18:28:43 peril-gatsbyjs app/web.1: messages: 0 
Aug 15 18:28:43 peril-gatsbyjs app/web.1: warns: 0 
Aug 15 18:28:43 peril-gatsbyjs app/web.1: fails: 0 
Aug 15 18:28:43 peril-gatsbyjs app/web.1: error: Error:  TypeError: Cannot read property 'concat' of undefined 
Aug 15 18:28:43 peril-gatsbyjs app/web.1:     at Executor.<anonymous> (/app/node_modules/danger/distribution/runner/Executor.js:273:46) 

Looking at the danger source, the results.fails property appears to be coming back undefined.

We also might be doing something wrong; our Peril instance recently started triple-firing and I have no idea how or why. Any insights here are much appreciated.

Thanks!

@orta
Copy link
Member

orta commented Aug 16, 2018

OK, so we've been having a think about this for a while in ashfurrow/peril-settings#8 (comment)

but when #352 merges, then if you add SKIP_CHECKS_SUPPORT to a truth string in your env then Peril will skip the checks API stuff completely, which should work around this for now.

@orta
Copy link
Member

orta commented Aug 16, 2018

/cc @ashfurrow

@jlengstorf
Copy link
Author

@orta Can you add a little context here? Is our configuration incorrect to require disabling checks, or is it something else?

I've added the following to our Heroku instance:

screen shot 2018-08-16 at 9 20 37 am

After restarting, I redelivered an issue creation payload and it still hits the concat error above.

Did I add that env var properly?

@jlengstorf
Copy link
Author

For reference, I pulled the latest from master and pushed it up to Heroku this morning before trying this.

@jlengstorf
Copy link
Author

I scaled my Heroku web processes down to 0 and back to 1 and now the triple-posting is gone. I have no idea what that was all about.

@jlengstorf
Copy link
Author

Ugh. It started happening again after restarting the Heroku instance. I'm pretty lost here. 😢

@ashfurrow
Copy link
Member

Hey @jlengstorf – sorry to hear that you're having that problem, it sounds frustrating. That env var looks right, and looking at the code it should work. I'll try to take a look this afternoon. Unfortunately, Orta has been pulled away unexpectedly, so it may be a few days before this can be resolved.

I know that Peril has been integrated into Gatsby's infrastructure and that it's important that it works – if possible, I would consider reverting to your earlier deployed commit. Heroku's dashboard should let you do this through its UI. I'll keep you updated.

@jlengstorf
Copy link
Author

jlengstorf commented Aug 16, 2018 via email

@ashfurrow
Copy link
Member

Hmm! That is unexpected. Looking at another place that Peril accesses env vars, it should be as straightforward as you've done in your screenshot:

const hasJSONDef = !!process.env.DATABASE_JSON_FILE

Peril/Danger can be a bit tricky to debug. Orta has done some work making it easier, but if you have suggestions or ideas, make sure to drop them into an issue 👍

@ashfurrow
Copy link
Member

Hmmm, okay so I've updated my Peril install on Heroku and have set the env var. I'm still seeing the failure involving concat, but I opened a Node REPL on Heroku and the env var is being set correctly:

> const { SKIP_CHECKS_SUPPORT } = process.env
undefined
> SKIP_CHECKS_SUPPORT
'true'
> !SKIP_CHECKS_SUPPORT
false

Which suggests that the code in #352 is at least accessing the environment variables correctly, even if it's not behaving as intended. I'll do some more debugging and get back to you.

@ashfurrow
Copy link
Member

I think I have a fix, I'm testing on my Peril instance first and will send a PR once I've verified it works.

@ashfurrow
Copy link
Member

ashfurrow commented Aug 16, 2018

Okay, @jlengstorf I've got a PR with a fix up: #355 You should be able to pull in that commit immediately and use it. You can optionally remove the environment variable to use the new GitHub checks API (though I've not confirmed that it works, I personally might keep it disabled). /cc @SD10

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.

3 participants