Include/ignore patterns are matched against the GitHub API URL instead of the repository-relative path
@strawberry-little-bear ci sta già lavorando.
Dal 22/10/2026.
- #216 di @strawberry-little-bear — aperta
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Start in src/bot.ts and trace how changed file paths are passed to matchPatterns for include and ignore rules. Compare that input with file.filename, which the issue says is already used for IGNORE; confirm the behavior with the reproduction in the issue. Done means patterns are matched against repository-relative filenames, so API URL segments cannot affect filtering.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
INCLUDE_PATTERNS and IGNORE_PATTERNS are matched against the pathname of GitHub's contents_url, rather than the repository-relative file path. That pathname includes API metadata:
/repos/{owner}/{repo}/contents/{path}
Consequently, a pattern can accidentally match the owner or repository name. For example, in a repository named docs, with this changed file:
filename: src/app.ts
contents_url: https://api.github.com/repos/example/docs/contents/src/app.ts
and this configuration:
INCLUDE_PATTERNS: docs/**
the current code constructs **/docs/** and matches /repos/example/docs/contents/src/app.ts, so src/app.ts is reviewed even though it is not under a top-level docs/ directory. The same collision means IGNORE_PATTERNS: docs/** can ignore every changed file in a repository named docs.
Expected behavior
Include/ignore patterns should be evaluated against the repository-relative filename (file.filename, which is already used for IGNORE), so API path segments such as repos, the owner, the repository name, and contents cannot participate in matching.
Reproduction
I reproduced the behavior with the project's matchPatterns logic and [email protected]:
minimatch(
'/repos/example/docs/contents/src/app.ts',
'**/docs/**'
); // true
The expected input for this file is instead:
minimatch('src/app.ts', '**/docs/**'); // false
The relevant code is in src/bot.ts, where decodeURIComponent(new URL(file.contents_url).pathname) is passed to matchPatterns.
Impact
This is a functional filtering bug: include/ignore rules can select or exclude unrelated files whenever a pattern collides with the repository's API pathname components. It is particularly visible when a directory pattern has the same name as the repository, but the same issue applies to any pattern intended to match only repository paths.
- Lingua principale
- JavaScript
- Stelle
- 4.5k
- Fork
- 465
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la 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 anc95/ChatGPT-CodeReview
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
anc95/ChatGPT-CodeReview#76 · 2 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
anc95/ChatGPT-CodeReview#208 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
anc95/ChatGPT-CodeReview#203 · 2 commenti · 1 reazione ·
-
Rate limitForse già presa @Br1an67 l’ha presa 235 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
anc95/ChatGPT-CodeReview#201 · 4 commenti ·
-
IssueAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
anc95/ChatGPT-CodeReview#200 ·
Tutte le issue di anc95/ChatGPT-CodeReview
Issue simili
-
[Bug] Pitch Converter gives the wrong octave for B♯, C♭, B𝄪 and C𝄫Forse già presa @bhuvan-somisetty l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
sugarlabs/musicblocks#9765 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
adaumsilva/OrchestrAI#51 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Jason-Vaughan/TangleClaw#2546 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rubyjs/mini_racer#449 ·
-
area:integration enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100