Skip to content

[#99] Create build report schema on demand; view rename and Content Directory docs#103

Merged
SkowronskiAndrew merged 4 commits into
mainfrom
issue99-part3
Jul 17, 2026
Merged

[#99] Create build report schema on demand; view rename and Content Directory docs#103
SkowronskiAndrew merged 4 commits into
mainfrom
issue99-part3

Conversation

@SkowronskiAndrew

@SkowronskiAndrew SkowronskiAndrew commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #99. This branch collects several small, independent changes that came out of
testing and reviewing the ContentDirectory / ContentLayout work already merged for #99.

Changes

Behavior

  • Create the BuildReport schema on demand. The build_report_* tables and views were
    created for every analyze run, adding empty tables as noise to databases that never
    contained a build report. They are now created lazily, mirroring how ContentLayout and
    Addressables build-layout schemas are only created when their input is actually analyzed.
    The build_reports / build_report_files / build_report_archive_contents group is
    created on the first BuildReport object; the build_report_packed_* tables and views on
    the first PackedAssets object (so a report with no PackedAssets does not get them).
    Creation is type-driven rather than extension-driven, so it is robust to renamed files and
    to the unspecified order of objects within a report.

Schema rename

  • Renamed content_layout_data_files_view to content_layout_resource_files_view. "resource"
    matches the convention of calling .resource / .resS content "resources", which reads
    more clearly than "data".

Documentation

  • Documented how .resS and .resource files work in Content Directory builds.
  • Assorted doc tweaks and corrections from reviewing and testing the "analyze" command - Support ContentLayout.json #99 changes, and a note
    that the build report tables are created on demand.

Testing

  • dotnet build -c Release — clean (0 warnings, 0 errors).
  • dotnet testUnityDataTool.Tests 256/256 and Analyzer.Tests 62/62 green.
  • Manual verification of the on-demand behavior: analyzing a plain AssetBundle produces a
    database with no build_report* tables/views, while analyzing a .buildreport creates and
    populates them and the cross-referencing build_report_packed_assets_view queries correctly.

content_layout_resource_files_view seems a better name, "resource" is overloaded but there is more of a convention to call
".resource" and ".resS" content "resources" rather than "data".

Also some manual adjustments of the text based on reviewing and testing.
For consistency with how we handle other optional "build report" files, change the schema creation

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR follows up on the ContentDirectory / ContentLayout work by reducing database noise (creating BuildReport schemas only when needed), renaming a ContentLayout convenience view to better match Unity terminology, and expanding/correcting documentation around ContentDirectory resource files and analysis behavior.

Changes:

  • Create build_report_* schema lazily: base BuildReport tables on first BuildReport object; packed-assets schema on first PackedAssets object.
  • Rename content_layout_data_files_viewcontent_layout_resource_files_view and update tests/docs accordingly.
  • Add/adjust documentation for ContentDirectory .resS/.resource behavior and clarify analyze inputs/behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
UnityDataTool.Tests/AnalyzeContentLayoutTests.cs Updates assertions to the renamed ContentLayout view.
Documentation/contentlayout-database.md Updates view name and adds a note about resource-file reuse.
Documentation/contentdirectory-format.md Adds a detailed section explaining cah:/ resource-file references and clarifies analyze input guidance.
Documentation/command-analyze.md Refines supported input descriptions and clarifies --skip-references effects.
Documentation/buildreport.md Documents the new on-demand BuildReport schema behavior.
Documentation/analyze-examples-contentlayout.md Updates example queries to the renamed view.
Analyzer/SQLite/Handlers/PackedAssetsHandler.cs Implements lazy creation for build_report_packed_* schema.
Analyzer/SQLite/Handlers/BuildReportHandler.cs Implements lazy creation for core BuildReport schema.
Analyzer/Resources/ContentLayoutViews.sql Renames the ContentLayout resource/data-files view.
AGENTS.md Updates high-level format description (JSON build reporting).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Analyzer/SQLite/Handlers/PackedAssetsHandler.cs
Comment thread Documentation/contentlayout-database.md Outdated
"multiple serialized file" -> "files" (Copilot review nit on PR #103).
@SkowronskiAndrew
SkowronskiAndrew marked this pull request as ready for review July 17, 2026 20:47
@SkowronskiAndrew
SkowronskiAndrew merged commit de3409a into main Jul 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants