Skip to content

fix(sdk): skip PR context for GitHub Enterprise instead of reporting it as github.com (#236) - #239

Merged
xping-admin merged 2 commits into
mainfrom
fix/236-github-enterprise-pr-context
Oct 5, 2026
Merged

xping-admin merged 2 commits into
mainfrom
fix/236-github-enterprise-pr-context

Conversation

@xping-admin

@xping-admin xping-admin commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #236. Follow-up: #240 (CI.Repository has no host).

Summary

  • GitHubPullRequestDetector requires GITHUB_SERVER_URL to have host github.com (parsed with Uri, case-insensitive, so a trailing / is fine and lookalikes like github.com.example.org are rejected). GitHub Enterprise Server and GHE.com (*.ghe.com) runs get no PR context but stay flagged by CI.IsPullRequest. PullRequestEventNames is unchanged.
  • A missing GITHUB_SERVER_URL is logged as a warning (a container given only some GITHUB_* variables), matching the missing-payload case. A malformed value gets its own debug message.
  • Azure Pipelines: provider GitHub now also requires BUILD_REPOSITORY_URI on github.com; GitHubEnterprise was already rejected and is now pinned by a test.
  • Docs: configuration-reference.md and ci-cd-setup.md say only github.com gets PR context, list GITHUB_SERVER_URL in the container guidance, and fix a paragraph that rendered as a setext heading.

Tests

  • GitHubPullRequestDetectorTests: github.com variants → context; GHES, *.ghe.com, lookalike, non-URL, unset, empty and whitespace → null; unset/empty/whitespace log a warning, a set non-github.com value doesn't.
  • AzureDevOpsPullRequestDetectorTests: GitHubEnterprise provider → null; BUILD_REPOSITORY_URI on github.com → context, GHES / GHE.com / lookalike / non-URL / unset → null.
  • All new rejection and warning tests fail against the detectors on main.
  • dotnet build -c Release clean, Xping.Sdk.Core.Tests 1178/1178 pass, dotnet format --verify-no-changes clean.

🤖 Generated with Claude Code

…it as github.com (#236)

GitHubPullRequestDetector now requires GITHUB_SERVER_URL to point at
github.com. GitHub Enterprise Server and GHE.com runs get no PR context,
since the context names no host and Xping Cloud would file their
repositories under github.com. They are still flagged by CI.IsPullRequest.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
...equest/Internals/AzureDevOpsPullRequestDetector.cs 100.00% <100.00%> (ø)
...PullRequest/Internals/GitHubPullRequestDetector.cs 99.03% <100.00%> (+0.22%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…b.com repos on Azure Pipelines (#236)

- A missing GITHUB_SERVER_URL is logged as a warning, since it means a
  container got only some GITHUB_* variables. A malformed value gets its
  own debug message instead of blaming Enterprise.
- Azure Pipelines PR builds with provider GitHub require
  BUILD_REPOSITORY_URI on github.com.
- Fix the ci-cd-setup paragraph that rendered as a heading, and list
  GITHUB_SERVER_URL in the container guidance.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@xping-admin
xping-admin merged commit 41d37d7 into main Oct 5, 2026
2 checks passed
@xping-admin
xping-admin deleted the fix/236-github-enterprise-pr-context branch October 5, 2026 15:36
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.

GitHub PR context from GitHub Enterprise Server is reported as github.com

1 participant