Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

breg: two test targets fail to build with postgres-test but without tooling

未关闭 适合新手
#1,851 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
postgresql, rust

调研方向

从 crates/registry-breg/tests/postgres_startup.rs:858、crates/registry-breg/src/startup.rs:588 和 crates/registry-breg/tests/package_change_plan.rs:46-47 开始,比较它们的 feature gate 和用法。运行 cargo clippy -p registry-breg --features postgres-test --all-targets -- -D warnings,然后确认文档中记录的 postgres-test,tooling 组合也能通过。

由索引模型根据 Issue 内容生成。

描述

area:breg bug criticality:p3

Summary

cargo clippy --locked --keep-going -p registry-breg --features postgres-test --all-targets -- -D warnings fails on current main. Two test targets assume the tooling feature without gating on it:

  • crates/registry-breg/tests/postgres_startup.rs:858 calls PreparedServer::runtime_pool_for_test, which crates/registry-breg/src/startup.rs:588 defines only under #[cfg(all(feature = "postgres-test", feature = "tooling"))]. That target is gated only on postgres-test, so it fails with E0599 (a compile error, not only a lint).
  • crates/registry-breg/tests/package_change_plan.rs:46-47 declares INSTANCE and DATABASE unconditionally, but only tooling-gated code uses them, so -D warnings reports them as dead code.

Impact

Low. The documented and CI commands always add tooling (products/breg/scripts/validate_product.py, products/breg/scripts/test-postgres.sh), so CI is green. A contributor who runs the PostgreSQL suite or clippy with --features postgres-test alone gets a build failure in files they did not touch.

Suggested fix

Gate the runtime_pool_for_test call (or the test that uses it) on feature = "tooling", and gate the two constants the same way as their users. Then check that cargo clippy -p registry-breg --features postgres-test --all-targets -- -D warnings and the documented postgres-test,tooling combination both pass.

主要语言
Rust
星标
2
派生
0
平均合并
9 小时 5 分钟
30 天内合并 PR
248

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

registrystack/registry-stack 的其他 Issue

查看 registrystack/registry-stack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。