-
Notifications
You must be signed in to change notification settings - Fork 114
Update to hackney process-per-connection branch #208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
benoitc
wants to merge
31
commits into
master
Choose a base branch
from
feature/hackney-process-per-connection
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- use hackney feature/process-per-connection branch - change is_reference to is_pid (connection handles are now PIDs) - remove hackney:request_info call (not needed with process-per-connection)
af1bc16 to
870ee15
Compare
The oauth module is an optional runtime dependency for OAuth authentication support. Configure xref to ignore undefined function calls to oauth and limit xref checks to critical issues (undefined functions, deprecated calls) rather than unused exports which are expected for a library's public API.
- Replace jsx dependency with Erlang stdlib json:encode/1 and json:decode/1
- Switch from EJSON {[{K,V}]} format to native Erlang maps
- Add json_stream_parse.erl for streaming JSON parsing in views
- Update all modules to use maps:get/put/remove instead of proplists
- Update type definitions: ejson_object() is now map()
Breaking change: Documents are now maps instead of {[{K,V}]} tuples.
Minimum OTP version: 27
- Remove JSX decoder callbacks for longpoll mode - Use json_stream_parse for longpoll streaming (finds "results" array) - Use line-based parsing for continuous mode (newline-delimited JSON) - Update all EJSON patterns to use maps - Extend json_stream_parse to find both "rows" and "results" arrays
- couchbeam_changes: tests for parse_lines, follow_once, parse_options - couchbeam_ejson: tests for encode/decode with maps, lists, types, round-trip - couchbeam_uuids: tests for random and utc_random UUID generation
- Replace JSX decoder with json_stream_parse in couchbeam_view.erl - Remove JSX callback functions (init, handle_event, wait_rows, etc.) - Fix EJSON patterns in view_request to use maps - Fix record field types in couchbeam_changes.erl and couchbeam_view.erl
- Add couchbeam_integration_SUITE with 8 test cases covering: server info, db CRUD, doc CRUD, attachments, bulk docs, all_docs, views, and changes feed - Tests skip gracefully if CouchDB is not available - Configurable via COUCHDB_URL, COUCHDB_USER, COUCHDB_PASS env vars - Add GitHub Actions job using CouchDB 3.3 Docker service - Integration job uses continue-on-error to not block main CI
- Remove jsx from rebar.lock (no longer needed) - Add oauth to main deps for dialyzer PLT - Add dialyzer config with plt_extra_apps for mimerl, xmerl, oauth - Fix couchbeam_changes.erl: update follow/2,3 specs (always returns ok) - Fix couchbeam_httpc.erl: remove dead code patterns (mp_mixed, mp_mixed_eof)
- Update hackney ref to 5e461f6 with renamed hackney_headers - Disable multipart_test until hackney supports stream_multipart
The hackney process-per-connection branch removed hackney_headers:parse/2. Updated to use the new API: from_list + get_value + parse_content_type.
Replace calls to hackney:stream_multipart/1 (which is not available in the process-per-connection branch) with an implementation using hackney_multipart:parser/1 and hackney:stream_body/1. - Change wait_mp_doc/2 to wait_mp_doc/3 to accept boundary parameter - Use hackney_multipart:parser(Boundary) to create a multipart parser - Feed data from hackney:stream_body/1 to the parser - Translate continuation-based parser results to expected return format - Extract boundary from Content-Type params in couchbeam:open_doc/3
Add 9 test groups covering: Server operations: - server_info, server_uuids (get_uuid/get_uuids), all_dbs Database operations: - create_delete_db, open_or_create_db, db_info_detailed Document operations: - doc_crud (with revision history), doc_exists, doc_copy, doc_lookup_rev, doc_conflicts Bulk operations: - bulk_docs (20 docs), bulk_delete Attachment operations: - doc_with_attachment, multiple_attachments (3 files), large_attachment (1MB), attachment_streaming View operations: - all_docs, all_docs_options (startkey/endkey, limit, skip, descending), view_query, view_with_keys, view_pagination (3 pages), view_reduce (_count, _sum), view_count, view_first, view_fold Design document operations: - design_info, view_cleanup Changes feed: - changes_feed, changes_with_filter, changes_with_doc_ids, changes_include_docs Error handling: - error_not_found, error_conflict, error_invalid_doc Each test group now uses its own isolated database for better test isolation and parallel execution potential.
- Update hackney to latest process-per-connection branch with fixed specs - Remove -dialyzer nowarn attributes that are no longer needed - Update doc_stream() type to use pid() instead of hackney_client() - Update stream_attachment/1 spec to use pid() - Update client_ref field types in changes and view modules - Add spec for couchbeam_httpc:request/5
- Fix server_uuids test to match actual API return format (list, not {ok, list})
- Fix doc_copy test to expect {ok, DocId, Rev} 3-tuple instead of map
- Add stream_attachment/3 convenience function for starting attachment streams
The function was returning just the binary revision instead of
wrapping it in {ok, Rev}, causing test failures.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
feature/process-per-connectionbranchis_reference(Ref)tois_pid(Ref)incouchbeam_httpc.erl(connection handles are now PIDs)hackney:request_info/1call incouchbeam_view_stream.erl(not needed with process-per-connection model)Test plan