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

Github PR status not working #1002

Closed
jack828 opened this issue Oct 17, 2016 · 19 comments
Closed

Github PR status not working #1002

jack828 opened this issue Oct 17, 2016 · 19 comments

Comments

@jack828
Copy link

jack828 commented Oct 17, 2016

First of all, great app.
Secondly, sorry if this is in the wrong place.

I'm having a couple issues. The first is with the Github PR status functionality. Pushing to a PR does cause the test to run, but it doesn't give any status on the PR of the build result (I mean the little tick and github reporting all tests passed).
I have the PR status plugin and webhooks plugin and also they are both enabled for the branches I am testing on.

Running strider with DEBUG=strider-github-status gives output of the webhook content and also the two following errors:

strider-github-status initing +0ms 5804191dc291d08de48c undefined

strider-github-status No github PR data +2ms undefined { __v: 0, <snip webhook content>

I think this error is for the failing test but I am unsure (eslint test)
(node:2270) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Command failed: npm test --color=always

Any ideas? I may have everything configured wrong as I couldn't find a decent guide.

@jack828
Copy link
Author

jack828 commented Oct 17, 2016

Additional info:
I have strider installed with npm i -g strider
[email protected]
[email protected]
[email protected]

@oliversalzburg
Copy link
Member

I never used this functionality, maybe @knownasilya know something?

@xgalen
Copy link
Member

xgalen commented Oct 18, 2016

Maybe this is related with #989. I see this error too.

@jack828
Copy link
Author

jack828 commented Oct 18, 2016

Hi,
The webhooks all appear to be delivering fine, tests run as expected, minus the status indicators.

@knownasilya
Copy link
Member

I've just published strider-github with the PR you submitted @xgalen regarding empty data for the webhook, so give that a try.

@jack828
Copy link
Author

jack828 commented Oct 18, 2016

Still gives the same error as the beginning.

@knownasilya
Copy link
Member

@jack828 could you run strider like so DEBUG=strider-github-status bin/strider and past the output after the status plugin is triggered?

@knownasilya
Copy link
Member

@jack828 does your project have the strider public key set in the github deploy keys for your repo?

@jack828
Copy link
Author

jack828 commented Oct 31, 2016

@knownasilya The public key is set (I think) as the repo is private so it needs them to clone it.

The output is as follows:

2016-10-31T11:20:28.395Z - error:   strider-github-status initing +0ms 581728e308cfd90cb4412bfb undefined
2016-10-31T11:20:28.404Z - error:   strider-github-status No github PR data +3ms undefined { __v: 0,
  type: 'TEST_ONLY',
  project:
   { _id: 580166f4394ec312bceb8a22,
     name: '',
     display_name: '',
     display_url: '',
     creator:
      { _id: 58013282cd90c60d55edf496,
        account_level: 1,
        hash: '$2a$10$7M4j01MBZVmwmo0xuE9xceK0jq6f0g30fd9zRpKJs2DAefjUYDZyu',
        salt: '$2a$10$7M4j01MBZVmwmo0xuE9xce',
        created: 2016-10-14T19:31:14.349Z,
        email: '',
        __v: 1,
        jobs: [],
        projects: [Object],
        accounts: [Object] },
     __v: 16,
     provider:
      { id: 'github',
        account: '',
        repo_id: '',
        config: [Object] },
     branches: [ [Object], [Object], [Object] ],
     prefetch_config: true,
     public: false },
  ref:
   { id: 'c58df5a62f158f872913f27dabc1e55df8113245',
     branch: 'meta/strider' },
  user_id: 58013282cd90c60d55edf496,
  created: 2016-10-31T11:20:02.960Z,
  _id: 581728e308cfd90cb4412bfb,
  errored: false,
  warnings: [],
  phases:
   { cleanup: { commands: [] },
     deploy: { commands: [] },
     test: { commands: [] },
     prepare: { commands: [] },
     environment: { commands: [] } },
  trigger:
   { type: 'commit',
     url: '',
     message: 'Annoy linter',
     timestamp: 2016-10-31T11:19:56.000Z,
     source: { plugin: 'github', type: 'plugin' },
     author:
      { name: 'Jack',
        email: '',
        image: 'https://secure.gravatar.com/avatar/baf3d4ef6dcbd14b9f07bfcf52a47d74' } },
  providerConfig:
   { pull_requests: 'all',
     auth: { type: 'ssh' },
     repo: '',
     owner: 'jack828',
     url: '',
     secret: '' },
  fromStriderJson: false }

I have removed personal information.

@knownasilya
Copy link
Member

Does creating the initial PR work though, or doors it always not work (initial and subsequent pushes)?

@jack828
Copy link
Author

jack828 commented Nov 1, 2016

Creating the initial PR causes the build but does not update the status - same with subsequent pushes. I will try deleting the web hook and re adding it shortly.

@knownasilya
Copy link
Member

I tested it yesterday and it worked for me with latest everything. Might be you setup the project before setting your SERVER_NAME env?

@jack828
Copy link
Author

jack828 commented Nov 1, 2016

I tried deleting the whole installation and cloning the repo instead - still nothing.

But I do get a new error:

2016-11-01T16:01:31.039Z - error: TypeError: Cannot read property 'author' of null
    at pushJob (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:166:19)
    at startFromCommit (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:49:16)
    at receiveWebhook (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:262:16)
    at Layer.handle [as handle_request] (/home/strider/strider/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/strider/strider/node_modules/express/lib/router/route.js:131:13)
    at projectProvider (/home/strider/strider/lib/middleware.js:118:3)
    at Layer.handle [as handle_request] (/home/strider/strider/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/strider/strider/node_modules/express/lib/router/route.js:131:13)
    at /home/strider/strider/lib/middleware.js:234:7
    at /home/strider/strider/node_modules/mongoose/lib/query.js:2313:18
    at tryCatcher (/home/strider/strider/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/strider/strider/node_modules/bluebird/js/release/promise.js:510:31)
    at Promise._settlePromise (/home/strider/strider/node_modules/bluebird/js/release/promise.js:567:18)
    at Promise._settlePromise0 (/home/strider/strider/node_modules/bluebird/js/release/promise.js:612:10)
    at Promise._settlePromises (/home/strider/strider/node_modules/bluebird/js/release/promise.js:691:18)
    at Async._drainQueue (/home/strider/strider/node_modules/bluebird/js/release/async.js:138:16)
    at Async._drainQueues (/home/strider/strider/node_modules/bluebird/js/release/async.js:148:10)
    at Immediate.Async.drainQueues (/home/strider/strider/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:628:20)
    at tryOnImmediate (timers.js:601:5)
    at processImmediate [as _immediateCallback] (timers.js:578:5)

@jack828
Copy link
Author

jack828 commented Nov 1, 2016

The above error occurs when I try to redeliver the last failed webhook delivery (note that the test still ran despite this, initially. Redelivery does not prompt a retest)

@shilman
Copy link

shilman commented Feb 24, 2017

@jack828 @knownasilya I ran into the same problem. I applied the changes in the following commit, and it solved the problem for me, but the package has not been updated/released yet. Please release:

Strider-CD/strider-github-status@80abff7

@knownasilya
Copy link
Member

Thanks for the ping!

@jack828
Copy link
Author

jack828 commented Feb 24, 2017

Fantastic, I'll take a look. Had to use Travis CI but prefer to use strider instead.

@knownasilya
Copy link
Member

Should be released now as 2.1.0 in plugins.

@knownasilya
Copy link
Member

Closing. If the issue still exists, please comment and I'll reopen.

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

No branches or pull requests

5 participants