GO_TESTDATA selective route follow-ups: bare testdata token over-disqualifies; per-dataDir reader-scan memo
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 30/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, typescript
- Ambito
- testing-qa
Direzione di ricerca
Start in goPackageTestDataOwnerFor in src/repo/impact.ts, where referenceTokens(dataDir) builds the patterns for the disqualification check, and in the disqualifies scan over goReadersByPackage and goOutsideReaders. Item 1 concerns how the bare testdata token is matched by contentNamesPath when ancestors is true; item 2 concerns caching that scan per owning dataDir without changing the readRepositoryFile single-read behaviour. Confirm scope with a maintainer first, since the issue says it is waiting on that before a PR.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-ups from the review of #85 (both noted as non-blocking there — this issue tracks them). Neither is a safety problem: both currently fail safe by disqualifying the selective route more often than necessary, they just limit how much of #83 the GO_TESTDATA route delivers in real repos.
1. The bare "testdata" reference token over-disqualifies the route
In goPackageTestDataOwnerFor (src/repo/impact.ts), the disqualification check builds its patterns from referenceTokens(dataDir) for p/testdata, and that token list includes the bare testdata literal. With ancestors: true, contentNamesPath matches a path-less word, so any other package containing the very common idioms
filepath.Join("testdata", name)
os.ReadDir("testdata")
disqualifies p's route — even though in package q, a bare testdata resolves to q/testdata, which has nothing to do with p/testdata.
In a repo where two or more packages each use their own testdata, the selective route would rarely be chosen (always falling back), failing safe but wasting the analysis.
Suggested direction (from the review of #85): resolve a bare testdata token against the reader's own package directory and treat it as a reference to that package's testdata only. A slash-bearing reference (p/testdata/…) should keep its current treatment, since that genuinely names another package's tree.
2. Reader scans are repeated per changed file — memoize per dataDir
Every changed file under the same testdata directory runs the same disqualifies scan over goReadersByPackage and goOutsideReaders again: same readers, same contents, same result. On a golden-file refresh that touches many files in one tree, the scan is repeated for each.
Suggested direction: cache the scan outcome keyed by the owning dataDir (valid for one analysis run, keeping the current readRepositoryFile single-read semantics), so a large refresh only pays once per tree.
Happy to take these in a separate PR if a maintainer confirms scope.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 4
- Merge medio
- 18h 41m
- PR unite (30g)
- 48
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né 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 DiffCI/core
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Planner: splitParts regex is quadratic on a quote followed by many backticks, so the fuzz test fails at randomForse già presa @FredApps l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Agent tools: changed_files lists only the new path of a renamed fileForse già presa @FredApps l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
DiffCI/core#243 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
adapter good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
agent-ready area: ui-server priority: p3 type: test
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
schlessera/brain-kit#4249 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation tool triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
can1357/oh-my-pi#19608 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bcgov/nr-waste-plus#1549 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
blixvip/solana-tx-parse#18 ·