generate-fixtures: write byte-identical assets once in the default assets/ output
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
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:
StoredFileExporterkeys what it has written by the content's sha256. Content it has already written returns the existing name, so everynew 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 twonew 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de components-web-app/api-components-bundle
-
Codecov project status fails before the Behat coverage upload landsPosiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
components-web-app/api-components-bundle#472 ·
Los mantenedores suelen responder en 1 día
-
Fixture builder: accept a PageBuilder or PageDataBuilder as the target of linkRoute(), linkIri() and redirect(to:)Posiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
components-web-app/api-components-bundle#471 ·
Los mantenedores suelen responder en 1 día
-
Component groups: a maximum number of components (e.g. exactly one CTA)Posiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
components-web-app/api-components-bundle#464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
generate-fixtures: configurable asset store (local folder or Flysystem) with a content-hash manifest and pruningPosiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
components-web-app/api-components-bundle#462 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
generate-fixtures drops a redirect on a route that also has a pagePosiblemente ocupada @silverbackdan la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
components-web-app/api-components-bundle#461 ·
Los mantenedores suelen responder en 1 día
Todos los issues de components-web-app/api-components-bundle
Issues similares
-
major-release
Dificultad 1/5 Menos de una hora Aptitud para principiantes 67/100
Intervention/image#1553 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
omegaup/omegaup#10353 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
effort: low graphiql ide impact: low scope: code quality type: chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
wp-graphql/wp-graphql#4486 ·
Los mantenedores suelen responder en 1 día