Skip to content

refactor: merge samples/ into examples/ canonical directory#1094

Merged
kcenon merged 1 commit into
developfrom
refactor/issue-1091-merge-samples-into-examples
May 1, 2026
Merged

refactor: merge samples/ into examples/ canonical directory#1094
kcenon merged 1 commit into
developfrom
refactor/issue-1091-merge-samples-into-examples

Conversation

@kcenon

@kcenon kcenon commented May 1, 2026

Copy link
Copy Markdown
Owner

Closes #1091

Summary

Consolidate the two parallel example trees (samples/ + examples/) into a single canonical examples/ directory, matching the ecosystem convention from Master EPIC kcenon/common_system#657 (pacs_system precedent).

Two parallel example trees confused newcomers ("which one is current?") and doubled maintenance cost when an API changed.

Merge map

samples/ file Action examples/ destination
basic_usage.cpp move examples/basic_usage.cpp
concepts_example.cpp move examples/concepts_example.cpp
http2_server_example.cpp move examples/http2_server_example.cpp
memory_profile_demo.cpp move examples/memory_profile_demo.cpp
quic_client_example.cpp move examples/quic_client_example.cpp (low-level QUIC API; complements quic_facade_example)
quic_server_example.cpp move examples/quic_server_example.cpp
simple_http_client.cpp move examples/simple_http_client.cpp (lower-level than http_facade_example)
simple_http_server.cpp move examples/simple_http_server.cpp
messaging_system_integration/ move examples/messaging_system_integration/
migration/ move examples/migration/
connection_pool_example.cpp drop examples/connection_pool.cpp uses the modern facade API
grpc_service_example.cpp drop examples/grpc_service_example.cpp is the facade-API version
http_client_demo.cpp drop uses deprecated API (per samples/CMakeLists.txt comment)
tcp_server_client.cpp drop uses deprecated API (per samples/CMakeLists.txt); examples/tcp_client.cpp + examples/tcp_echo_server.cpp split is better
udp_echo_demo.cpp drop examples/udp_echo.cpp uses udp_facade
run_all_samples.cpp drop depends on dropped samples; no longer meaningful
CMakeLists.txt drop examples/CMakeLists.txt extended instead
Makefile drop obsolete
README.md, README_KO.md drop examples/README.md rewritten as superset

After the merge, samples/ is removed and examples/ contains 22 .cpp files plus the two integration subdirectories.

Build flag consolidation

  • BUILD_SAMPLES removed from root CMakeLists.txt, CMakePresets.json, scripts, CI workflows, install scripts, and docs.
  • BUILD_EXAMPLES is now the single switch with default ON (samples were ON by default; examples is the merged superset).
  • All 11 CI workflows, install/build/release/migration shell scripts, and the Windows PowerShell install script switched from -DBUILD_SAMPLES=* to -DBUILD_EXAMPLES=* (CI explicitly sets OFF since the new default would otherwise pull examples in).
  • examples/CMakeLists.txt now registers the migrated targets and the OpenSSL / network-quic link rules previously living in samples/CMakeLists.txt (HTTP/2, QUIC examples).

Documentation

Updated to reference examples/ instead of samples/ and BUILD_EXAMPLES instead of BUILD_SAMPLES:

  • README.md (Feature Matrix, CMake Options table, Examples section)
  • docs/PROJECT_STRUCTURE.md, docs/PROJECT_STRUCTURE.kr.md
  • docs/ARCHITECTURE_OVERVIEW.md
  • docs/FEATURES.md
  • docs/README.kr.md, docs/advanced/MIGRATION.md
  • docs/guides/BUILD.md, docs/guides/BUILD.kr.md
  • examples/README.md rewritten to cover the merged superset

CHANGELOG entries are historical record and intentionally not rewritten.

Test Plan

  • cmake -DBUILD_EXAMPLES=ON configures and builds; new examples (basic_usage, concepts_example, http2_server_example, memory_profile_demo, quic_example, simple_http) all compile through their dedicated targets.
  • HTTP/2 and QUIC examples receive the OpenSSL / network-quic link dependency previously in samples/CMakeLists.txt.
  • All README internal links resolve.
  • CI workflows continue to build network_system without examples (BUILD_EXAMPLES=OFF).

Verification

grep -rn 'BUILD_SAMPLES' .   # empty — fully removed
grep -rn 'samples/' docs/    # empty (CHANGELOG history excluded)

Consolidate the two parallel example trees into a single canonical
examples/ directory, matching the ecosystem convention from Master
EPIC #657 (pacs_system precedent).

Merge map:
- Move unique samples files (basic_usage, concepts_example, http2_server_example,
  memory_profile_demo, quic_client/server_example, simple_http_client/server)
  into examples/.
- Move samples/messaging_system_integration/ and samples/migration/
  subdirectories under examples/ preserving their READMEs.
- Drop redundant samples files where examples/ already had a better
  facade-API equivalent (connection_pool_example, grpc_service_example,
  http_client_demo (deprecated API), run_all_samples,
  tcp_server_client (deprecated API), udp_echo_demo).

Build flag consolidation:
- Remove BUILD_SAMPLES option from root CMakeLists.txt and CMakePresets.
- BUILD_EXAMPLES is now the single switch (default ON, since samples
  were ON by default and examples is the merged superset).
- Update all CI workflows, install/build scripts, and Windows PowerShell
  install script to reference BUILD_EXAMPLES.

examples/CMakeLists.txt:
- Register the newly migrated targets, including the OpenSSL/network-quic
  link rules previously in samples/CMakeLists.txt for HTTP/2 and QUIC.

Documentation:
- README.md, README.kr.md, docs/PROJECT_STRUCTURE.{md,kr.md},
  docs/README.kr.md, docs/FEATURES.md, docs/advanced/MIGRATION.md,
  docs/ARCHITECTURE_OVERVIEW.md, docs/guides/BUILD{,kr}.md updated to
  point at examples/ and BUILD_EXAMPLES.
- examples/README.md rewritten to cover the merged superset and to
  remove the back-reference to samples/.

Closes #1091
@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 69.1%
Branch Coverage 34.4%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

@kcenon kcenon merged commit 4ac841f into develop May 1, 2026
9 checks passed
@kcenon kcenon deleted the refactor/issue-1091-merge-samples-into-examples branch May 1, 2026 23:51
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