Skip to content

container hierarchy is refactored#171

Merged
ashtum merged 1 commit intocppalliance:developfrom
ashtum:container-hierarchy-is-refactored
Oct 7, 2025
Merged

container hierarchy is refactored#171
ashtum merged 1 commit intocppalliance:developfrom
ashtum:container-hierarchy-is-refactored

Conversation

@ashtum
Copy link
Copy Markdown
Collaborator

@ashtum ashtum commented Oct 3, 2025

No description provided.

@vinniefalco vinniefalco requested a review from Copilot October 3, 2025 18:41
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the container hierarchy in the HTTP protocol library by consolidating view-based and base classes, simplifying template parameters, and removing outdated container classes.

  • Removes separate view classes (fields_view_base, message_view_base, request_view, response_view) and consolidates functionality into base classes
  • Changes static containers (static_request, static_response) from template classes to regular classes that accept external storage
  • Updates the parser to return static container references instead of view objects

Reviewed Changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/unit/test_helpers.hpp Updates function parameter from fields_view_base to fields_base
test/unit/static_response.cpp Simplifies tests for new non-template static_response API
test/unit/static_request.cpp Simplifies tests for new non-template static_request API
test/unit/request_parser.cpp Updates to use static_request reference instead of request_view
test/unit/response.cpp Removes response_view usage and adds response_base constructor test
test/unit/request.cpp Removes request_view usage and adds request_base constructor test
test/unit/fields_base.cpp Consolidates iterator and observer functionality from removed view classes
src/serializer.cpp Updates to use message_base instead of message_view_base
src/parser.cpp Changes to return static_request/static_response references instead of views
include/boost/http_proto/static_response.hpp Removes template parameter and updates to use external storage constructor
include/boost/http_proto/static_request.hpp Removes template parameter and updates to use external storage constructor
include/boost/http_proto/fields_base.hpp Consolidates functionality from removed view classes
Multiple removed files Removes obsolete view classes and static fields template

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/fields_base.cpp
fields_base(
detail::kind k,
char* storage,
void* storage,
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter type changed from char* to void* but the implementation still casts to char*. Consider keeping char* type for clarity since the storage is specifically for character data, or add documentation explaining the void* to char* cast.

Suggested change
void* storage,
char* storage,

Copilot uses AI. Check for mistakes.
Comment thread src/parser.cpp Outdated
Comment on lines +612 to +613
// TODO use union
return reinterpret_cast<static_response const&>(m_);
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using reinterpret_cast to convert between static_request and static_response is unsafe and relies on implementation details. The TODO comment indicates this should use a union instead for type safety.

Copilot uses AI. Check for mistakes.
@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented Oct 3, 2025

An automated preview of the documentation is available at https://171.http-proto.prtest.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2025-10-07 10:27:17 UTC

@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from dfe3e83 to 4c6d7e0 Compare October 3, 2025 19:32
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from 4c6d7e0 to 9ee7f6d Compare October 3, 2025 19:48
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from 9ee7f6d to 59f8aa1 Compare October 3, 2025 20:06
@cppalliance-bot
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 3, 2025

Codecov Report

❌ Patch coverage is 97.87234% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.48%. Comparing base (0e85b91) to head (2425c60).
⚠️ Report is 2 commits behind head on develop.

Files with missing lines Patch % Lines
src/fields_base.cpp 96.90% 6 Missing ⚠️
src/message_base.cpp 87.50% 1 Missing ⚠️
src/parser.cpp 97.43% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #171      +/-   ##
===========================================
- Coverage    92.53%   92.48%   -0.06%     
===========================================
  Files           81       71      -10     
  Lines         5061     4854     -207     
===========================================
- Hits          4683     4489     -194     
+ Misses         378      365      -13     
Files with missing lines Coverage Δ
include/boost/http_proto/fields.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/fields_base.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/impl/fields_base.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/impl/serializer.hpp 100.00% <ø> (ø)
include/boost/http_proto/message_base.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/request.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/request_base.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/request_parser.hpp 100.00% <ø> (ø)
include/boost/http_proto/response.hpp 100.00% <100.00%> (ø)
include/boost/http_proto/response_base.hpp 100.00% <100.00%> (ø)
... and 12 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e85b91...2425c60. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from 59f8aa1 to 78d0fef Compare October 4, 2025 17:05
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from 78d0fef to 866a68b Compare October 5, 2025 12:02
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from 866a68b to b927d33 Compare October 7, 2025 08:12
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum force-pushed the container-hierarchy-is-refactored branch from b927d33 to 2425c60 Compare October 7, 2025 10:23
@cppalliance-bot
Copy link
Copy Markdown

@ashtum ashtum merged commit 1a8a81c into cppalliance:develop Oct 7, 2025
61 checks passed
@ashtum ashtum deleted the container-hierarchy-is-refactored branch October 7, 2025 11:05
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.

3 participants