Refactor apt_sources table
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 64/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- cpp
调研方向
找到 apt_sources 表的实现及其 parseDeb822Block 入口点,然后阅读字段的收集方式以及 schema 的定义方式。重构求值过程,使字段顺序不会影响已禁用的块,并确保该表返回每个源以及支持筛选的 enabled 布尔值。
由索引模型根据 Issue 内容生成。
描述
Blueprint
Greetings! 👋
#8928 fixed the apt_sources table incorrectly dropping deb822 source blocks that used yes as an affirmative value for the Enabled field. During review, a few deeper behavioral issues were noted that are worth addressing in a follow-up refactor.
Problems
1. parseDeb822Block is order-dependent, but deb822 is not
The current implementation returns early mid-loop when it encounters Enabled: no. This means the outcome depends on field order: for example, if Enabled: no appears after a malformed Types: or URIs: line, the function returns a failure instead of correctly treating the block as disabled.
See: #8928 (comment)
2. Silently omitting disabled sources is overly opinionated
Currently, any source with Enabled: no is silently dropped from results.
This makes the table less useful for auditing: users have no way to see which repos exist but are disabled. It can also be surprising and confusing.
Proposed Changes
- Refactor
parseDeb822Blockto be order-independent: collect all fields first, then evaluateEnabledafter the loop rather than as an early return - Add an
enabledboolean column to theapt_sourcesschema and return all source entries regardless of their enabled state, allowing users to filter as needed (e.g.SELECT * FROM apt_sources WHERE enabled = 1)
- 主要语言
- C++
- 星标
- 23.8k
- 派生
- 2.7k
- 平均合并
- 6 天 11 小时
- 30 天内合并 PR
- 69
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
osquery/osquery 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 3 天内回复
-
usb_devices: usb_address and usb_port are wrong for bus/device numbers 8–99 on Linux (zero-padded udev values parsed as octal)可能已有人在做 @mjatin2007 于 6 天前认领。 未关闭Linux virtual tables
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 3 天内回复
-
Update the expired Slack invite link in README可能重新可做 @ayushkrsingh946 于 40 天前认领,目前没有进行中的 PR。 未关闭maintainer task
难度 1/5 1 小时以内 新手友好度 68/100
osquery/osquery#9215 · 4 条评论 ·
维护者通常 3 天内回复
-
fix(docs): debugging guide incorrectly says invalid configuration blocks daemon startup可能已有人在做 @nightcityblade 于 54 天前认领。 未关闭configuration documentation
难度 2/5 1-3 小时 新手友好度 72/100
osquery/osquery#9143 · 1 条评论 ·
维护者通常 3 天内回复
-
scheduled_tasks.hidden returns the task's Enabled state instead of Hidden (Windows)可能已有人在做 @a-bonfim-tech 于 67 天前认领。 未关闭bug triage virtual tables Windows
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 3 天内回复
相似的 Issue
-
Make the HTTP server's keep-alive and headers timeouts configurable可能已有人在做 @mattgodbolt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
compiler-explorer/compiler-explorer#9902 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Nixtla/statsforecast#1371 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itself可能已有人在做 @fedonman 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
task
难度 2/5 1-3 小时 新手友好度 76/100
SparseLinearAlgebra/spla#316 · 1 条评论 ·
维护者通常 1 天内回复