Skip to content

Conversation

@cbjuan
Copy link
Contributor

@cbjuan cbjuan commented Jun 27, 2025

Summary

  • Add support for GitHub Enterprise server URLs (e.g., github.company.com)
  • Enable private repository access with tokens on GitHub Enterprise instances
  • Maintain full backward compatibility with existing github.com functionality (no existing tests changed)

Fixes #333

Changes Made

  • Host Detection: Updated _looks_like_git_host() to recognize github.* domains as valid Git hosts
  • Authentication: Added _is_github_host() helper to identify GitHub hosts (including Enterprise)
  • Token Support: Enhanced token authentication to work with GitHub Enterprise API endpoints
  • URL Parsing: Updated regex patterns and API endpoint generation for Enterprise servers
  • Added new tests for GHE compatibility

Technical Details

  • Modified src/gitingest/utils/query_parser_utils.py to include github. prefix detection
  • Enhanced src/gitingest/utils/git_utils.py with Enterprise-aware authentication logic
  • Updated src/gitingest/cloning.py to use new GitHub host detection
  • Added proper API endpoint handling for github.company.com/api/v3/ vs api.github.com

Test Coverage

  • Verified URL parsing for various GitHub Enterprise patterns
  • Tested authentication header generation for Enterprise domains
  • Confirmed backward compatibility with existing github.com repositories

Usage Example

from gitingest import ingest

# Now works with GitHub Enterprise
summary, tree, content = ingest(
    "https://github.company.com/org/repo",
    token="github_pat_..."
)

Confirmed manually this works (through CLI, service and Python interface) with a GitHub Enterprise instance that follows the link structure github.<company>.xxxx

All tests (including new ones) passing

Screenshot 2025-06-27 at 17 16 30

Copy link
Member

@cyclotruc cyclotruc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cbjuan Thank you for this clean work, merging!

@cyclotruc cyclotruc merged commit af95bae into coderamp-labs:main Jun 28, 2025
18 checks passed
filipchristiansen pushed a commit that referenced this pull request Jun 28, 2025
…ompanies that use github.<company>.xxx type of links (#334)

* Improve checks for github.com links & adding compatibility with GHE companies that use github.<company>.xxx type of links
@shuknk8s
Copy link

shuknk8s commented Jul 8, 2025

has this PR been merged into the release branch yet , I just tested with a custom github domain but it encountered the same error(unknown domain 'github..com' in URL, Aborted) while using the gitingest cli installed using pip. Do I need to download a specific version for this fix to work?

@cyclotruc
Copy link
Member

@shuknk8s Hi, this has not been deployed yet to gitingest.com but should be in the next 24 to 48 hours!
If you want to try this feature early, you could to clone the repo, build the CLI by running pip install . and then use the installed package (maybe uninstall the "official" version before to avoid conflicts or use a venv)

Thanks for your patience

@shuknk8s
Copy link

shuknk8s commented Jul 8, 2025

kindly notify me when this fix is available, many thanks in advance

  • Shu

@shuknk8s
Copy link

@shuknk8s Hi, this has not been deployed yet to gitingest.com but should be in the next 24 to 48 hours!
If you want to try this feature early, you could to clone the repo, build the CLI by running pip install . and then use the installed package (maybe uninstall the "official" version before to avoid conflicts or use a venv)

Thanks for your patience

Hi , Could you please confirm whether or not the change has been deployed and available through pip install , sorry if I am following up to early.

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

Successfully merging this pull request may close these issues.

Feature Request: Add Support for GitHub Enterprise Server Instances

3 participants