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

Add support for Type III and Type IV GHE configurations in consult-gh-forge #182

Open
lhernanz opened this issue Dec 27, 2024 · 3 comments

Comments

@lhernanz
Copy link

See magit/forge#174 (comment) for more context. But the TLDR is that hosts can have more than /api in the path and that makes the method that retrieves the credentials from the gh command line to fail. The fix could be to remove all the path components from host by using something like:

((string-match "/" host) (string-trim-right host "/.*"))

instead of the current code here:

((string-suffix-p "/api" host) (string-trim-right host "/api"))

@armindarvish
Copy link
Owner

@lhernanz, the solution you are suggesting seems too general to me, and can lead to other issues later. (string-match "/" host) would match anything with /! and (string-trim-right host "/.*") would remove everything after a single /. Can you suggest something more specific?

@lhernanz
Copy link
Author

lhernanz commented Dec 28, 2024 via email

@armindarvish
Copy link
Owner

If you prefer, we can look for all the expected paths and only remove
these, but I do not see any scenario where having a path in the hostname
would produce any positive outcome when interacting with gh accounts.

I do actually prefer that. As you said, this is only for converting host name from forge names to what gh uses, and therefore we should specifically remove what forge adds rather than using a general pattern becaue I think this would be much easier to maintain over time.

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