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

Mergify not working behind a proxy #11

Open
jlengrand opened this issue Apr 18, 2018 · 5 comments
Open

Mergify not working behind a proxy #11

jlengrand opened this issue Apr 18, 2018 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jlengrand
Copy link
Collaborator

Not something you might want to fix now, but I just wanted to let you know that mergify does not work if you are behind a proxy at the moment :).
(Even with HTTP_PROXY and other variables set).

@RamonGebben
Copy link
Owner

How would I reproduce this?

@RamonGebben RamonGebben added enhancement New feature or request help wanted Extra attention is needed labels Apr 18, 2018
@jlengrand
Copy link
Collaborator Author

This is a very good question.

I guess by setting up a proxy :).

@jlengrand
Copy link
Collaborator Author

Alright, I just tested and this is what I get trying to access gitlab.com when behind the proxy

[jlengrand@rn07t1c18:~/IdeaProjects/mergify]$ node index.js -a
⠹ Retrieving all Merge Requests assigned to you(node:73228) UnhandledPromiseRejectionWarning: FetchError: request to https://gitlab.com/api/v4//merge_requests?scope=all&assignee_id=16946 failed, reason: getaddrinfo ENOTFOUND gitlab.com gitlab.com:443
    at ClientRequest.<anonymous> (/Users/jlengrand/IdeaProjects/mergify/node_modules/node-fetch/lib/index.js:1393:11)
    at ClientRequest.emit (events.js:180:13)
    at TLSSocket.socketErrorListener (_http_client.js:395:9)
    at TLSSocket.emit (events.js:180:13)
    at emitErrorNT (internal/streams/destroy.js:64:8)
    at process._tickCallback (internal/process/next_tick.js:178:19)
(node:73228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:73228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠼ Retrieving all Merge Requests assigned to you

I'll try to look deeper into the issue

@jlengrand
Copy link
Collaborator Author

Alright, so apparently @RamonGebben has all the answers, and the issue can be fixed by doing the following :

yarn add https-proxy-agent

and then adding this in the doFetch fetchOptions :

agent:new HttpsProxyAgent('http://127.0.0.1:3128')

More info can be found here : https://github.com/TooTallNate/node-https-proxy-agent.

I have to think about how to fix that in a nicer way (maybe adding a config flag)

@RamonGebben
Copy link
Owner

@jlengrand I would agree that in the config would be the best place to put it.
You can easily extend the questions that are asked in lib/commands/configure/inputOptions.js these answers should be magically picked up by the config.

How ever we would need to start thinking about update paths.

I'll open a issue for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants