Skip to content

Add GitHub Enterprise support#3720

Open
arhowe00 wants to merge 10 commits into
Kitware:masterfrom
arhowe00:add-ghe-support
Open

Add GitHub Enterprise support#3720
arhowe00 wants to merge 10 commits into
Kitware:masterfrom
arhowe00:add-ghe-support

Conversation

@arhowe00

@arhowe00 arhowe00 commented May 13, 2026

Copy link
Copy Markdown

Add support for GitHub Enterprise Server (GHE) so CDash can post check runs and commit statuses to self-hosted GHE instances

  • GITHUB_ENTERPRISE_URL, when set, will have CDash target that instance for GitHub API interactions

Comment thread app/cdash/app/Lib/Repository/GitHub.php Outdated
Comment thread app/cdash/app/Lib/Repository/GitHub.php Outdated
Comment thread app/cdash/app/Model/Repository.php Outdated
Comment thread app/Http/Submission/Handlers/DoneHandler.php Outdated
Comment thread app/Utils/RepositoryUtils.php Outdated
Comment thread app/Utils/RepositoryUtils.php Outdated
Comment thread app/Utils/RepositoryUtils.php Outdated
@williamjallen williamjallen changed the title Add ghe support Add GitHub Enterprise support Jun 2, 2026
@williamjallen

Copy link
Copy Markdown
Collaborator

@arhowe00 Note that CDash squashes commits, so your PR description will be included in the git history permanently. Please leave any questions/comments as comments on GitHub and treat the PR description as the commit message.

@williamjallen williamjallen modified the milestones: v5.1, v5.2 Jun 4, 2026
arhowe00 added 7 commits June 16, 2026 23:15
Enable CDash to post check runs and commit statuses to ghe installations
in addition to github.com.

Changes:
- Add GITHUB_ENTERPRISE_URL config option (env var)
- Pass enterprise URL to GitHubClient constructor with apiVersion=null
  (so it defaults to 'v3') so the PathPrepend plugin builds correct
  /api/v3/ paths for ghe
- Add isGitHubUrl() helpers in GitHub.php and RepositoryUtils.php to
  match repository URLs against both github.com and the configured GHE
  host
- Convert get_github_api_url() to construct /api/v3/repos/ paths for GHE
  repositories
- Make DoneHandler always create/update the check when a revision exists,
  rather than requiring the pendingSubmissions recheck flag
Centralizes config('cdash.github_enterprise_url') access into a single
RepositoryUtils::getEnterpriseUrl() method that returns null for both
null and empty string values, preventing empty strings from being
passed to the GitHub API client constructor.
Keep the single copy in RepositoryUtils (now public) and call it from
the GitHub class constructor.
- Simplify get_github_api_url with if/else and Str::replaceFirst
@williamjallen

Copy link
Copy Markdown
Collaborator

@arhowe00 Please see the failing formatter checks. You can run vendor/bin/php-cs-fixer fix --allow-risky=yes to reformat automatically.

@williamjallen

Copy link
Copy Markdown
Collaborator

@arhowe00 Please see the failing PHPStan check. You fixed an ignored warning, so you need to remove it from the baseline. You can run the following and commit the result to resolve the issue. Note that the /Browser/Pages/SitesIdPageTest failure appears to be a flaky test which can be safely ignored.

PHPSTAN_CPU=10 vendor/bin/phpstan analyse --memory-limit=8G -b

@williamjallen

Copy link
Copy Markdown
Collaborator

@arhowe00 It looks like you're using a version of PHP other than 8.3, which is what the PHPStan baseline is generated with. Only the get_github_api_url error here should be changed. I'd be happy to push a commit with the changes if needed.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants