Skip to content

Release v0.2.1: 独立 schema 特性与 feature gate 修复

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Jul 19:39
· 427 commits to main since this release

v0.2.1 聚焦库模式(library mode)可用性:将 OpenAPI schema 从 http/openapi 特性中抽为独立的 schema 特性,把依赖 axum / prometheus 的代码统一门控在 http 特性之后,并修复 schema 特性单独启用时的编译失败与测试不稳定问题。

新增

  • 新增独立 schema 特性(依赖 utoipa):库使用方无需引入 axum / prometheus 即可导出 OpenAPI 类型;EmbedRequest、EmbedResponse、OpenAIEmbedRequest、SimilarityMetric、AggregationMode、RateLimitStatus 等领域类型的 ToSchema derive 改为按特性条件启用(9d4005c21)

修复

  • schema 特性单独启用时编译失败:显式添加 utoipa macros 特性(crate::utoipa::Number 被 macros 门控)(2610ced69)
  • schema-only 模式下遗漏的 http 依赖门控:error.rs 的 sanitize_error_message 及相关常量、3 个边界测试,lib.rs 测试模块的 http-only imports,module_registry/tests.rs 中 PrometheusCollectorModule 相关测试,全部补齐 #[cfg(feature = "http")](2610ced69)
  • bin target 在 schema-only 模式下编译失败:为 [[bin]] 添加 required-features = ["http"](2610ced69)
  • config 测试环境变量竞争:test_confers_load_from_minimal_toml 与 test_confers_toml_overrides_defaults 补齐 ENV_LOCK 并清理环境变量,消除 VECBOOST_JWT_SECRET 并行竞争失败(2610ced69)
  • worker 测试 flaky:test_worker_loop_exits_immediately_when_not_running 的 TOCTOU 竞争修复,改为等待 is_alive == false && current_workers == 0(2610ced69)

变更

  • 依赖 axum 的代码统一门控到 http 特性:VecboostError::IntoResponse、metrics endpoint 与 prometheus exporter、PrometheusCollectorModule、pipeline::handler 及依赖 axum 类型的测试代码(55ccc7cfa)

维护

  • 同步更新 CHANGELOG.md 与 .gitignore(2610ced69)

Full Changelog: v0.2.0...v0.2.1