[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 backend/plugins/linker/tasks/link_pr_and_issue.go 开始,追踪 LinkPrToIssue 如何从 pull request 字段中提取键,并将它们与 issues.issue_key 进行比较。检查此任务现有的测试,并添加一个小写分支键关联到大写存储键的案例。完成标准是 pipeline 为该案例创建预期的 pull_request_issues 行。
由索引模型根据 Issue 内容生成。
描述
Search before asking
- I had searched in the issues and found no similar issues.
What happened
The linker plugin's LinkPrToIssue subtask compares the keys extracted from a PR (title, description or head ref) against issues.issue_key with an exact, case-sensitive match. normalizeIssueKey only strips # and whitespace.
Some issue trackers generate lowercase branch names from the issue key, e.g. user/proj-123-short-title for issue PROJ-123. Since #8777, head refs are searched, but even with a case-insensitive prToIssueRegexp such as (?i)\b(PROJ)-\d+\b, the extracted key is proj-123. It never equals the stored key PROJ-123, so the PR is silently left unlinked.
In my instance, about 5% of PRs that contain a key are affected, namely those where the key appears only in the branch name.
What do you expect to happen
Matching should be case-insensitive, or the extracted key should be normalized to match the stored issue_key, so that proj-123 links to PROJ-123.
How to reproduce
- Sync an issue tracker with an issue keyed
PROJ-123and a GitHub repo into one project. - Open a PR whose head ref is
user/proj-123-short-title, with no key in the title or description. - Enable the
linkerplugin withprToIssueRegexp=(?i)\b(PROJ)-\d+\b. - Run the project pipeline.
pull_request_issueshas no row for this PR.
Anything else
Suggested fix in backend/plugins/linker/tasks/link_pr_and_issue.go: compare case-insensitively, e.g. uppercase the extracted keys and match with UPPER(issues.issue_key) IN ?. Uppercasing in normalizeIssueKey alone would only work for trackers with uppercase keys.
A related limitation is that the enricher stops at the first field (title, then description, then head ref) with any regex match. A PR with an unrelated match in the title, such as CVE-2024-0000, never has its description or branch checked, so a real key there is ignored. I can open that as a separate issue if preferred.
Version
v1.0.3-beta18
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Code of Conduct
- I agree to follow this project's Code of Conduct
- 主要语言
- Go
- 星标
- 3.2k
- 派生
- 832
- 平均合并
- 2 天 6 小时
- 30 天内合并 PR
- 62
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/devlake 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 60/100
维护者通常 2 天内回复
-
[Bug][claude_code] Incremental collection stops after the first run可能已有人在做 @clementsen 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 32/100
维护者通常 2 天内回复
-
type/bug
难度 3/5 半天 新手友好度 73/100
维护者通常 2 天内回复
-
[Refactor][Build] Build the core and all plugins into a single binary by default可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭component/plugins type/refactor
难度 5/5 一周以上 新手友好度 25/100
维护者通常 2 天内回复
-
[Feature][Plugin] Add a GLPI data source plugin可能已有人在做 @rabelenda 于 2 天前认领。 未关闭type/feature-request
难度 5/5 一周以上 新手友好度 38/100
apache/devlake#9273 · 1 个 reaction ·
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
lognorman20/monaco#7428 ·
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackers未关闭agent-butler-finding bug
难度 2/5 1-3 小时 新手友好度 77/100
jordansmall/spindrift#6238 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
microcks/microcks-cli#608 · 1 条评论 ·
维护者通常 1 天内回复
-
bug from-studio
难度 2/5 1-3 小时 新手友好度 65/100
esengine/DeepSeek-Reasonix#14868 ·
维护者通常 1 天内回复