generate-fixtures: write byte-identical assets once in the default assets/ output
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #470 @silverbackdan による — マージ済み
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- PHP
- スター
- 32
- フォーク
- 8
- 平均マージ
- 1時間 1分
- マージ済み PR(30日)
- 159
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
components-web-app/api-components-bundle のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
components-web-app/api-components-bundle#504 · コメント 22 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
components-web-app/api-components-bundle#333 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
components-web-app/api-components-bundle#325 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
components-web-app/api-components-bundle#259 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
components-web-app/api-components-bundle#186 ·
メンテナーはふだん 1 日以内に返信
components-web-app/api-components-bundle の issue をすべて見る
似ている issue
-
sync-en
難易度 1/5 1時間未満 初心者へのやさしさ 83/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nextcloud/integration_openai#446 ·
-
bug customer-reported
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
MagnaCapax/PMSS#1101 ·
メンテナーはふだん 5 日以内に返信
-
Installation / Upgrade Platform: Docker
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信