getsentry / getsentry/XcodeBuildMCP
Test-products retention is unbounded in practice (100 bundles / 3 days, no config knob) — can fill a disk
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- TypeScript
- Estrelas
- 6.4k
- Forks
- 320
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Version: 2.7.0
Problem
Each test_sim / test_* run stages a full .xctestproducts bundle (a Binaries/ copy of the built test products) under ~/Library/Developer/XcodeBuildMCP/workspaces/<workspace>/test-products/. In one of the repos I work on, each bundle is ~6.6 GB.
pruneManagedTestProductsDirectory only removes bundles that are either:
- older than 3 days (
TEST_PRODUCTS_MAX_AGE_MS), or - in excess of 100 retained (
TEST_PRODUCTS_MAX_COUNT),
and the sweep only runs while the server is active (1h cooldown). At ~6.6 GB/bundle that permits roughly 660 GB before count-based GC ever triggers. In practice, 20 runs over two days silently consumed 66 GB and contributed to filling my disk.
Root cause
These limits are hardcoded in utils/test-products-lifecycle.js:
const TEST_PRODUCTS_MAX_AGE_MS = 3 * 24 * 60 * 60 * 1e3;
const TEST_PRODUCTS_MAX_COUNT = 100;
and the caller in utils/workspace-filesystem-lifecycle.js only ever passes maxAgeMs (the log max-age, also 3 days) — never maxCount. There is no env/config surface to tune count, age, or a total-size cap, unlike XCODEBUILDMCP_DERIVED_DATA_PATH for derived data.
Request
Expose retention controls, e.g.:
XCODEBUILDMCP_TEST_PRODUCTS_MAX_COUNTXCODEBUILDMCP_TEST_PRODUCTS_MAX_AGEXCODEBUILDMCP_TEST_PRODUCTS_MAX_TOTAL_BYTES
and/or lower the defaults given bundles are multi-GB (e.g. keep only the newest N per workspace). A total-size budget would be the most robust guard against filling the disk between the age/count thresholds.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
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.
Direção de pesquisa
Comece lendo utils/test-products-lifecycle.js, incluindo pruneManagedTestProductsDirectory e suas constantes TEST_PRODUCTS_MAX_AGE_MS e TEST_PRODUCTS_MAX_COUNT, e depois rastreie o chamador em utils/workspace-filesystem-lifecycle.js. Determine como as configurações de retenção devem ser expostas e como os limites de tamanho total ou de quantidade/idade devem interagir; considera-se concluído quando a limpeza configurável impedir o cenário documentado de crescimento do disco e o comportamento existente do ciclo de vida continuar coberto.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- typescript
- Domínio
- tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Ativa
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 48/100