Skip to content

chore: remove HTTPClientFactory, multipart helpers, and related tests from network package - #7023

Draft
sammaji wants to merge 1 commit into
devfrom
09-09-fix_remove_dead_code_from_networking_package
Draft

chore: remove HTTPClientFactory, multipart helpers, and related tests from network package#7023
sammaji wants to merge 1 commit into
devfrom
09-09-fix_remove_dead_code_from_networking_package

Conversation

@sammaji

@sammaji sammaji commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Removes the HTTPClientFactory abstraction and all associated proxy-aware client management logic from core/network, along with the multipart.go utilities and their tests. This cleans up code that is no longer needed, reducing complexity in the network package.

Changes

  • Removed HTTPClientFactory, including its constructor, FactoryOption pattern, GetFasthttpClient, GetHTTPClient, createFasthttpClient, createHTTPClient, configureFasthttpProxy, configureHTTPProxy, buildProxyURLWithAuth, UpdateProxyConfig, GetProxyConfig, and isProxyEnabledForPurpose methods
  • Removed ClientPurpose type and its constants (ClientPurposeSCIM, ClientPurposeInference, ClientPurposeAPI)
  • Removed multipart.go entirely, which contained ParseMultipartFormFields, ReconstructMultipartBody, WriteMultipartField, and SerializePayloadToRequest
  • Removed all corresponding tests for the above, including the fasthttp client pool settings test and all multipart tests
  • Retained shouldBypassProxy, dialAddrHost, StaleConnectionRetryIfErr, GlobalProxyConfig, and DefaultClientConfig, which remain in use

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go version
go test ./...

Verify that no remaining code references HTTPClientFactory, ClientPurpose, or the removed multipart helpers, and that all existing tests pass.

Screenshots/Recordings

N/A

Breaking changes

  • Yes
  • No

Any callers of HTTPClientFactory, GetFasthttpClient, GetHTTPClient, ParseMultipartFormFields, ReconstructMultipartBody, WriteMultipartField, or SerializePayloadToRequest must be updated to use alternative implementations, as these are no longer available in the network package.

Related issues

N/A

Security considerations

The removed proxy configuration logic included TLS skip-verify handling and proxy authentication. Ensure that any replacement implementations preserve the same TLS and authentication safeguards.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

sammaji commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sammaji sammaji changed the title fix: remove dead code from networking package chore: remove HTTPClientFactory, multipart helpers, and related tests from network package Sep 9, 2026
@sammaji
sammaji force-pushed the 09-09-fix_remove_dead_code_from_networking_package branch 2 times, most recently from e24308d to a9994a9 Compare September 9, 2026 10:05
@sammaji
sammaji force-pushed the 09-09-fix_remove_dead_code_from_networking_package branch from a9994a9 to 5b99705 Compare September 9, 2026 10:08
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.

1 participant