[Bug][linker] LinkPrToIssue never matches lowercase issue keys (e.g. in branch names)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia da backend/plugins/linker/tasks/link_pr_and_issue.go e segui il modo in cui LinkPrToIssue estrae e confronta le chiavi dai campi della pull request con issues.issue_key. Controlla i test esistenti per questa attività e aggiungi un caso in cui una chiave di branch in minuscolo viene collegata a una chiave memorizzata in maiuscolo. Il risultato è raggiunto quando la pipeline crea la riga prevista in pull_request_issues per quel caso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Go
- Stelle
- 3.2k
- Fork
- 832
- Merge medio
- 2g 6h
- PR unite (30g)
- 62
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/devlake
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
I maintainer di solito rispondono entro 2 giorni
-
[Bug][claude_code] Incremental collection stops after the first runForse già presa @clementsen l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
I maintainer di solito rispondono entro 2 giorni
-
type/bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 73/100
I maintainer di solito rispondono entro 2 giorni
-
[Refactor][Build] Build the core and all plugins into a single binary by defaultForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertacomponent/plugins type/refactor
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
apache/devlake#9276 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[Feature][Plugin] Add a GLPI data source pluginForse già presa @rabelenda l’ha presa 2 giorni fa. Apertatype/feature-request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
apache/devlake#9273 · 1 reazione ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/devlake
Issue simili
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackersApertaagent-butler-finding bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
jordansmall/spindrift#6238 ·
I maintainer di solito rispondono entro 1 giorno
-
bug: microcks test get swallows test failure details and operation results in text output modeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
microcks/microcks-cli#608 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug from-studio
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
esengine/DeepSeek-Reasonix#14868 ·
I maintainer di solito rispondono entro 1 giorno
-
Install notes print "Camunda REST API: https://" without a host when global.host is setForse già presa @irisfield l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
camunda/camunda-platform-helm#7790 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
wso2/agent-manager#2220 ·
I maintainer di solito rispondono entro 1 giorno