Skip to content

Fix ReportingEndpoints URL validation causing CI test failure#1

Merged
MPCoreDeveloper merged 2 commits into
masterfrom
copilot/fix-failing-github-actions-job
Jul 25, 2026
Merged

Fix ReportingEndpoints URL validation causing CI test failure#1
MPCoreDeveloper merged 2 commits into
masterfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Description

The Build, test, and pack workflow failed because StartWithRelativeReportingEndpointUrlThrowsOptionsValidationException did not throw during options validation. This change tightens ReportingEndpoints URL validation to enforce absolute HTTP(S) URLs and adds focused regression coverage for non-HTTP schemes.

  • Root cause

    • ValidateReportingEndpoints accepted URIs that should be rejected by policy intent, so invalid endpoint values bypassed startup validation.
  • Validation logic update

    • Require successful absolute URI parsing.
    • Require http or https scheme for each ReportingEndpointOptions.Url.
    • Keep existing failure message contract unchanged.
  • Regression coverage

    • Added NonHttpSchemeReportingEndpointUrlThrowsOptionsValidationException to assert file:///... is rejected.
else if (!Uri.TryCreate(endpoint.Url, UriKind.Absolute, out var uri))
{
    failures.Add($"{scope}: Reporting endpoint '{endpoint.Group}' URL must be absolute. Fix: use a full URL such as 'https://reports.example.com/csp'.");
}
else if (uri.Scheme != Uri.UriSchemeHttp && uri.Scheme != Uri.UriSchemeHttps)
{
    failures.Add($"{scope}: Reporting endpoint '{endpoint.Group}' URL must be absolute. Fix: use a full URL such as 'https://reports.example.com/csp'.");
}

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • Code follows project coding standards
  • Tests added/updated for changes
  • All tests pass (dotnet test)
  • XML documentation added for public APIs
  • CHANGELOG.md updated

Copilot AI changed the title [WIP] Fix failing GitHub Actions job "Build, test, and pack" Fix ReportingEndpoints URL validation causing CI test failure Jul 25, 2026
Copilot AI requested a review from MPCoreDeveloper July 25, 2026 19:15
@MPCoreDeveloper
MPCoreDeveloper marked this pull request as ready for review July 25, 2026 19:27
@MPCoreDeveloper
MPCoreDeveloper merged commit f9c7d9f into master Jul 25, 2026
1 check passed
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.

2 participants