felixrieseberg / vsc-travis-ci-status

:shipit: Check the status of your Travis CI project from Visual Studio Code
MIT License
23 stars 15 forks source link

vsc-travis-ci-status doesn't seem to work through a corporate proxy #1

Open joeskeen opened 8 years ago

joeskeen commented 8 years ago

I work behind an NTLM-authenticated proxy, and have set the environment variables http_proxy and https_proxy to http://user:password@proxy.company.com:8080. Normally, VSCode/Node/etc are able to use the environment variable to navigate through the proxy, but this plugin gives me this message when connected through the proxy.

Travis could not find joeskeen/DefinitelyTyped

Today I was working remotely, and upon disconnecting the VPN it started working. In the VS Code settings, there is a proxy setting:

//-------- HTTP configuration --------

    // The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables
    "http.proxy": "",

I would expect that this extension would use the same proxy information (configuration, with fallback to environment variables).

felixrieseberg commented 8 years ago

That seems fair. I'll provide a fix - thanks for reporting!

felixrieseberg commented 8 years ago

I just pushed an update that is using global-tunnel to setup proxies. It won't read the local configuration (we're instead just going with the environment variable for now), but it should work. Since I'm using node-travis-ci to talk to Travis, I'm not 100% certain that global tunnel is successfully injecting itself into the http calls - would you mind giving the new version a try to see whether or not it works?

joeskeen commented 8 years ago

@felixrieseberg , after installing the update, I'm not able to use it at all. It doesn't show up automatically, and if I try to bring it up using > Travis CI: Update Status, I get an error message from Code: Running the contributed command:'extension.openInTravis' failed. You may want to roll back to the last stable release :disappointed: If there is a way that I can test changes without you having to publish a new version globally, that would be ideal. I wouldn't want you to lose potential users because your plugin crashes.

felixrieseberg commented 8 years ago

Well, that was clearly to quick - I'll take another look at this tomorrow. For now, I'm handling unauthenticated proxies (and I realize that that's not super useful), but it should no longer break ;-)

joeskeen commented 8 years ago

FYI, After updating again I still get the Running the contributed command:'extension.updateTravis' failed. error message. I wish it would give me an error message or a log I could look at and provide more details. I'm wondering if it's seeing my proxy URL and since it doesn't fit the Regex for an unauthenticated proxy it's throwing an error?

Also, I took a look at the node-travis-ci code and it looks like it's just using request under the hood. This is interesting because when I use request for other things I never have had to specify proxy information (I think it takes care of it automatically). I'll have to investigate further to see if I can come up with anything else.

joeskeen commented 8 years ago

I (re)found how to open the developer tools inside of VS Code, and found this error:

TypeError: Cannot set property 'host' of undefined: TypeError: Cannot set property 'host' of undefined
    at setupProxy (/Users/joeskeen/.vscode/extensions/felixrieseberg.vsc-travis-ci-status/out/extension.js:38:34)
    at updateStatus (/Users/joeskeen/.vscode/extensions/felixrieseberg.vsc-travis-ci-status/out/extension.js:23:9)
    at /Users/joeskeen/.vscode/extensions/felixrieseberg.vsc-travis-ci-status/out/extension.js:15:13
    at Object.p [as _notify] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:5:3663)
    at Object.__dirname.undefined.L.enter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:5:6825)
    at __dirname.undefined.t.Class.define._run (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:5:8651)
    at __dirname.undefined.t.Class.define._completed (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:5:8092)
    at Object.p.handle (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:11:17199)
    at process.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/pluginHostProcess.js:19:8977)
    at emitTwo (events.js:87:13)

Hopefully that is useful to you.

felixrieseberg commented 8 years ago

Thanks - I caught the error and fixed it right away, so updating again should help. Sorry that I took you on this rollercoaster - I'm at the airport and somehow thought I'd be able to quickly help you out.

joeskeen commented 8 years ago

No worries... I'll look forward to seeing this feature working when you can get to it. Or, who knows? Maybe I'll get some spare time and submit a PR!