LSP-copilot icon indicating copy to clipboard operation
LSP-copilot copied to clipboard

support github enterprise setting

Open TerminalFi opened this issue 1 year ago • 7 comments

Untested

Should work out of the box. I am on Paternity leave and wont be able to test for ~6 weeks

TerminalFi avatar Mar 13 '24 22:03 TerminalFi

Maybe @raffeyang can test this.

jfcherng avatar Mar 14 '24 03:03 jfcherng

I tested and found that it doesn't seem to work properly. If you need it, I can provide an enterprise test link.My config is below

{
	"settings": {
		"github-enterprise": {
			"uri": "http://XXX@XXX:28443"
		}
	}
}

RaffeYang avatar Mar 14 '24 14:03 RaffeYang

I should be able to test this today. Thanks

TerminalFi avatar Mar 14 '24 14:03 TerminalFi

Update, not sure why this isnt working. I've returned to work and I am still investigating

TerminalFi avatar Apr 26 '24 17:04 TerminalFi

I tested and found that it doesn't seem to work properly. If you need it, I can provide an enterprise test link.My config is below


{

	"settings": {

		"github-enterprise": {

			"uri": "http://XXX@XXX:28443"

		}

	}

}

I'll push some changes. I have no way to test though

TerminalFi avatar Jun 20 '24 04:06 TerminalFi

hi @raffeyang , could you test against this branch again?

jfcherng avatar Jun 21 '24 07:06 jfcherng

@raffeyang This appears to be working now. But still need confirmation from you. From my testing, once you change the URL Copilot leverages the new URL for Auth.

TerminalFi avatar Jun 22 '24 03:06 TerminalFi

Just following up here.

Copilot monitors these settings keys

:: [23:52:53.476] <-- LSP-copilot workspace/configuration (0): {'items': [{'section': 'http'}, {'section': 'github-enterprise'}, {'section': 'github.copilot'}]}
:: [23:52:53.476] >>> LSP-copilot (0) (duration: 0ms): [None, None, None]
  • http
  • github-enterprise
  • github.copilot

When adding the setting authProvider: "github-enterprise" and then adding the settings below

		"github-enterprise": {
			"url": "https://github.com",
		},

we can see copilot attempting to re-authenticate

:: [23:54:50.107] <-- LSP-copilot workspace/configuration (0): {'items': [{'section': 'http'}, {'section': 'github-enterprise'}, {'section': 'github.copilot'}]}
:: [23:54:50.107] >>> LSP-copilot (0) (duration: 0ms): [None, {'url': 'https://github.com'}, None]
:: [23:54:50.108] <<< LSP-copilot (2) (duration: 110ms): {'version': '1.211.0', 'buildType': 'prod', 'runtimeVersion': 'node/18.17.1'}
:: [23:54:50.140] <<< LSP-copilot (4) (duration: 142ms): 'OK'
:: [23:54:50.140] <<< LSP-copilot (5) (duration: 142ms): 'OK'
:: [23:54:51.161] <-  LSP-copilot featureFlagsNotification: {'rt': True, 'sn': False, 'chat': True}
:: [23:54:51.161] <-  LSP-copilot featureFlagsNotification: {'rt': True, 'sn': False, 'chat': True}
:: [23:54:51.161] <-  LSP-copilot featureFlagsNotification: {'rt': True, 'sn': False, 'chat': True}
:: [23:54:51.162] <<< LSP-copilot (3) (duration: 1164ms): {'status': 'OK', 'user': 'terminalfi'}

We can see that it worked still, even though the URL isn't for a login domain or enterprise. That is because copilot has 2 features

  1. It validates the URL before auth
  2. Has fall backs if the URL isn't authorized

What does this mean? I don't know to be honest. It seems there is some restrictions on the enterprise url value. But at the end of the day, this is working from a perspective that we send copilot the expected data.

TerminalFi avatar Jul 28 '24 04:07 TerminalFi

@jfcherng If no objections, we can merge this. Thoughts?

TerminalFi avatar Jul 28 '24 05:07 TerminalFi

@jfcherng If no objections, we can merge this. Thoughts?

let's go

jfcherng avatar Jul 28 '24 05:07 jfcherng