[#99] Create build report schema on demand; view rename and Content Directory docs#103
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
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 firstBuildReportobject; packed-assets schema on firstPackedAssetsobject. - Rename
content_layout_data_files_view→content_layout_resource_files_viewand update tests/docs accordingly. - Add/adjust documentation for ContentDirectory
.resS/.resourcebehavior 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.
"multiple serialized file" -> "files" (Copilot review nit on PR #103).
SkowronskiAndrew
marked this pull request as ready for review
July 17, 2026 20:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
build_report_*tables and views werecreated 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_contentsgroup iscreated on the first
BuildReportobject; thebuild_report_packed_*tables and views onthe first
PackedAssetsobject (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
content_layout_data_files_viewtocontent_layout_resource_files_view. "resource"matches the convention of calling
.resource/.resScontent "resources", which readsmore clearly than "data".
Documentation
.resSand.resourcefiles work in Content Directory builds.that the build report tables are created on demand.
Testing
dotnet build -c Release— clean (0 warnings, 0 errors).dotnet test—UnityDataTool.Tests256/256 andAnalyzer.Tests62/62 green.database with no
build_report*tables/views, while analyzing a.buildreportcreates andpopulates them and the cross-referencing
build_report_packed_assets_viewqueries correctly.