[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
backend/plugins/linker/tasks/link_pr_and_issue.goから始め、LinkPrToIssueがpull requestのフィールドからキーを抽出し、issues.issue_keyと比較する方法を追ってください。このタスクの既存テストを確認し、小文字のブランチキーが大文字の保存済みキーにリンクされるケースを追加してください。このケースでパイプラインが期待される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
- フォーク
- 830
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 62
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/devlake のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 60/100
メンテナーはふだん 2 日以内に返信
-
[Bug][claude_code] Incremental collection stops after the first run対応中かも @clementsen が今日担当しました。 オープン
難易度 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対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンcomponent/plugins type/refactor
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/devlake#9276 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
[Feature][Plugin] Add a GLPI data source plugin対応中かも @rabelenda が 2 日前に担当しました。 オープンtype/feature-request
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
apache/devlake#9273 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
似ている issue
-
automation doc-healer documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
tsukumogami/tsuku#2804 ·
メンテナーはふだん 1 日以内に返信
-
Anthropic /v1/messages: only the last thinking block of an assistant message is kept対応中かも @Shayan12456 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
ollama/ollama#19415 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
raised-by:verifier
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
medici-finance/assay#5039 ·
メンテナーはふだん 1 日以内に返信
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned up対応中かも @barbierajput378-pixel が今日担当しました。 オープンkind/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Project-HAMi/HAMi#3343 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信