[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 78/100
Rechercherichtung
Beginne mit backend/plugins/linker/tasks/link_pr_and_issue.go und verfolge, wie LinkPrToIssue Schlüssel aus Pull-Request-Feldern extrahiert und mit issues.issue_key vergleicht. Sieh dir die bestehenden Tests für diese Aufgabe an und füge einen Fall hinzu, in dem ein kleingeschriebener Branch-Schlüssel mit einem großgeschriebenen gespeicherten Schlüssel verknüpft wird. Das Ziel ist erreicht, wenn die Pipeline für diesen Fall den erwarteten Eintrag in pull_request_issues erstellt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- Go
- Sterne
- 3.2k
- Forks
- 830
- Ø Merge
- 2 T. 6 Std.
- Gemergte PRs (30 T.)
- 62
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/devlake
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 60/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug][claude_code] Incremental collection stops after the first runEvtl. vergeben @clementsen hat das heute übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 32/100
Maintainer antworten meist innerhalb von 2 Tagen
-
type/bug
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 73/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Refactor][Build] Build the core and all plugins into a single binary by defaultEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offencomponent/plugins type/refactor
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
apache/devlake#9276 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[Feature][Plugin] Add a GLPI data source pluginEvtl. vergeben @rabelenda hat das vor 2 Tagen übernommen. Offentype/feature-request
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 38/100
apache/devlake#9273 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 2 Tagen
Ähnliche Issues
-
automation doc-healer documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptEvtl. vergeben @Shayan12456 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
ollama/ollama#19415 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:recipes event:contribfest format:human-first source:agent status:needs-triage type:recipe
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
cadence-workflow/cadence-ai-samples#140 ·
Maintainer antworten meist innerhalb von 1 Tag
-
customer issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
dolthub/doltgresql#3716 ·
Maintainer antworten meist innerhalb von 1 Tag
-
ux
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
evcc-io/evcc#35605 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag