Skip to content

Remove hackney dependency#147

Open
ericmj wants to merge 4 commits into
mainfrom
remove-hackney
Open

Remove hackney dependency#147
ericmj wants to merge 4 commits into
mainfrom
remove-hackney

Conversation

@ericmj
Copy link
Copy Markdown
Member

@ericmj ericmj commented May 29, 2026

Replace the remaining :hackney calls in Preview.CDN.Fastly with Finch, explicitly configure ex_aws (Req) and Sentry (Finch) so the optional adapters never resolve to hackney, then drop hackney from mix.exs.

  • Preview.CDN.Fastly now uses Preview.HTTP.post/4 (a new method on the existing Finch wrapper) instead of :hackney.post/4 + :hackney.body/1. Headers converted from atom-keyed keyword list to binary tuples (Finch is strict).
  • config :ex_aws, http_client: ExAws.Request.Req — added {:req, "~> 0.5"} as a direct dep.
  • config :sentry, client: Preview.SentryClient — new module implementing Sentry.HTTPClient with its own Finch pool (same pattern as hexdocs).
  • Removed {:hackney, "~> 1.20"} and {:mint, "~> 1.1"} from mix.exs (Mint stays as a Finch transitive).
  • Added {:bypass, "~> 2.1", only: :test} plus a smoke test for Preview.HTTP.post.

ericmj added 4 commits May 29, 2026 11:09
Add Preview.HTTP.post/4, rewrite Fastly.post/2 to use it with
binary-keyed headers, rename read_body/1 to decode_body/1 (no longer
needs to call :hackney.body/1), and add error clause to handle retries
exhausted. Add bypass dep and a Bypass test for HTTP.post/4.
@ericmj ericmj marked this pull request as ready for review May 29, 2026 19:34
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