I was excited by the new package collection feature that was added with Xcode 13. My team maintains a good amount internal frameworks hosted on a GitHub Enterprise instance, but these can be hard to discover for others. Seems to me a perfect match for the use of a package collection
So I decided to give the package-collection-generator a try, but quickly encountered some snags - the generator so far seems to be purely intended for use with repos located on GitHub.com. I'm not aware of all the differences between on-prem GitHub and GitHub Enterprise, but from what I can see it comes down to this:
- the API URL is
- auth via personal access tokens seems to be done with basic auth (base64 encoded user:token) vs. "Authorization: token "
The actual API responses seem to be the same. I've gone ahead and added barebones support on my fork here, but it's very limited as it relies on the a new token type,
githubEnterprise to infer if a host is GitHub Enterprise or not. If that's not passed as an argument then it will default to the GitHub.com api format, and fail.
At this point I have something that works for my team, but if this were to be officially supported I think more significant changes have to be made - too much for me to feel could be done without seeing what the maintainers and the community think. For proper support we might want some extra configuration flag/enum in the input json to specify where a repo is hosted so the code can determine what API format to use. This could be used in the future to add support for other cloud git providers like BitBucket. That however, would be some effort with shuffling code around (I've got some ideas here, though).
So, my questions would be as follows:
- Is GitHub Enterprise support for the generator something folks would be interested in, and is it a direction it as a tool should go in?
- The code is already set up with extensibility in mind, perhaps this is already planned?