-
Notifications
You must be signed in to change notification settings - Fork 981
Add configurable GitHub Enterprise API base URL for key checks and API calls #3597
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
base: main
Are you sure you want to change the base?
Add configurable GitHub Enterprise API base URL for key checks and API calls #3597
Conversation
|
In your local branch, run: git rebase HEAD~1 --signoff |
4fc1041 to
b770a47
Compare
MoralCode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the enthusiasm with submitting a PR
I left some feedback in the review. I think this PR has potential as a more narrow refactoring to allow us to swap out the github base domain by using a function, but I think we may need to wait for a more comprehensive method of fetching the urls (i.e. from a database) before we are able to swap things in like that.
we are quite backlogged on PRs at the moment as well, so please be patient as we try and get through them all starting in mid-February
| "gitlab": "<gl_api_key>" | ||
| "gitlab": "<gl_api_key>", | ||
| "github_api_base_url": "https://api.github.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not sure this is the good long-term solution we are hoping for.
Whille this issue is specifically about githubs url, we also have our sights set on adding more platforms, and using the config in this way will require code changes for every url that is added - i.e. if someone wants to add a self hosted Forgejo instance).
Ultimately, we want to be able to dynamically find API keys for a particular platform and domain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this PR acts as necessary stepping stone, by refactoring these hardcoded strings now, we isolate "Base URL" dependency into single utility functiongithub_api_url.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this PR begins to address, and may sufficiently for a proof of concept, fully address multitenancy, which is a long ambition of Augur. Handling Enterprise GitHub is a pretty huge step forward.
One question: @SuyashJain17 : Do we have an enterprise GitHub we can test this against, because I do not have such access.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t currently have access to a live GitHub Enterprise instance.
This was implemented against GitHub’s documented Enterprise API behavior (including /api/v3 and /graphql), and the change is fully opt-in.
If there’s an internal Enterprise test environment available, I’m happy to validate or adjust based on real responses.
cd74789 to
ae9f3e8
Compare
MoralCode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better! Just a few more things to really clean things up
Given how much you change the except blocks (probably for pylint) I'd say move those into a new PR (or better yet, see if theres an issue you can document them in we need some nice good first issues for CHAOSScon attendees
| err = process_graphql_dict_response(logger,result,response_data) | ||
| err = process_dict_response(logger, result, response_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesnt seem related to swapping out github API urls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuyashJain17 : I have a theory about why this is here, but i would like to know from you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s fair - this change is not strictly required for the base URL work.
It was done while refactoring the surrounding logic to reduce duplicated response-handling paths, but I agree it expands the scope.
| except: | ||
| except (json.JSONDecodeError, AttributeError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helpful change, but hesitant about including it in this PR? I guess its probably fine
| import random | ||
|
|
||
| from typing import List | ||
| from sqlalchemy.orm import Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also my question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it since it wasn’t being used in the current code path.
If it’s meant to support future logic or an implicit dependency, I’m happy to add it back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if youd like to clean it up. that may be better for a separate PR specifically dedicated to cleanup and formatting. Having too many unrelated changes in one PR makes it hard to be confident that things will still work afterwards
sgoggins
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need some of the questions answered by @SuyashJain17 to understand the state here, but I like the direction!
| "gitlab": "<gl_api_key>" | ||
| "gitlab": "<gl_api_key>", | ||
| "github_api_base_url": "https://api.github.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this PR begins to address, and may sufficiently for a proof of concept, fully address multitenancy, which is a long ambition of Augur. Handling Enterprise GitHub is a pretty huge step forward.
One question: @SuyashJain17 : Do we have an enterprise GitHub we can test this against, because I do not have such access.
| err = process_graphql_dict_response(logger,result,response_data) | ||
| err = process_dict_response(logger, result, response_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SuyashJain17 : I have a theory about why this is here, but i would like to know from you.
| import random | ||
|
|
||
| from typing import List | ||
| from sqlalchemy.orm import Session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also my question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No code changes have been made since my prior comments so my prior request for changes stands. I'd be willing to merge this if it only swapped out the github domain everywhere we use it with a function call such that we COULD put an enterprise URL there in the future. I think the broader "support GHE properly" type fixes need to be done as part of my broader effort towards expanding platform support
I suspect i could find someone with GHE access to help validate too, but i dont think that it should block the merging of this if changed to match the above
|
Thanks for clarifying , I’ll push an update that reverts the unrelated refactors and keeps this PR limited strictly to swapping api.github.com usage with a centralized accessor. |
… AttributeError on bare metal installs Signed-off-by: Pratyksh Gupta <pratykshgupta9999@gmail.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…nts and contributors Signed-off-by: Shlok Gilda <gildashlok@hotmail.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…eter and skip the db stuff Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…or the merging functionality Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: pushpit kamboj <pushpitkamboj@gmail.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: iGufrankhan <gufrankhankab123@gmail.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…throwing an exception Assisted-by: GPT5 via cursor Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…ved. Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…tch them to re-emit celery exceptions. Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
…iases table Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <adredwar@redhat.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Adrian Edwards <17362949+MoralCode@users.noreply.github.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Sean P. Goggins <s@goggins.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Sean P. Goggins <outdoors@acm.org> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com> Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
e3770d3 to
4fcf074
Compare
Signed-off-by: Suyash Jain <suyashjain1707@gmail.com>
fd0ae40 to
2a94523
Compare
Signed-off-by: Suyash Jain <153724685+SuyashJain17@users.noreply.github.com>
|
Hello! Just wanted to check in to see if you were still interested in helping the maintainers merge this PR. We noticed it has been a little while since this last had activity, and are considering closing it or taking it over if it remains in its current state. Please react to or reply to this to confirm your interest in the next 7 days or let us know if you are no longer interested in this so we can best prioritize everyone's contributions. Thanks! |
Description
github_api_base_urloption is introduced under theKeysconfiguration section, defaulting to the public GitHub API.https://api.github.comreferences across the codebase have been replaced with calls to a centralized URL management utility.This PR fixes #3277
Summary
This implementation addresses issue #3277 by:
github_api_base_urlconfig option.https://api.github.com, so existing installations work without any changes.Notes for Reviewers
/api/v3in the base URL; users can provide the full API root via configuration as needed.Signed commits