Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
cxx: g++
type: static
shell: sh
options: -DSOURCEMETA_CORE_CRYPTO_USE_SYSTEM_OPENSSL:BOOL=ON
options: -DSOURCEMETA_CORE_CRYPTO_USE_SYSTEM_OPENSSL:BOOL=ON -DSOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL:BOOL=ON
apt: libcurl4-openssl-dev
benchmark: linux/gcc
- os: ubuntu-latest
cc: clang
Expand Down Expand Up @@ -85,6 +86,9 @@ jobs:
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.platform.apt
run: sudo apt-get update && sudo apt-get install --yes ${{ matrix.platform.apt }}

- run: cmake --version
- name: Configure (static)
Expand All @@ -93,6 +97,7 @@ jobs:
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DSOURCEMETA_CORE_TESTS:BOOL=ON
-DSOURCEMETA_CORE_TESTS_CI:BOOL=ON

@augmentcode augmentcode Bot Jun 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

.github/workflows/ci.yml:96: CI now enables SOURCEMETA_CORE_TESTS_CI, which runs HTTP integration tests against schemas.sourcemeta.com; this can introduce flaky failures due to network/DNS/service availability rather than code regressions. Consider gating these tests (opt-in job/label, retries, or a skip mechanism when outbound network isn’t available).

Severity: medium

Other Locations
  • .github/workflows/ci.yml:108
  • test/http/ci/http_system_request_test.cc:8

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Enabling SOURCEMETA_CORE_TESTS_CI unconditionally in CI runs HTTP integration tests against the live schemas.sourcemeta.com service. Transient network or DNS failures will cause false-negative test results. Consider adding a retry mechanism, gating behind a dedicated CI label/job, or skipping when the service is unreachable.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 96:

<comment>Enabling `SOURCEMETA_CORE_TESTS_CI` unconditionally in CI runs HTTP integration tests against the live `schemas.sourcemeta.com` service. Transient network or DNS failures will cause false-negative test results. Consider adding a retry mechanism, gating behind a dedicated CI label/job, or skipping when the service is unreachable.</comment>

<file context>
@@ -93,6 +93,7 @@ jobs:
           cmake -S . -B ./build
           -DCMAKE_BUILD_TYPE:STRING=Release
           -DSOURCEMETA_CORE_TESTS:BOOL=ON
+          -DSOURCEMETA_CORE_TESTS_CI:BOOL=ON
           -DSOURCEMETA_CORE_BENCHMARK:BOOL=ON
           -DSOURCEMETA_CORE_DOCS:BOOL=OFF
</file context>

-DSOURCEMETA_CORE_BENCHMARK:BOOL=ON
-DSOURCEMETA_CORE_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=OFF
Expand All @@ -104,6 +109,7 @@ jobs:
cmake -S . -B ./build
-DCMAKE_BUILD_TYPE:STRING=Release
-DSOURCEMETA_CORE_TESTS:BOOL=ON
-DSOURCEMETA_CORE_TESTS_CI:BOOL=ON
-DSOURCEMETA_CORE_BENCHMARK:BOOL=ON
-DSOURCEMETA_CORE_DOCS:BOOL=OFF
-DBUILD_SHARED_LIBS:BOOL=ON
Expand Down
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ option(SOURCEMETA_CORE_YAML "Build the Sourcemeta Core YAML library" ON)
option(SOURCEMETA_CORE_JSONRPC "Build the Sourcemeta Core JSON-RPC library" ON)
option(SOURCEMETA_CORE_MCP "Build the Sourcemeta Core MCP library" ON)
option(SOURCEMETA_CORE_HTTP "Build the Sourcemeta Core HTTP library" ON)
option(SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL "Use system cURL for the Sourcemeta Core HTTP library" OFF)
option(SOURCEMETA_CORE_JOSE "Build the Sourcemeta Core JOSE library" ON)
option(SOURCEMETA_CORE_SEMVER "Build the Sourcemeta Core SemVer library" ON)
option(SOURCEMETA_CORE_GZIP "Build the Sourcemeta Core GZIP library" ON)
option(SOURCEMETA_CORE_HTML "Build the Sourcemeta Core HTML library" ON)
option(SOURCEMETA_CORE_CSS "Build the Sourcemeta Core CSS library" ON)
option(SOURCEMETA_CORE_MARKDOWN "Build the Sourcemeta Core Markdown library" ON)
option(SOURCEMETA_CORE_TESTS "Build the Sourcemeta Core tests" OFF)
option(SOURCEMETA_CORE_TESTS_CI "Build the Sourcemeta Core CI tests" OFF)
option(SOURCEMETA_CORE_BENCHMARK "Build the Sourcemeta Core benchmarks" OFF)
option(SOURCEMETA_CORE_DOCS "Build the Sourcemeta Core docs" OFF)
option(SOURCEMETA_CORE_INSTALL "Install the Sourcemeta Core library" ON)
Expand Down Expand Up @@ -230,7 +232,7 @@ endif()

# Testing

if(SOURCEMETA_CORE_CONTRIB_GOOGLETEST OR SOURCEMETA_CORE_TESTS)
if(SOURCEMETA_CORE_CONTRIB_GOOGLETEST OR SOURCEMETA_CORE_TESTS OR SOURCEMETA_CORE_TESTS_CI)
find_package(GoogleTest REQUIRED)
endif()

Expand Down Expand Up @@ -380,6 +382,14 @@ if(SOURCEMETA_CORE_TESTS)
endif()
endif()

if(SOURCEMETA_CORE_TESTS_CI)
enable_testing()

if(SOURCEMETA_CORE_HTTP)
add_subdirectory(test/http/ci)
endif()
endif()

if(SOURCEMETA_CORE_BENCHMARK)
add_subdirectory(benchmark)
endif()
4 changes: 4 additions & 0 deletions cmake/common/compiler/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ function(sourcemeta_add_default_options visibility target)
-Wno-exit-time-destructors
-Wrange-loop-analysis

# Manage Objective-C and Objective-C++ object lifetimes with Automatic
# Reference Counting
$<$<OR:$<COMPILE_LANGUAGE:OBJC>,$<COMPILE_LANGUAGE:OBJCXX>>:-fobjc-arc>

# Enable loop vectorization for performance reasons
$<$<NOT:$<CONFIG:Debug>>:-fvectorize>
# Enable vectorization of straight-line code for performance
Expand Down
7 changes: 7 additions & 0 deletions cmake/common/variables.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Objective-C++ powers the Apple-specific backends and must be enabled before
# we capture the project languages below, so its standard and visibility
# defaults get applied
if(APPLE)
enable_language(OBJCXX)
endif()

# Get the list of languages defined in the project
get_property(SOURCEMETA_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)

Expand Down
3 changes: 3 additions & 0 deletions config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ foreach(component ${SOURCEMETA_CORE_COMPONENTS})
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_jsonrpc.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_mcp.cmake")
elseif(component STREQUAL "http")
if(@SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL@)
find_dependency(CURL)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_preprocessor.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_numeric.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_core_io.cmake")
Expand Down
29 changes: 27 additions & 2 deletions src/core/http/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
if(SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL)
set(SOURCEMETA_CORE_HTTP_CLIENT_SOURCE client_curl.cc)
elseif(APPLE)
set(SOURCEMETA_CORE_HTTP_CLIENT_SOURCE client_darwin.mm)
elseif(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "MSYS")
set(SOURCEMETA_CORE_HTTP_CLIENT_SOURCE client_windows.cc)
else()
set(SOURCEMETA_CORE_HTTP_CLIENT_SOURCE client_curl.cc)
endif()

sourcemeta_library(NAMESPACE sourcemeta PROJECT core NAME http
PRIVATE_HEADERS problem.h status.h method.h message.h error.h
PRIVATE_HEADERS problem.h status.h method.h message.h error.h system.h
SOURCES helpers.h problem.cc match_accept.cc match_accept_language.cc
negotiate_encoding.cc from_date.cc format_link.cc field_list.cc
accept_includes_all.cc content_type_matches.cc parse_bearer.cc)
accept_includes_all.cc content_type_matches.cc parse_bearer.cc
${SOURCEMETA_CORE_HTTP_CLIENT_SOURCE})

if(SOURCEMETA_CORE_INSTALL)
sourcemeta_library_install(NAMESPACE sourcemeta PROJECT core NAME http)
Expand All @@ -11,3 +22,17 @@ endif()
target_link_libraries(sourcemeta_core_http PUBLIC sourcemeta::core::json)
target_link_libraries(sourcemeta_core_http PUBLIC sourcemeta::core::text)
target_link_libraries(sourcemeta_core_http PRIVATE sourcemeta::core::time)

if(SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL)
find_package(CURL REQUIRED)
target_compile_definitions(sourcemeta_core_http
PRIVATE SOURCEMETA_CORE_HTTP_USE_SYSTEM_CURL)
target_link_libraries(sourcemeta_core_http PRIVATE CURL::libcurl)
elseif(APPLE)
target_link_libraries(sourcemeta_core_http PRIVATE "-framework Foundation")
elseif(WIN32 AND NOT CMAKE_SYSTEM_NAME STREQUAL "MSYS")
target_link_libraries(sourcemeta_core_http PRIVATE winhttp)
target_link_libraries(sourcemeta_core_http PRIVATE sourcemeta::core::unicode)
else()
target_link_libraries(sourcemeta_core_http PRIVATE ${CMAKE_DL_LIBS})
endif()
Loading
Loading