Code Monkey home page Code Monkey logo

strider-github's Introduction

strider-github

A provider for strider that integrates with GitHub to provide easy setup of your projects. It registers webhooks and sets up ssh keys (if you so choose).

NPM Build Status

Note: Supports using '[skip ci]' in your commit message to skip commits triggering a job.

Required Configuration

If you are running on localhost:3000 the default settings should work just fine.

Environment Variables

SERVER_NAME The url of your strider server. Defaults to http://localhost:3000.

The following variables only need to be overridden if you are using github enterprise. See 'Enterprise Setup' below.

PLUGIN_GITHUB_APP_ID Defaults to client ID of Strider-CD Github App

PLUGIN_GITHUB_APP_SECRET Defaults to client secret of Strider-CD Github App

PLUGIN_GITHUB_API_DOMAIN Defaults to https://github.com

PLUGIN_GITHUB_API_ENDPOINT Defaults to https://api.github.com

Enterprise Setup

  1. You'll need to create an Application on your GitHub Enterprise Server. Log in to GitHub Enterprise and navigate to https://your-github-url.com/settings/applications/new and set authentication URL to https://your-strider-server:port/auth/github/callback.

  2. Define the environment variables. Here is an example:

    export SERVER_NAME="http://111.11.11.111:3000"
    export PLUGIN_GITHUB_APP_ID="a342d32c23c23"
    export PLUGIN_GITHUB_APP_SECRET="5af64a67af586847afbc6796769769d97a961"
    export PLUGIN_GITHUB_API_DOMAIN="https://github.my-organization.com"
    export PLUGIN_GITHUB_API_ENDPOINT="https://github.my-organization.com/api/v3"

    NOTE SERVER_NAME must be the same exact host that you used for the 'Authentication URL' in step 1. For example, if you used http://111.11.11.111:3000/auth/guthub/callback in step 1, your SERVER_NAME must be http://111.11.11.111:3000. Also note that the protocol must be the same between the two (if you used http:// in step 1, you must use http:// in SERVER_NAME and not https://).

  3. Reboot strider and navigate link a github account as normal, you should see your enterprise repos!

Known Issues with Enterprise

  • If you get 'Error: Could not fetch user profile': Somehow, passport will fail to retrieve the user profile unless all of the following are set. On GitHub Enterprise, log in to the profile you are trying to link to, and navigate to /settings/profile. Make sure the following are defined and set properly.
    • Public Email
    • Homepage URL

Known Issues with GitHub.com

  • Make sure your github profile has a public email set
  • Make sure you have admin rights on the projects before adding them, since strider will need to create webhooks for the integration to work.

Local Development

Due to the fact that Github posts to the Strider app when there is an event (commit, PR, etc) it is very difficult to test all of the functionality when developing/fixing bugs locally. An alternative is to use something like localtunnel.

$ npm install -g localtunnel
$ lt --port <strider-port>

strider-github's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strider-github's Issues

Cannot add github repo after upgrade to HEAD of strider

Whenever I try to add anything githuby I get an error page with the following error.

Express
500 failed to fetch user profile (status: 401 data: {"message":"Requires authentication","documentation_url":"http://developer.github.com/v3"})
at /usr/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/lib/passport-github/strategy.js:90:28
at passBackControl (/usr/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:105:9)
at IncomingMessage. (/usr/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth/node_modules/oauth/lib/oauth2.js:124:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

getting this working with github enterprise

I have set up GH Enterprise (trial for 45 days) on a VM.

Am setting the ENV variables and running strider as follows:

PLUGIN_GITHUB_API_ENDPOINT="http://192.168.56.105/api/v3" DB_URI="mongodb://strider:devpass@localhost/strider" DEBUG=superagent,strider-github:* node ./bin/strider --no-cluster

When trying to add a Github account gets me to an error page

2015-08-20T07:25:52.301Z - error: InternalOAuthError: Failed to fetch user profile
    at /noderoot/strider-github/node_modules/passport-github/lib/strategy.js:95:19
    at passBackControl (/noderoot/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:123:9)
    at IncomingMessage.<anonymous> (/noderoot/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:142:7)
    at IncomingMessage.emit (events.js:129:20)
    at _stream_readable.js:908:16
    at process._tickCallback (node.js:355:11)

So, what are the steps needed to get this working with github enterprise?

More meaningful error messages

Hi,

I have a strider instance running in a docker container behind a Nginx server.
Strider runs on port 3000 and Nginx acts as proxy serving strider via https.
Unfortunately, I only get

500 AuthorizationError: The redirect_uri MUST match the registered callback URL for this application.

errors when I try to connect strider to github. It would be nice if I could see what the redirect_url actually is. Any hints on how to debug this?

BTW:
My environment variables are set similar to the following variables:

SERVER_NAME='https://foo'
PLUGIN_GITHUB_APP_ID=4xxxb
PLUGIN_GITHUB_APP_SECRET=8xxx9

My authorization callback url is (in the github app):
https://foo/auth/github/callback

(foo is just the hostname without a port)

Tests of master gets triggered while a pr check is running

When running a PR job it can happen that in parallel someone merges changes to master.
This triggers a job start on the master branch while the PR job is still running.
bug2

In addition to this (unexpected) behavior the output of the PR job becomes unavailable
(just a black field is displayed where previously the test output was displayed; like a job which is scheduled but did not run yet) as strider assumes the latest (the master job) is the only active job.
bug

Observed with the latest version of strider + the docker-runner, the strider-github and the strider-custom plugins. I think I observed this bug because the tests I run can take a long time to finish (compiling a large C code base).

Not registering the Environment variables

I set the environment variables as per the documentation, but Strider seems to be ignoring them.

I used the following environment variables:
PLUGIN_GITHUB_APP_ID
PLUGIN_GITHUB_APP_SECRET
PLUGIN_GITHUB_HOSTNAME

I don't see any references to those variables in the code.
Is the Strider extension loader is supposed to auto-load environment variables into the config object? ๐Ÿ˜–

For now, I made a fork with the following patch (read hack) that seems to work.
It explicitly looks for those environment vars in the config object declaration:
https://github.com/Galavantier/strider-github/blob/master/lib/webapp.js#L11-L13

I found this original issue that solved the problem, but it doesn't seem to be working now: #22

Any ideas about what is going on?

My patch seems to be working, but I would really prefer to help get the official repo working instead of maintaining a fork ๐Ÿ˜„

Thanks so much

Webhook error on release

Hi, if i added a hook on releases the plugin crash, it seems that it search for commits, but the git payload doesn't have it, here the error:

0|strider | 2016-11-21T15:11:43.877Z - error: TypeError: Cannot read property 'length' of undefined
0|strider | at startFromCommit (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:50:51)
0|strider | at receiveWebhook (/home/strider/strider/node_modules/strider-github/lib/webhooks.js:277:16)
0|strider | at Layer.handle [as handle_request] (/home/strider/strider/node_modules/express/lib/router/layer.js:95:5)
0|strider | at next (/home/strider/strider/node_modules/express/lib/router/route.js:131:13)
0|strider | at projectProvider (/home/strider/strider/lib/middleware.js:118:3)
0|strider | at Layer.handle [as handle_request] (/home/strider/strider/node_modules/express/lib/router/layer.js:95:5)
0|strider | at next (/home/strider/strider/node_modules/express/lib/router/route.js:131:13)
0|strider | at /home/strider/strider/lib/middleware.js:234:7
0|strider | at /home/strider/strider/node_modules/mongoose/lib/query.js:2257:18
0|strider | at tryCatcher (/home/strider/strider/node_modules/bluebird/js/release/util.js:16:23)
0|strider | at Promise._settlePromiseFromHandler (/home/strider/strider/node_modules/bluebird/js/release/promise.js:510:31)
0|strider | at Promise._settlePromise (/home/strider/strider/node_modules/bluebird/js/release/promise.js:567:18)
0|strider | at Promise._settlePromise0 (/home/strider/strider/node_modules/bluebird/js/release/promise.js:612:10)
0|strider | at Promise._settlePromises (/home/strider/strider/node_modules/bluebird/js/release/promise.js:691:18)
0|strider | at Async._drainQueue (/home/strider/strider/node_modules/bluebird/js/release/async.js:138:16)
0|strider | at Async._drainQueues (/home/strider/strider/node_modules/bluebird/js/release/async.js:148:10)
0|strider | at Immediate.Async.drainQueues [as _onImmediate] (/home/strider/strider/node_modules/bluebird/js/release/async.js:17:14)

git clone fails

After the last upgrade git clone in the prepare phase is giving a 500 error.
I had to downgrade to github 2.3.0 in order to continue working.

It says: Permission denied (public key). Fatal: could not read from a remote repository in all of our repositories but nothing has changed and it works again after the downgrade.

Getting a "Project not found" error when trying to connect to Github

So I am using Strider(HEAD -> dc751b7). If I use it on my local machine everything works as advertised, I can connect to Github and pull in projects and everything seems to be firing on all cylinders.

When I try to use it on an EC2 instance, I am using it with an Nginx proxy. Everything except the Github stuff appears to work. If I try and connect to Github I get the following message on a blank white page:

Project not found

The log shows:

GET /auth/github 404 6.018 ms - 17

At first I was using it without any special config, but then I found the information here:

https://github.com/Strider-CD/strider-github#custom-hostname

So I corrected the missing information(setup a new app in Github and used the ENV vars) and restarted. I've tried using an incognito window in Google Chrome thinking maybe it was caching the page from when I was trying to use the default configuration.

I've got my ENV variables set up(In a hidden file) as:

export SERVER_NAME=https://EC2_SERVER_URL
export PLUGIN_GITHUB_APP_ID=GITHUB_ID
export PLUGIN_GITHUB_APP_SECRET=GITHUB_SECRET
export PLUGIN_GITHUB_HOSTNAME=$SERVER_NAME

I'm using a super basic bash script to launch:

#!/bin/bash
source ~/.strider_vars
cd strider
npm start

Is there something I am missing, or is there some level of debugging I can do? I combed through the existing issues and couldn't find anything quite like this. Apologies in advance!

Setting up a private project I can access but do not own

Using [email protected]. In the list of projects I see all GitHub projects where I have access rights. However, when clicking on Add and while Setting up is running, I get an error:

Error creating project for repo user/project:
{"results":[],"status":"error","errors":[{"code":500,
"reason":"Failed to setup repo: Bad status code: 404"}]}

If I fork the project then I can set it up, no problem. Is this how the plugin is supposed to work? Why can it list the projects but not add them?

Unable to 'run' new projects due to ssh failure (publickey)

We've been using strider successfully for a while in our organization. However I noticed today that I cant 'run' newly added projects anymore, because of the following error:
Git clone failed with code 500

$ git clone --recursive [email protected]:getyippie/xxx.git . --branch master github 789ms -1
Cloning into '.'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists. 

some digging unveiled that previously added projects are using https and this one is using ssh. which led me to this pr #69

Is this supposed to work out of the box or do I need to manually add these keys?

verify_webhook_req() signature missing

I let strider setup my webooks, yet, they arnt working.

All i get is a log entry stating:
verify_webhook_req() signature missing

which doesn't give me much in terms of debugging. Have I missed anything in my setup?

The redirect_uri MUST match the registered callback

Hi

I'm running strider on port 7777, i've set this ENV variables:

export PORT=7777
export SERVER_NAME="http://my.server.ip.address"
export PLUGIN_GITHUB_APP_ID="hereComesTheId"
export PLUGIN_GITHUB_APP_SECRET="theSecretFromGithub"
export PLUGIN_GITHUB_HOSTNAME="http://my.server.ip.address"
export STRIDER_HOSTNAME="http://my.server.ip.address"

on github, if i set the callback to

http://my.server.ip.address:7777/auth/github/callback
it says: 500 AuthorizationError: The redirect_uri MUST match the registered callback URL for this application.

What i'm doing wrong?

Someone hit the webhook for 'xxx' and it failed to validate.

Strider was really easy to get mostly working! The only issue I'm having is that web hooks from github aren't validating and therefore aren't triggering builds.

I have a server running strider on http://localhost:3000 then I have nginx in front of that handling the ssl at https://ci.miketown3.com.

I'm trying to get notifications from https://github.com/rrrelay/named-logger and it's setup to hit https://ci.miketown3.com/rrrelay/named-logger/api/github/webhook.

In the strider logs, I see

 warn: Someone hit the webhook for rrrelay/named-logger and it failed to validate
POST /rrrelay/named-logger/api/github/webhook 401 55ms - 17b

I've been testing the webhook from the github page and it looks like this...
2014-03-16_2059

I've also created a new github application and set the env variables PLUGIN_GITHUB_APP_ID and PLUGIN_GITHUB_SECRET to the client id and client secret.

Is the payload missing the x-hub-signature header or something? Any help/ideas would be greatly appreciated! Thanks!

Env variables needed to configure

So I'm trying to get my github setup working, but I think I had my base url misconfigured before. So now I revoked the permissions and set the right base url, but it still looks for the localhost base for the github callback url.

Are there any ENV variables for this plugin, would love a list so we can add to the readme.

Failure When Adding Second Github Account

I successfully setup a Strider account and attached a Github repo to it. When attempting this with a second Strider account, however, I received the following 500 error during the callback from Github:

Connect
500 TypeError: Cannot read property '0' of undefined
   at makeAccount (/app/node_modules/strider-github/lib/webapp.js:167:28)
   at Strategy.validateAuth [as _verify] (/app/node_modules/strider-github/lib/webapp.js:152:26)
   at /app/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:188:22
   at /app/node_modules/strider-github/node_modules/passport-github/lib/strategy.js:109:5
   at passBackControl (/app/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:125:9)
   at IncomingMessage.<anonymous> (/app/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:142:7)
   at IncomingMessage.emit (events.js:129:20)
   at _stream_readable.js:908:16
   at process._tickCallback (node.js:355:11)

Delete branch

Hi,

In our team we need to exec something (with custom-scripts plugin) when deleting a branch. However, since Strider first tries git cloneand fails, the custom-scripts plugin is not executed.

We can check when a branch is deleted with her payload:

created: false,
deleted: true,
forced: true,
...

Is it possible to Strider doesn't do a git clone and continue with the other plugins? If not, do you think it's possible to make some code changes to get it? I could do, of course, if you give some hints.
Any suggestions are welcome.

Thanks in advance.

Allow specification of APP_ID, SECRET, DOMAIN, ENDPOINT per account

I'd like to be able to manage my github enterprise and github.com repos on the same strider instance. As of right now, I can only do one or the other (since the config is locked in by the environment config).

What I'd like to do is add some additional fields to the "Add Account" form. These fields can be hidden by default, shown when a user clicks an "Advanced Options" button. These fields would default to the values defined in the environment variables, but would allow the user to override them in the form if they want:

  • APP_ID
  • SECRET
  • DOMAIN
  • ENDPOINT

Invalid Signature

GitHub webhook POSTs are being rejected with the message Invalid Signature. It seems like GitHub may have recently changed their API, because the POSTs do not contain a X-Hub-Signature for Strider to verify.

I have tried deleting the service hooks and re-adding them from the strider project config page to no avail.

Question: Do you need an email address for Github to work?

This line seems to throw if I don't have a public email displayed on my profile, however, I have two invisible emails setup:

https://github.com/Strider-CD/strider-github/blob/master/lib/webapp.js#L169

if (!profile.emails || !profile.emails.length)

What's more, the next line at which an email is used potentially doesn't care if you do have one or not:
https://github.com/Strider-CD/strider-github/blob/master/lib/webapp.js#L181

mail: profile.emails ? profile.emails[0].value : null,

So should one have a public email or not?

obviously one of these lines needs to change

poor error when failing authorization due to lack of email address

There is this error, which is apparently no longer thrown if you set your email address correctly in github.

Code there needs to be inspected and determined if a better error can be thrown, e.g. "You need to enter your email address into Github."

Express
500 TypeError: Cannot read property '0' of undefined
at makeAccount (/Users/Hamid/Developer/strider/node_modules/strider-github/lib/webapp.js:167:28)
at Strategy.validateAuth as _verify
at /Users/Hamid/Developer/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:188:22
at /Users/Hamid/Developer/strider/node_modules/strider-github/node_modules/passport-github/lib/strategy.js:109:5
at passBackControl (/Users/Hamid/Developer/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:126:9)
at IncomingMessage. (/Users/Hamid/Developer/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:143:7)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:920:16
at process._tickCallback (node.js:415:13)

Ref original issue: Strider-CD/strider#599

Github auth callback url issue

Seems like strider-github doesn't use SERVER_NAME to build github auth callback url.

It always redirects me to localhost.

Bitbucket integration works well though.

Unable to install with StriderCD 1.6.0

2015-01-17_22:23:03.54172 /strider/node_modules/strider-github/lib/webapp.js:71
2015-01-17_22:23:03.54183 clientSecret: config.appSecret
2015-01-17_22:23:03.54183 ^^^^^^^^^^^^
2015-01-17_22:23:03.54751 2015-01-17T22:23:03.547Z - info: failed to load plugin github Unexpected identifier SyntaxError: Unexpected identifier
2015-01-17_22:23:03.54751 at Module._compile (module.js:439:25)
2015-01-17_22:23:03.54752 at Object.Module._extensions..js (module.js:474:10)
2015-01-17_22:23:03.54752 at Module.load (module.js:356:32)
2015-01-17_22:23:03.54752 at Function.Module._load (module.js:312:12)
2015-01-17_22:23:03.54752 at Module.require (module.js:364:17)
2015-01-17_22:23:03.54753 at require (module.js:380:17)
2015-01-17_22:23:03.54753 at /strider/node_modules/strider-extension-loader/lib/index.js:323:29
2015-01-17_22:23:03.54753 at /strider/node_modules/strider-extension-loader/lib/index.js:354:11
2015-01-17_22:23:03.54753 at /strider/node_modules/strider-extension-loader/node_modules/async/lib/async.js:511:21
2015-01-17_22:23:03.54753 at /strider/node_modules/strider-extension-loader/node_modules/async/lib/async.js:227:13
2015-01-17_22:23:03.54797 2015-01-17T22:23:03.547Z - error: [SyntaxError: Unexpected identifier; error loading plugin github]
2015-01-17_22:23:03.54822 2015-01-17T22:23:03.548Z - error: Failed to load plugins

Problems in GitHub communication

Today I noticed that our strider is no longer processing commits from our projects.

When looking into the issue, I noticed some problems which were apparently fixed by #16 (please but another release to NPM btw). Even after I applied those changes to our install, I still see the following response on GitHub:

TypeError: Cannot read property 'author' of undefined
    at pushJob (/home/deploy/strider/node_modules/strider-github/lib/webhooks.js:140:19)
    at startFromCommit (/home/deploy/strider/node_modules/strider-github/lib/webhooks.js:42:16)
    at receiveWebhook (/home/deploy/strider/node_modules/strider-github/lib/webhooks.js:222:3)
    at callbacks (/home/deploy/strider/node_modules/express/lib/router/index.js:164:37)
    at projectProvider (/home/deploy/strider/lib/middleware.js:107:3)
    at callbacks (/home/deploy/strider/node_modules/express/lib/router/index.js:164:37)
    at Promise.<anonymous> (/home/deploy/strider/lib/middleware.js:201:5)
    at Promise.<anonymous> (/home/deploy/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:162:8)
    at Promise.EventEmitter.emit (events.js:95:17)
    at Promise.emit (/home/deploy/strider/node_modules/mongoose/node_modules/mpromise/lib/promise.js:79:38)

I see that error for the test request that GitHub sends when you add a new hook.

Failed to obtain access token

I'm running Strider on port 3000 behind an Apache server (on Mac OS X). I've set the env vars: PLUGIN_GITHUB_APP_ID, PLUGIN_GITHUB_APP_SECRET, SERVER_NAME and URL prior to launching Strider. When I authorize my app at GitHub it hangs for almost a minute and tries to load this URL: http://myserver.com/auth/github/callback?code=xxxyyy

Then I get this message:

500 InternalOAuthError: Failed to obtain access token
   at Strategy.OAuth2Strategy._createOAuthError (/usr/local/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:348:17)
   at /usr/local/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:171:43
   at /usr/local/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:176:18
   at ClientRequest.<anonymous> (/usr/local/lib/node_modules/strider/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:147:5)
   at ClientRequest.emit (events.js:107:17)
   at TLSSocket.socketErrorListener (_http_client.js:271:9)
   at TLSSocket.emit (events.js:129:20)
   at net.js:950:16
   at process._tickCallback (node.js:355:11)

Any idea what's wrong?

Use SSH authentication instead of HTTPS

Hello,

I am running into a problem with the following situation:
I have a python project on github that depends other private repositories within the organization. When I run the tests using the docker runner, the repository is cloned using https authentication and no private key is used (and hence no private key is placed inside the repository). The way we install the dependencies would be by calling:

pip install -e git+ssh://[email protected]/organization/repository.git@master#egg=repository

This would of course fail because this requires the private key.

If we switch authentication to ssh, this will force the private key to be put on the machine and used for all github communication (because of this: https://github.com/chriz2600/strider-docker-gitane-camo/blob/master/index.js#L15).

Best Regards,
Mohannad

Plugin crashes when pull request has merge conflict

Our private github repo is triggering Strider every time someone creates pull request.
If pull request can be successfully merged everything works well but if there is a merge conflict strider-git module crashes and I'm ending up with forever pending status ( strider-github-status ):
strider_issue

This is where job gets stuck :

  strider-git:worker Git Version:1.8 +360ms
  strider-git gitane command done git clone --recursive [email protected]:*******.git . --branch master; exit code 0; duration 1223 +1s
  strider-git Gitane error: +259ms undefined
  strider-git gitane command done git fetch origin refs/pull/14/merge; exit code 128; duration 258 +1ms

Exception is coming from git fetch origin refs/pull/14/merge which can't be resolved since there is a merge conflict. Everything goes south on prepare stage:

Error: Fetch refs/pull/14/merge failed with code 500
    at badCode (/usr/local/strider/node_modules/strider-github/node_modules/strider-git/worker.js:93:11)
    at /usr/local/strider/node_modules/strider-github/node_modules/strider-git/worker.js:183:19
    at /usr/local/strider/node_modules/strider-github/node_modules/strider-git/lib/index.js:126:5
    at Function.<anonymous> (/usr/local/strider/node_modules/strider-github/node_modules/gitane/index.js:173:7)
    at next (/usr/local/strider/node_modules/strider-github/node_modules/step/lib/step.js:51:23)
    at ChildProcess.<anonymous> (/usr/local/strider/node_modules/strider-github/node_modules/gitane/index.js:159:9)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:498:12)

OAuth issue

Hi there.

I tried to setup Github with my strider installation on heroku. I create the Github app, created environment variables as per as this comment but I'm still not able to login.

Here is the error message:

500 AuthorizationError: The redirect_uri MUST match the registered callback URL for this application.

at Strategy.OAuth2Strategy.authenticate (/app/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/lib/strategy.js:126:25)
at attempt (/app/node_modules/passport/lib/middleware/authenticate.js:341:16)
at authenticate (/app/node_modules/passport/lib/middleware/authenticate.js:342:7)
at callbacks (/app/node_modules/express/lib/router/index.js:164:37)
at param (/app/node_modules/express/lib/router/index.js:138:11)
at pass (/app/node_modules/express/lib/router/index.js:145:5)
at Router._dispatch (/app/node_modules/express/lib/router/index.js:173:5)
at Object.router (/app/node_modules/express/lib/router/index.js:33:10)
at next (/app/node_modules/express/node_modules/connect/lib/proto.js:193:15)
at Object.handle (/app/lib/auth.js:125:5)

And my configuration:

PLUGIN_GITHUB_HOSTNAME = https://tbouron-ci.herokuapp.com/
STRIDER_HOSTNAME = https://tbouron-ci.herokuapp.com/
SERVER_NAME = https://tbouron-ci.herokuapp.com/
Callback URL on Github app = https://tbouron-ci.herokuapp.com/auth/github/callback

Do you know what is going on?

Thanks.

Not sure how to install this alongside Strider itself

Been reading all the READMEs and a little bit of the code but can't find a step by step on how to install strider-github alongside strider itself. Is it a standalone server? Where does it go? I tried

$ bin/strider install strider-github
GET [ecosystem]/plugins.yml
strider-github is not a valid plugin

Any guidance greatly appreciated!

add remove service hooks buttons does nothing

There is no feedback when pressing the buttons, nor do they do anything in the github repo.

After removing and adding the project again I can however mention that the webhook url is significantly changed.

Cleanup duplication in api.js

The only reference to the file is in a test. It's not used in this plugin and I can't find another plugin that references it.

In fact, there is a lot of code duplication between api.js and index.js.

Error creating project (Failed to setup repo: Bad status code: 401)

I run strider behind a reverse proxy. Strider run on localhost:3000 (default settings) and my http server proxy it to http://mydomain.com (port 80)

Env variables set up:

SERVER_NAME="http://mydomain.com"
PLUGIN_GITHUB_HOSTNAME="http://mydomain.com"
PLUGIN_GITHUB_APP_ID="xxxxx"
PLUGIN_GITHUB_APP_SECRET="xxxx"

I can connect to github successfully and get back to strider with my project list, but when I click on "Add project, I get the following error:

Error creating project for repo xxx/xxx: {"results":[],"status":"error","errors":[{"code":500,"reason":"Failed to setup repo: Bad status code: 401"}]}

In the logs:

error: InternalOAuthError: Failed to fetch user profile (status: 401 data: {"message":"Bad credentials","documentation_url":"https://developer.github.com/v3"})
strider-1 (err):     at /var/www/strider.tweakstyle.com/html/node_modules/strider-github/node_modules/passport-github/lib/strategy.js:95:19
strider-1 (err):     at passBackControl (/var/www/strider.tweakstyle.com/html/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:123:9)
strider-1 (err):     at IncomingMessage.<anonymous> (/var/www/strider.tweakstyle.com/html/node_modules/strider-github/node_modules/passport-github/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:142:7)
strider-1 (err):     at IncomingMessage.EventEmitter.emit (events.js:117:20)
strider-1 (err):     at _stream_readable.js:920:16
strider-1 (err):     at process._tickDomainCallback (node.js:459:13)

Strider build 'undefined' branch when tag is pushed

Recent strider + plugin upgrade caused this error. Have not yet determined what caused the breaking change.

When I push a new tag to my repo, strider attempts to build it, but <%= ref.branch %> returns undefined. Previously, strider would only build on branch pushes and not on new tags.

It's also possible this was a change in Github's webooks, but I haven't confirmed that. I tried disabling the 'Create' webhook event (Only 'Pull Request' and 'Push' options set), and it still sends a webhook and attempts to build it.

Note: This is causing some havoc with my build scripts, which expect a valid branch name. I've had to add checks for undefined branch in all build scripts so it doesn't cause deployment problems.

screen shot 2016-10-25 at 11 35 30 am

screen shot 2016-10-25 at 11 35 49 am

Strider fails to install deploy key

I added a repo from a private organization (this whole procedure in itself has major issues if the third-party access for the organization is set to Access restricted). I was unable to run tests for that repo and noticed that no deploy key was installed by Strider.

Git Clone Invalid Syntax

I tried manually setting up a connection to bitbucket but it looks like the repo url is being incorrectly quoted in the git clone command.

strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'Cloning into \'.\'...\n' } +76ms strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'conq: invalid command syntax.\n' } +6s strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'f' } +2ms strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'atal: ' } +1ms strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'C' } +0ms strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': 'ould not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.' } +1ms strider-runner-core:job Job "588ce062920b8607c0eb1017" status: stderr { '0': 'stderr', '1': '\n' } +2ms strider-git Gitane error: process exited with status 128 +3ms strider-git gitane command done git clone --recursive '[email protected]:strickdj/test-repo.git' . --branch master; exit code 128; duration 5995 +0ms

I set up a test script with the following:
`var fs = require('fs')
var gitane = require('gitane')
var path = require('path')
// Use current working dir
var baseDir = process.cwd()
// Read private key from ~/.ssh/id_dsa
var privKey = fs.readFileSync(path.join(__dirname, 'striderci'), 'utf8');

gitane.run(baseDir, privKey, "git clone --recursive '[email protected]:strickdj/test-repo.git' ./test --branch master",
function(err, stdout, stderr, exitCode) {
if (err) {
console.log("An error occurred: " + stderr)
process.exit(1)
}
console.log("Git clone complete!")
})`

which produces the following:

`An error occurred: Cloning into './foo'...
conq: invalid command syntax.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.`

it works correctly when i remove the quotes around the repo.

webhooks.js expecting objects to exist that do not

We have a simple setup of 3 branches that auto-build when updated, but master does not. Wanted to get this here as a placeholder before I have time to dig in in case anyone else is working on this...some extra checking would avoid these errors but if I had to guess there is an underlying issue with webhooks firing on branches that are disabled.

2016-02-19T00:30:11.474Z - error: TypeError: Cannot read property 'author' of null
    at pushJob (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:166:19)
    at startFromCommit (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:49:16)
    at receiveWebhook (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:262:16)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at projectProvider (/home/ubuntu/striderCD/lib/middleware.js:120:3)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at Promise.<anonymous> (/home/ubuntu/striderCD/lib/middleware.js:239:7)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at Promise.resolve (/home/ubuntu/striderCD/node_modules/mongoose/lib/promise.js:114:23)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at /home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1406:13
    at model.Document.init (/home/ubuntu/striderCD/node_modules/mongoose/lib/document.js:254:11)
2016-02-19T02:40:20.295Z - error: TypeError: Cannot read property 'message' of undefined
    at startFromCommit (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:52:17)
    at receiveWebhook (/home/ubuntu/striderCD/node_modules/strider-github/lib/webhooks.js:262:16)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at projectProvider (/home/ubuntu/striderCD/lib/middleware.js:120:3)
    at Layer.handle [as handle_request] (/home/ubuntu/striderCD/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/ubuntu/striderCD/node_modules/express/lib/router/route.js:131:13)
    at Promise.<anonymous> (/home/ubuntu/striderCD/lib/middleware.js:239:7)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at Promise.resolve (/home/ubuntu/striderCD/node_modules/mongoose/lib/promise.js:114:23)
    at Promise.<anonymous> (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:177:8)
    at emitOne (events.js:90:13)
    at Promise.emit (events.js:182:7)
    at Promise.emit (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:84:38)
    at Promise.fulfill (/home/ubuntu/striderCD/node_modules/mpromise/lib/promise.js:97:20)
    at /home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1406:13
    at model.Document.init (/home/ubuntu/striderCD/node_modules/mongoose/lib/document.js:254:11)
    at completeOne (/home/ubuntu/striderCD/node_modules/mongoose/lib/query.js:1404:10)

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.