Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

generate-fixtures: write byte-identical assets once in the default assets/ output

Abierto
#469 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
php, symfony
Área
tooling

Línea de trabajo

Start with StoredFileExporter, which writes the assets/ files that generate-fixtures emits, and check how it names files today. Read UploadableFileManager::persistFiles() to confirm it only reads the source through a stream. Run GenerateFixturesCommandTest and generate_fixtures_round_trip.feature to see the current output. Done means identical content is written once under a sha256-keyed name, name clashes with different content still get -2, -3, and the round trip regenerates byte for byte.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

generate-fixtures writes one file under assets/ per uploadable field, even when the stored files are byte-identical. On bcio (2.0.0-alpha.22), 76 exported assets (4.8 MB) hold only 20 distinct contents (1.0 MB). One SVG is written 20 times, as phppopacd.svg, phppopacd-2.svg and so on. The stored files really are separate uploads of the same image.

The content-hash store from #462 / #466 already writes each distinct content once, but it is opt-in. The default assets/ output should do the same:

  • StoredFileExporter keys what it has written by the content's sha256. Content it has already written returns the existing name, so every new File(__DIR__ . '/assets/…') for that content points at one file.
  • A name clash with different content still gets -2, -3…
  • The first file in site-map order names the shared asset, so a reload stores the later resources under that slug. Regenerating after the reload gives the same file, so it is still a fixed point.
  • Sharing is safe on load: UploadableFileManager::persistFiles() reads the source through a stream and never moves it.

Proposed tests:

  • GenerateFixturesCommandTest: two resources with identical bytes under different stored names give one asset and two new File() lines naming it. Different bytes under one name still give -2.
  • Round trip (generate_fixtures_round_trip.feature): a site with two identical uploads reloads with both files present and regenerates byte for byte.

Reported by the bcio session. This would save 79% of bcio's assets, and probably a good share of Cymru Kitchens' 275 MB.

Lenguaje dominante
PHP
Estrellas
32
Forks
8
Merge medio
40 min
PR fusionados (30 d)
133

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de components-web-app/api-components-bundle

Todos los issues de components-web-app/api-components-bundle

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.