Re-organized file layout#40
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request performs a significant reorganization of the project structure by moving source and test files into feature-aligned subdirectories such as auth, http, and observability. The Makefile and include paths across the codebase have been updated to reflect these changes. Feedback suggests improving the maintainability of the test runner by grouping and alphabetically sorting its include list to match the new directory organization.
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
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.
refactor: reorganize
server/andtest/into feature subfolders mirroringinclude/Summary
Flatten-to-subfolder refactor of the source and test trees to match
include/'s established subdirectory organization. No behavior change — purely a structural move of ~190 files (104 inserver/, 85 intest/) into 14 feature-aligned subfolders. All file moves done viagit mvto preservegit blame/loghistory.Motivation
include/has been organized into per-feature subfolders (auth/,circuit_breaker/,grpc/,http/,http2/,observability/,upstream/,ws/, etc.) since early in the project's life.server/andtest/remained flat — a single directory holding 100+ files each, making it hard to:include/auth/jwt_verifier.h→server/jwt_verifier.ccrequired a directory scan).This change makes the source/test layout match the header layout 1:1.
Changes
server/— 104 files reorganized into 14 subfoldersserver/auth/auth_*,jwks_*,jwt_verifier,oidc_discovery,introspection_*,issuer,token_hasher)server/circuit_breaker/circuit_breaker_*,retry_budget)server/cli/cli_parser,daemonizer,pid_file,signal_handler)server/config/config_loader)server/grpc/grpc_status,grpc_synthesis,grpc_timeout,grpc_web_bridge)server/http/http_*,body_stream,route_trie,http2_trailer_sanitizer)server/http2/http2_*,protocol_detector)server/log/logger)server/net/dns_resolver)server/observability/observability_*, exporters, propagators, span/tracer/meter/counter/...)server/rate_limit/rate_limit*,token_bucket)server/tls/tls_*)server/upstream/proxy_*,upstream_*,pool_partition,h2_connection_table,header_rewriter,retry_policy,http_request_serializer,grpc_web_inbound_body_stream)server/ws/websocket_*)server/(root)dispatcher,event_handler,epoll_handler,kqueue_handler,channel,connection_handler,acceptor,socket_handler,buffer,net_server,inet_addr,main)test/— 85 files reorganized by featuretest/auth/auth_*,jwks_*,jwt_verifier,header_rewriter_auth,introspection_*,oidc_discovery)test/circuit_breaker/circuit_breaker_*)test/cli/,test/config/,test/rate_limit/,test/tls/,test/ws/test/grpc/grpc_*,grpc_web_*)test/http/http_*,route_*,streaming_request,timeout)test/http2/http2_*,h2_trailer)test/net/dns_resolver,dual_stack)test/observability/observability_*)test/upstream/h2_upstream,proxy_*,upstream_pool)test/(root)test_framework.{h,cc},test_server_runner.h,mock_introspection_server.h,http_test_client.h,run_test.cc, plusbasic_test,stress_test,race_condition_test,kqueue_test,sharded_lru_cache_test(no clean feature home)Build / wiring updates
Makefile— every source-group variable (HTTP_SRCS,AUTH_SRCS,OBSERVABILITY_SRCS, etc.) updated to reference the new$(SERVER_DIR)/<subfolder>/<file>.ccpaths. Header variables (*_HEADERS) unchanged — they already pointed atinclude/<subfolder>/. Root-level files (reactor core +main.cc) keep bare paths.test/run_test.cc— every#include "foo_test.h"updated to#include "subfolder/foo_test.h"for moved tests. Includes for root-level shared headers unchanged (resolved via-ItestinCXXFLAGS).test/http/router_async_middleware_test.h:"http2_test.h"→"http2/http2_test.h"test/grpc/grpc_proxy_test.h,grpc_obs_test.h,grpc_web_edge_test.h:"h2_trailer_test.h"→"http2/h2_trailer_test.h"test/upstream/h2_upstream_test.h— code-inspection test that opensserver/proxy_transaction.ccby literal path: updated toserver/upstream/proxy_transaction.cc.test/observability/observability_link_kill_test.h— addedinlineto 7 test functions (pre-existing convention violation made newly visible by the move; per CODE_CONVENTIONS.md,void Test*()in headers must beinline).Not changed
include/layout (already organized).util/,thread_pool/,third_party/,docs/,config/(separate subprojects / out of scope)..github/workflows/(no path references — usesmake+./test_runner <suite>flags).#includefrom.cctoinclude/headers — those already used full paths (#include "http/http_server.h"), unaffected by the source-file move.Test plan
make clean && make -j4clean build, no warnings../test_runnerfull sweep: 1901/1901 passing.inlinefix:./test_runner obs_linkkill→ 100%.git statusconfirms every move shows as rename (R), not delete+add — history preserved.makeand suite flags, no path-specific references, so should be green by construction.Risk
Low. Purely structural — zero semantic change. The risk surface is:
server/foo.ccpaths will break. None known in this repo.