Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

GitHub API operations (especially file uploads) were logging full request/response bodies including binary streams, generating >15,000 lines of output per operation.

Changes

Configuration

  • Added PipelineOptions.DefaultHttpLogging (default: StatusCode | Duration)
  • Added GitHubOptions.HttpLogging for per-integration override
  • Reused existing HttpLoggingType flags: None, Request, Response, StatusCode, Duration

Implementation

  • Modified GitHub.cs to conditionally add HTTP handlers based on configured logging level
  • Handler chain now built dynamically instead of always including all handlers

Testing & Documentation

  • Added unit tests for configuration scenarios
  • Updated GitHub package docs with usage examples

Usage

// Default: only status codes and duration (no request/response bodies)
await PipelineHostBuilder.Create()
    .ExecutePipelineAsync();

// Disable HTTP logging entirely
await PipelineHostBuilder.Create()
    .ConfigureServices((_, services) =>
    {
        services.Configure<GitHubOptions>(opt => 
            opt.HttpLogging = HttpLoggingType.None);
    })
    .ExecutePipelineAsync();

// Enable verbose logging when debugging
services.Configure<GitHubOptions>(opt => 
    opt.HttpLogging = HttpLoggingType.Request | HttpLoggingType.Response);

Impact

  • Default behavior prevents log spam while retaining useful debugging info
  • Pattern consistent with existing CommandLogging configuration
  • No breaking changes
Original prompt

This section details on the original issue you should resolve

<issue_title>IHttpLogger spams messages</issue_title>
<issue_description>The ModularPipelines.GitHub.GitHub class has IHttpLogger, but it is overly aggressive. For example, for a call to

        return await targetFiles
            .SelectAsync(async file =>
                {
                    var asset = new ReleaseAssetUpload
                    {
                        ContentType = "application/x-binary",
                        FileName = file.Name,
                        RawData = file.GetStream()
                    };

                    return await context.GitHub().Client.Repository.Release.UploadAsset(release, asset, cancellationToken);
                },
                cancellationToken)
            .ProcessOneAtATime();

I get >15,000 lines in the output. The current implementation even logs the stream of the uploaded file.

Image Image

Ideally nice to have something like CommandLogging in Commands, to control it</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix IHttpLogger spamming excessive messages Add configurable HTTP logging to prevent verbose output from GitHub operations Nov 15, 2025
Copilot AI requested a review from thomhurst November 15, 2025 17:33
Copilot finished work on behalf of thomhurst November 15, 2025 17:33
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.

IHttpLogger spams messages

2 participants