Analyze - Support BuildReport files#45
Merged
SkowronskiAndrew merged 17 commits intov1_3from Dec 30, 2025
Merged
Conversation
Update AGENTS.md to try to reduce unnecessary redunant comments added by Claude
For readability
Record end time in the same ISO 6801 format as the start time The view wasn't adding value, can add views when they are clearly useful.
Using Cursor
Add build_report prefix so that these tables are clearly associated with the build report (the "PackedAsset" name is not intuitive)
This should save a ton of space for large builds especially if they have prefabs with many objets
…report This makes it possible to show the AssetBundle name in queries which is more recognizable than the internal name
5fd1cf7 to
0da97ee
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for analyzing Unity BuildReport files (.buildreport) to extract build information into SQL tables. The BuildReport object contains metadata about Unity builds including platform details, build results, timing information, and packed asset details.
Key changes:
- Added handlers for BuildReport and PackedAssets object types
- Created new SQL tables and views for build report data
- Added comprehensive test coverage for BuildReport analysis
- Added documentation for BuildReport support
Reviewed changes
Copilot reviewed 17 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityDataTool.Tests/BuildReportTests.cs | Updated test data path, modified existing tests to use new test data, added new comprehensive tests for BuildReport and PackedAssets analysis |
| TestCommon/Data/BuildReports/README.md | Added documentation describing test BuildReport files |
| TestCommon/Data/BuildReports/AssetBundle.buildreport.txt | Added text dump of example AssetBundle BuildReport for reference |
| Documentation/buildreport.md | Added comprehensive documentation on BuildReport support including usage, limitations, and alternatives |
| Documentation/analyzer.md | Added references to BuildReport documentation and new monoscript-related tables |
| Documentation/analyze-examples.md | Added reference to BuildReport documentation |
| Analyzer/Util/GuidHelper.cs | Added utility class for converting Unity GUID format to string |
| Analyzer/SerializedObjects/PackedAssets.cs | Added class to read and represent PackedAssets objects |
| Analyzer/SerializedObjects/BuildReport.cs | Added class to read and represent BuildReport objects including file list processing |
| Analyzer/SQLite/Writers/SerializedFileSQLiteWriter.cs | Registered new BuildReport and PackedAssets handlers |
| Analyzer/SQLite/Handlers/PackedAssetsHandler.cs | Added handler to process PackedAssets objects and insert into database |
| Analyzer/SQLite/Handlers/BuildReportHandler.cs | Added handler to process BuildReport objects and insert into database |
| Analyzer/Resources/PackedAssets.sql | Added SQL schema for PackedAssets tables and views |
| Analyzer/Resources/BuildReport.sql | Added SQL schema for BuildReport tables and views |
| Analyzer/Resources/AddrBuilds.sql | Added end_time column to addressables_builds table |
| Analyzer/Properties/Resources.resx | Added resource references for new SQL files |
| AGENTS.md | Added code style guidelines for comments and formatting |
Files not reviewed (1)
- Analyzer/Properties/Resources.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Improving PackedAsset views to make them more usable for working with AssetBundles Adding examples Remove accidental change to another table
0da97ee to
33bcabb
Compare
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.
Add BuildReport Analysis Support
Adds comprehensive support for analyzing Unity BuildReport files, enabling detailed inspection of build contents and source asset tracking.
New Features
Database Tables:
build_reports- Build summary (type, result, platform, duration, etc.)build_report_files- Files included in each build (path, role, size)build_report_archive_contents- AssetBundle content mappingbuild_report_packed_assets- SerializedFile/.resS/.resource file infobuild_report_packed_asset_info- Individual object details within packed assetsbuild_report_source_assets- Normalized source asset GUID and path dataViews:
build_report_files_view- All files from all build reportsbuild_report_packed_assets_view- PackedAssets with BuildReport, AssetBundle, and SerializedFile contextbuild_report_packed_asset_contents_view- All objects and resources tracked in build reportsHandlers:
BuildReportHandler- Extracts build summary, file lists, and AssetBundle content mappingsPackedAssetsHandler- Extracts detailed object-level data with source asset trackingUtilities:
GuidHelper- Code to properly deserialize GUID from Unity's byte orderingTest Coverage
New tests in
BuildReportTests.cscovering:Documentation
Documentation/buildreport.md- covering usage, schema, cross-referencing, limitations, and alternativesAdditional Notes
Compact format: Schema uses normalized
build_report_source_assetstable to avoid duplicate GUID/path storageThis is much more efficient than the repetitive format in the BuildReport.
For example a customer binary BuildReport of 320MB produced a 53MB analyze database.
I repurposed some code from the BuildReportInspector to process the FileList as it is imported (removing absolute paths and finding relationship between AssetBundles and their contents)
The views are designed to try to aid in common queries, but can be refined based on more real life usage. I haven't done much exploring of cross referencing a build and buildreport together so some views or example queries could probably help with that case.