Skip to content

Added Github Enterprise Support #14324

Closed
ArnaavSinghSandhu wants to merge 10000 commits intoDefectDojo:devfrom
ArnaavSinghSandhu:clean-ghe-support
Closed

Added Github Enterprise Support #14324
ArnaavSinghSandhu wants to merge 10000 commits intoDefectDojo:devfrom
ArnaavSinghSandhu:clean-ghe-support

Conversation

@ArnaavSinghSandhu
Copy link
Copy Markdown

This PR adds support for GitHub Enterprise (GHE) by allowing a custom API base URL in the GitHub configuration.

Previously, the integration was hardcoded to use api.github.com, which made it impossible for users on self-hosted Enterprise instances to sync findings. I've added a base_url field to the GITHUB_Conf model and updated the API logic to use it if provided.

Changes:

Model: Added base_url to GITHUB_Conf.

Logic: Patched dojo/github.py to pass the base_url variable to the Github client.

UI: Updated dojo/forms.py to include the field in the settings UI.

Database: Included migration 0260_github_conf_base_url.py and updated max_migration.txt.

Test results
Tested via unittests/test_github_issue_sync.py:

GHE Test: Verified that passing a custom URL (e.g., https://ghe.example.com/api/v3) is correctly handled by the client initialization.

Backward Compatibility: Verified that leaving the field blank defaults to the standard GitHub public API without errors.

Manual Check: Verified the field saves correctly in the database via the Django shell and admin panel.
Output:-
WhatsApp Image 2026-02-15 at 12 23 12

Checklist
[x] Submitted against dev.

[x] Meaningful PR name: Add GitHub Enterprise support via custom API base_url

[x] Python 3.13 compliant.

[x] Included migrations in dojo/db_migrations.

[x] Added unit tests.

[x] Labels: enhancement, New Migration

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-detected New Migration Adding a new migration file. Take care when merging. ui unittests

Projects

None yet

Development

Successfully merging this pull request may close these issues.