GO_TESTDATA selective route follow-ups: bare testdata token over-disqualifies; per-dataDir reader-scan memo
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- go, typescript
- Domínio
- testing-qa
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 0
- Forks
- 4
- Merge médio
- 18h 41min
- PRs com merge (30d)
- 48
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de DiffCI/core
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Planner: splitParts regex is quadratic on a quote followed by many backticks, so the fuzz test fails at randomTalvez já em andamento @FredApps assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
Mantenedores costumam responder em até 1 dia
-
Agent tools: changed_files lists only the new path of a renamed fileTalvez já em andamento @FredApps assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
DiffCI/core#243 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
adapter good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
Todas as issues de DiffCI/core
Issues semelhantes
-
agent-ready area: ui-server priority: p3 type: test
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
schlessera/brain-kit#4249 ·
Mantenedores costumam responder em até 1 dia
-
documentation tool triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
can1357/oh-my-pi#19608 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
dependencies tech-debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
bcgov/nr-waste-plus#1549 ·
Mantenedores costumam responder em até 1 dia
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
blixvip/solana-tx-parse#18 ·