Skip to content

build: make WebAuthn optional and validate feature combinations - #339

Merged
voidvec merged 1 commit into
masterfrom
build/optional-features-s06
Nov 18, 2026
Merged

voidvec merged 1 commit into
masterfrom
build/optional-features-s06

Conversation

@voidvec

@voidvec voidvec commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

S06-B: disabling WebAuthn previously still required libcbor and compiled the crypto/CBOR tests. Gate the Conan requirement, implementation, test collection and exported SDK dependency together, so OFF builds and external consumers work with libcbor discovery explicitly disabled.

Preserve the full-feature route baselines. Trimmed preservation tests compare the unfiltered actual registrations with the enabled subset of the frozen expected baseline; shared provider discovery/authorize routes remain available. Social OFF also excludes the repository fixture whose types already have WITH_SOCIAL guards.

Add a reproducible matrix runner and three trimmed Linux CI jobs. The runner audits the complete locked graph, source collection, feature flags and exports; requires the full applicable CTest registry/JUnit to pass without CTest skips and confirms live PostgreSQL/Redis readiness. It separately builds/runs fresh build-tree and installed SDK consumers and verifies their actual package/archive locations.

Type of change

  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (API, config, or protocol surface)
  • Docs / tests / CI only

Validation

The four-combination local results below are historical validation of the original B-side implementation on d616a7b4; they are not a fresh full-matrix rerun after this follow-up.

Social WebAuthn CTest passed Full service cases / assertions Build-tree SDK Installed SDK
ON ON 646 746 / 62315 passed passed
OFF ON 564 703 / 62083 passed passed
ON OFF 570 733 / 62293 passed passed
OFF OFF 489 690 / 61947 passed passed

Local toolchain: GCC 13.3, C++17, Release with explicit resource override -O1 -DNDEBUG, FULLA_WERROR=ON for targets using the existing warning helper. Offline Conan uses only the recorded local platform exception cmake/4.4.4#platform; all other graph revisions match the unchanged lock. New CI uses the strict lock without that exception. No local Windows/macOS/sanitizer result is claimed.

API/architecture/migration/naming/macro/double-move/manage parity, OpenAPI validation/governance, actionlint, Python syntax/optimized-mode rejection, EN/zh mirror/link/LLM checks passed. Both final documentation locales built; unchanged frontend-i18n pages still report broken-anchor warnings. The client-generator inputs and generated clients are unchanged; version linkage passed, regeneration was unnecessary. Full CTest has zero CTest skips; existing conditional branches within test bodies remain and are not claimed as covered.

Checklist

  • Tests added or updated; full applicable suite green locally
  • CHANGELOG.md entry added
  • Docs and zh-CN mirrors updated

The default public headers, API baseline, route fingerprint/golden, OpenAPI YAML/runtime JSON, dependency lock, schema/ORM and migrations are unchanged. The API-synchronization and release/version-bump checklists are not applicable. No identity-OFF decoupling, dependency upgrade, deployment or #300 investigation is included.

Review follow-up (2026-11-17)

Current head ff58a365 is based on master 5dcc7a9a; the original patch was rebased cleanly with unchanged stable patch-id. Both required review findings and the listener-isolation suggestion are addressed:

  • FeatureSurface receives the actual test-target configuration, explicit migration/seed resources and generator-aware server path. Missing inputs fail; no platform is switched to a different storage profile or skipped.
  • Build-tree SDK smoke and matrix primary/installed consumer options explicitly reset libcbor discovery for both OFF and ON. Consumer/evidence overwrite protections remain.
  • The probe child preserves its parent environment except for its own selected listener port.
  • Master feat(oidc-in): P2-1a upstream provider registry + generic OIDC federation core #347 introduced an upstream-provider HTTP fixture and two optional OIDC route prefixes. Social OFF now excludes that dependent fixture; only the frozen expected-route subset excludes /api/admin/upstream-providers and /api/auth/oidc. Actual registrations, full-feature fingerprint/golden and shared provider/consent routes are unchanged.

Current local validation: all 11 tool regressions executed without skips, including actual CMake OFF-to-ON cache/source-collection tests and C++17/WERROR probes using the real route header in both modes. Precise old behavior failures were retained. Actual project single/multi-config CTest paths were checked. Independent plan and implementation reviews passed after closing the integration findings.

A fresh Release/C++17/WERROR production server build (-O1 -DNDEBUG resource override) and real all-features memory probe passed during the first follow-up, before the final test-collection/expected-subset changes; production sources and runtime inputs are identical. A conflicting parent listener port was explicitly set. This is not real PG/Redis or clean-shutdown acceptance. The original four-combination local table above remains historical.

Preliminary head dfa6e770 passed three-platform CI, SDK smoke and ASan+UBSan; its Social OFF builds exposed the #347 integration fixed above. Intermediate 78f31a0c then passed both single-feature-OFF matrix legs and sanitizers, but the both-OFF main binary failed two empty-scope assertions in one existing consent contract case. Source inspection confirmed its setup API can return 200 before commit. The test fixture now sends the update once and observes the exact committed scope set through direct GETs within one three-second steady deadline before opening the decision transaction; transport/status/shape errors fail immediately. Original empty-scope, no-expansion, rollback, conflict and concurrency assertions are retained. No production transaction/cache behavior or shared retry helper changed. This timing explanation is consistent with the failure, not a dynamic capture of its commit instant.

The changed real test TU passed C++17/Wall/Wextra/Werror syntax checking, including a Windows-style min macro probe under GCC; this is not an MSVC or full-test result. Final 11/11 tool regressions ran without skips. Independent implementation re-review passed with no remaining P0/P1.

Previous-head results are historical. Current runs: CI, optional matrix, sanitizers.

Local architecture/macro/manage checks and five preflight gates passed. Actual Python (352 files) and TS (16 files) regeneration passed on SDK inputs/outputs verified byte-identical across both review branches. Local pinned Go restoration stopped at the disk-space guard, with no result. The path-filtered clients-sdk workflow is not automatically triggered by this diff, so it was explicitly dispatched on the final branch to complete Go/Python/TS drift and unit checks; main Static Checks/SDK Smoke are separate checks. No gate/baseline was weakened. The explicitly dispatched Client SDKs passed all three Python/Go/TS drift/build/unit jobs on this exact head. Full main CI/matrix acceptance is still pending. Keep this PR draft; no merge or deployment.

@voidvec

voidvec commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner Author

必须处理项

评审基于 e4e7691d2e83206ada2727df93eade8017678793。

1. [P1] 新增运行时测试依赖了常规 CI 未提供的服务器配置

位置:tools/feature-matrix/check_runtime.py:29–30。

FeatureSurface_OutOfProcess 直接读取 server.parent / "config.json",但常规构建没有在该位置部署配置。当前 head 的 Linux、Windows、macOS 及 ASan+UBSan 日志均在这行报 FileNotFoundError;四个任务的失败测试均为本 PR 新增的 FeatureSurface_OutOfProcess,不是 sanitizer 检出了内存问题。Windows 缺少的是 apps/server/Release/config.json,单配置生成器缺少的是 apps/server/config.json。可选矩阵通过不能替代普通 CTest 入口的兼容性。

证据:三平台 CI、ASan+UBSan。

处理建议: 让 CTest 显式传入适用的配置路径,或在构建/测试准备阶段按 $<TARGET_FILE_DIR:fulla-server> 部署配置及所需运行资源;同时保留 Windows/macOS 的 memory 配置与 Linux 的 PostgreSQL/Redis 配置,不能改成缺配置就跳过。

验收: 从干净的常规 preset 构建执行该测试,三平台与 sanitizer 全部通过,三个裁剪矩阵仍通过。

验证方式:远程 head 源码与 CI 原始失败日志核对;本轮未在本机重新编译 C++。

2. [P2] OFF → ON 重配置会遗留 SDK 消费者的 libcbor 禁用缓存

位置:CMakeLists.txt:165–171、消费者构建目录:175–188。

WebAuthn=OFF 时给消费者缓存写入 CMAKE_DISABLE_FIND_PACKAGE_libcbor=TRUE,切回 ON 时却只是不再传参。SdkSmoke.FullStack 复用同一个消费者构建目录,因此旧的 TRUE 不会被删除;ON 导出包重新要求 find_dependency(libcbor) 后,消费端配置将被该缓存阻止。新矩阵使用新目录,覆盖不到这种重配置路径。

处理建议: OFF/ON 两种状态都显式传入对应的 TRUE/FALSE,或在消费端配置前显式清除该缓存。

验收: 同一构建目录先运行 WebAuthn=OFF 的 SDK smoke,再正确切换 Conan/CMake 到 ON,并再次运行 smoke,应无需手动删除消费端缓存即可通过。此项根据 CMake 缓存和目录复用逻辑确认,本轮未执行完整切换构建。

@voidvec

voidvec commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

建议处理项

评审基于 e4e7691d2e83206ada2727df93eade8017678793;以下为非阻断改进,与另一条评论的必须处理项分开记录。

1. 隔离探针子进程的监听端口环境变量

位置:tools/feature-matrix/check_runtime.py:31–36、进程启动:54–55。

探针在 JSON 中设置随机端口,但 Popen 默认继承宿主环境。项目支持用 FULLA_LISTEN_PORT 覆盖 listeners.0.port,因此开发环境已设置该变量时,服务器会监听环境指定端口,而探针仍访问随机端口,最终超时。

建议传入复制后的子进程环境,并将 FULLA_LISTEN_PORT 显式设置为本次选择的端口;增加带宿主端口覆盖变量的测试。这样仍可保留数据库/Redis 等必要环境配置,避免清空整个环境。

其余检查:未确认其他源码裁剪、Conan 依赖或 SDK 导出缺陷;golden/OpenAPI 只裁剪预期集合、保留实际注册集合的检查方式合理。本轮为源码与远程 CI 证据评审,不代表重新执行完整矩阵。

@voidvec
voidvec force-pushed the build/optional-features-s06 branch 3 times, most recently from 78f31a0 to ff58a36 Compare November 17, 2026 14:55
Gate dependencies, implementation, tests and SDK exports consistently.
Use explicit runtime config/resources and isolate probe listener ports.
Reset SDK libcbor discovery on OFF/ON reconfiguration.

Keep upstream-provider fixtures and expected route subsets aligned with
WITH_SOCIAL, preserving full-feature baselines and actual routes.
Read back committed fixture scopes before starting consent decisions,
using a single write and bounded reads without weakening assertions.
Cover collection, route helpers, probe isolation and CMake cache reuse.
@wangrh0909
wangrh0909 force-pushed the build/optional-features-s06 branch from ff58a36 to ea648b2 Compare November 18, 2026 04:02
@voidvec
voidvec marked this pull request as ready for review November 18, 2026 04:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T04:11:17.129639Z ea648b2 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@voidvec
voidvec merged commit ba76f64 into master Nov 18, 2026
18 checks passed
@voidvec
voidvec deleted the build/optional-features-s06 branch November 18, 2026 05:31
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.

2 participants