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

Scale-up lambda fails with error - HttpError: Integration not found in ghe.com #4364

Open
neethu-p opened this issue Jan 15, 2025 · 6 comments

Comments

@neethu-p
Copy link

neethu-p commented Jan 15, 2025

Hello Team,

I am attempting to implement the multi-runner module in a our GitHub Enterprise Cloud with data residency instance hosted on companyname.ghe.com. With this data residency feature of Github, the API URL has changed from api.github.com to api.companyname.ghe.com.

In this case the creatAuthAppfunction in scale-up.ts fails, as the API endpoint is not set .Hence the scale-up lambda function is failing with the following error: "message": "Ignoring error: HttpError: Integration not found - https://docs.github.com/rest. `Could you confirm if this module is currently supported in the GitHub with ghe.com domain?

It works fine in our in Enterprise and public Cloud GH instances.

@npalm
Copy link
Collaborator

npalm commented Jan 15, 2025

I have no option to test the module on ghe.com. The module should work on GHES, but also that version I cannot test. You could try to configure the module with GHES. If I am coorect you can set the API endpoint in that case.

Would be great to get people on this OS module that can support and test those cases.

@neethu-p
Copy link
Author

neethu-p commented Jan 15, 2025

In GHES the API endpoint is ghesUrl/api/v3, which works as expected. But in our case the API endpoint is https://api.companyname.ghe.com, for which I don't see any option to set the api url.
I can try to open up a PR with supporting changes

@npalm
Copy link
Collaborator

npalm commented Jan 15, 2025

Had a quick look in the code, but maybe you can just pass the url in the ghes parameter:

export async function createOctokitClient(token: string, ghesApiUrl = ''): Promise<Octokit> {
const CustomOctokit = Octokit.plugin(throttling);
const ocktokitOptions: OctokitOptions = {
auth: token,
};
if (ghesApiUrl) {
ocktokitOptions.baseUrl = ghesApiUrl;
ocktokitOptions.previews = ['antiope'];
}

@neethu-p
Copy link
Author

I think the ghesApiUrl is derived from the ghes-url param here -

@npalm
Copy link
Collaborator

npalm commented Jan 15, 2025

Yes I think you are right, so it is hard-coded :( (partially).

I think it would be better to make it in the lambda more generic. In case we could get it backwards compatible via terraform that would be nice. But would certainly avoid having more cased in the code, should work if we just inject the full url. Would be great if uyou can propose a PR.

You can run a quick test, by just chainging the the Lambda code (even hardcoded). And run yarn install && yarn dist to build packages. Just to quickly test if that is the only change you need.

@neethu-p
Copy link
Author

Hello, I have raised a PR with changes here - #4367. Please have a look

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

2 participants