Skip to content

[BREAKING] HTTP.jl 2.0 package overhaul#1248

Open
quinnj wants to merge 29 commits intomasterfrom
codex/http-2.0-extraction
Open

[BREAKING] HTTP.jl 2.0 package overhaul#1248
quinnj wants to merge 29 commits intomasterfrom
codex/http-2.0-extraction

Conversation

@quinnj
Copy link
Member

@quinnj quinnj commented Mar 15, 2026

Summary

  • reset the master package tree to a clean 2.0 extraction baseline and port over the HTTP implementation from Reseau
  • move the full HTTP-owned test suite, fixtures, and trim-compile coverage into HTTP.jl
  • rewrite the docs as a conventional Documenter site with client/server/protocol guides, API reference, and a 1.x migration guide
  • update CI/docs to exercise the extracted package against the sibling Reseau split branch

Testing

  • JULIA_NUM_THREADS=1 julia --project=. --startup-file=no --history-file=no -e 'using Pkg; Pkg.develop(path="/Users/jacob.quinn/.julia/dev/Reseau-split-worktree"); Pkg.instantiate(); Pkg.test(; coverage=true)'
  • julia --project=docs --startup-file=no --history-file=no docs/make.jl

Coverage

  • HTTP/src: 6346/7630 covered lines (83.17%)

Migration and Breaking Changes

  • HTTP 2.0 is now the extracted Reseau-backed package line and requires the companion transport split from Split HTTP out of Reseau JuliaServices/Reseau.jl#78
  • the docs include a full 1.x migration guide covering the new transport boundary, response/body semantics, retry and proxy surfaces, and lower-level server/client changes

Notes

  • CI currently Pkg.develops JuliaServices/Reseau.jl at codex/reseau-http-split so this PR stays green before the sibling Reseau PR merges.

@quinnj quinnj changed the title Extract HTTP 2.0 from Reseau [BREAKING] HTTP.jl 2.0 package overhaul Mar 16, 2026
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 88.11141% with 525 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.29%. Comparing base (efd74ea) to head (92d9df7).
⚠️ Report is 39 commits behind head on master.

Files with missing lines Patch % Lines
src/http_client.jl 84.30% 108 Missing ⚠️
src/http_core.jl 84.05% 74 Missing ⚠️
src/http2_client.jl 92.08% 57 Missing ⚠️
src/hpack.jl 86.21% 51 Missing ⚠️
src/http1.jl 91.60% 47 Missing ⚠️
src/http_forms.jl 76.41% 46 Missing ⚠️
src/http_client_redirect.jl 77.64% 38 Missing ⚠️
src/http_client_verbose.jl 86.41% 33 Missing ⚠️
src/http_cookies.jl 92.99% 26 Missing ⚠️
src/http_client_url.jl 89.62% 22 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1248      +/-   ##
==========================================
+ Coverage   82.78%   87.29%   +4.51%     
==========================================
  Files          32       24       -8     
  Lines        3079     8864    +5785     
==========================================
+ Hits         2549     7738    +5189     
- Misses        530     1126     +596     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@quinnj quinnj force-pushed the codex/http-2.0-extraction branch from 2206cea to e6b20cc Compare March 21, 2026 16:49
quinnj added 16 commits March 21, 2026 11:32
Add decoder limits for HPACK string length, header list size,
and allowed table-size updates.

Cap accumulated HTTP/2 header-block bytes on client and server
paths, deriving server-side decode limits from max_header_bytes and
adding targeted regressions for HPACK and both H2 directions.
Require the initial peer SETTINGS frame, propagate advertised
header table and header list limits into encoder behavior, and
reject unsupported server push explicitly.

Teach the high-level client to maintain multiple reusable H2
connections per origin, respect MAX_CONCURRENT_STREAMS, and mark
streams above GOAWAY last_stream_id with a targeted error instead
of failing the whole connection generically. On the server side,
process duplicate peer settings in order and apply outbound
encoder constraints from client SETTINGS.
Allow legal request trailers on the server, preserve response
trailers on the client, and reject trailer pseudo-headers on
both sides.

Keep trailer state per stream so response trailers are only
published after body EOF, while request trailers become visible
to handlers once the request body is fully consumed.
Fail illegal stream-id and connection-only frame placements in
the HTTP/2 framer on both read and write paths instead of
leaving them to higher-level state machines.

Add explicit frame-level regressions for malformed DATA, HEADERS,
PRIORITY, RST_STREAM, SETTINGS, PUSH_PROMISE, PING, GOAWAY, and
CONTINUATION combinations.
@quinnj quinnj force-pushed the codex/http-2.0-extraction branch from e6b20cc to 45f44bc Compare March 22, 2026 04:06
quinnj added 10 commits March 23, 2026 08:55
Add URIs.jl parity for the high-level client API by accepting
URI inputs across request/open helpers and constructing _URLParts
directly from URI components.

Also replace raw Threads.Atomic request-write flags with a
private _RequestWriteState helper using @atomic fields so the
transport keeps the same coordination behavior without the banned
Atomic wrapper type.
Implement multi-level verbose client logging with compact lifecycle
output at level 1 plus detailed dumps at levels 2 and 3.

- capture exact HTTP/1 request and response wire bytes via teeing and
  _ConnReader hooks
- emit best-effort HTTP/2 request and response message dumps
- suppress compressed and other non-text bodies in verbose output
- cover summaries, H1 wire capture, compressed-body suppression, and
  H2 dumps with regression tests
Introduce a typed request-scoped timeout config shared by request,
HTTP.open, and websocket handshakes.

Keep readtimeout as a deprecated alias that seeds the new timeout
settings while preserving the existing request/header timeout
behavior until deeper transport enforcement lands.

Verification:
- julia --project=. -e 'using Test; using HTTP; using Reseau; _http_windows_ci() = false; include("test/http_client_tests.jl")'
- julia --project=. test/http_websocket_client_tests.jl
Apply connect timeouts per request across HTTP/1, HTTP/2, and
websocket handshakes, including explicit-client calls.

Bound response header waits in the H1 transport, H2 stream header
wait path, and websocket handshake path.

Verification:
- julia --project=. -e 'using Test; using HTTP; using Reseau; _http_windows_ci() = false; include("test/http_client_tests.jl")'
- julia --project=. test/http_client_transport_tests.jl
- julia --project=. test/http_websocket_client_tests.jl
- julia --project=. test/http2_client_tests.jl
Make readtimeout a true deprecated alias for read inactivity and
separate it cleanly from overall request_timeout semantics.

Refresh H1 socket deadlines on body reads and request writes, and
bound H2 stream waits plus flow-control stalls with read/write
idle deadlines.

Verification:
- julia --project=. -e 'using Test; using HTTP; using Reseau; _http_windows_ci() = false; include("test/http_client_tests.jl")'
- julia --project=. test/http_client_transport_tests.jl
- julia --project=. test/http_websocket_client_tests.jl
- julia --project=. test/http2_client_tests.jl
Update the high-level request docstring so connect_timeout matches
the implemented behavior across DNS, TCP, proxy CONNECT, TLS,
and HTTP/2 setup.

Verification:
- julia --project=. test/runtests.jl
Refresh the client, server, protocol, and migration docs so they
match the new timeout model and deprecation story.

Call out the richer 2.0 timeout surface compared with HTTP.jl 1.x
and the old master-era readtimeout/connect_timeout workflow.

Verification:
- julia --project=docs docs/make.jl
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