[#55] Show type name in build_report_packed_asset_contents_view#90
Merged
SkowronskiAndrew merged 2 commits intoJul 9, 2026
Merged
Conversation
Populate the types table from TypeIdRegistry when importing a BuildReport so the packed asset contents view can display human-readable type names instead of numeric class ids, even when the build output is not analyzed alongside the report.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Analyzer’s BuildReport import and SQL views so packed-asset type IDs can be displayed as human-readable Unity type names (via types), even when no accompanying build output / TypeTrees are analyzed.
Changes:
- Populate
typesduring BuildReport PackedAssets import usingTypeIdRegistrywhen available. - Update
build_report_packed_asset_contents_viewto show a type name (fallback to numeric ID as text). - Add
TryGetTypeNametoTypeIdRegistryand bump schemauser_versionto 4; adjust tests/docs accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| UnityFileSystem/TypeIdRegistry.cs | Adds TryGetTypeName for “known vs unknown” type-name lookup. |
| Analyzer/SQLite/Handlers/PackedAssetsHandler.cs | Inserts type-name mappings into types during BuildReport packed-asset import. |
| Analyzer/SQLite/Commands/AbstractCommand.cs | Adds an INSERT conflict-clause seam for command generation. |
| Analyzer/SQLite/Commands/SerializedFile/AddType.cs | Applies conflict handling to types inserts to avoid duplicate-key crashes. |
| Analyzer/Resources/PackedAssets.sql | Updates the packed-asset contents view to expose type names via types. |
| Analyzer/Resources/Init.sql | Bumps schema version to 4 and updates schema-version commentary. |
| UnityDataTool.Tests/BuildReportTests.cs | Updates assertions to expect string type names in the view. |
| Documentation/buildreport.md | Updates docs to reflect numeric storage + view-level type-name display and other notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **Duplicate filenames:** Multiple build reports cannot be imported into the same database if they share the same filename. This is a general UnityDataTool limitation that assumes unique SerializedFile names. | ||
|
|
||
| **Type names:** While `build_report_packed_asset_info.type` records valid [Class IDs](https://docs.unity3d.com/Manual/ClassIDReference.html), the string type name may not exist in the `types` table. The `types` table is only populated when processing object instances (during TypeTree analysis). Analyzing both build output **and** build report together ensures types are fully populated; otherwise only numeric IDs are available. | ||
| **Duplicate filenames:** Multiple build reports cannot be imported into the same database if they share the same filename. This is a general UnityDataTool limitation that assumes unique SerializedFile names. The BuildReport files in the build history (introduced in Unity 6.6) intentionally have unique file names (incorporating the build session GUID), so analyze does not hit this issue when analyzing multiple entries from the BuildHistory folder. When analyzing multiple AssetBundle build reports, or build reports from older versions of unity, be sure to assign a unique filename to each. See also issue #36. |
Collaborator
Author
There was a problem hiding this comment.
Fixed capitalization (unity -> Unity) and normalized the double-spaces in 8ad05d2.
- PackedAssetsHandler: skip redundant type inserts via a HashSet (a report can list thousands of objects sharing a few types). - AddType: reword the OR IGNORE comment - first insert wins is fine since the name for a given id matches across TypeIdRegistry and TypeTree; the case that matters (id missing from the registry) still gets its name from TypeTree. - buildreport.md: capitalization and spacing.
Collaborator
Author
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
Fixes #55.
BuildReport files record each packed asset's type by numeric Class ID only, which is compact but not human-friendly when browsing
build_report_packed_asset_contents_view. Previously the view exposed the raw integer.The analyze schema already has a
typestable mapping ids to names, andUnityFileSystem/TypeIdRegistry.csnow provides a comprehensive id→name list. This change populates thetypestable from the registry during BuildReport import and updates the view to show the type name — so names are available even when the associated build output (and its TypeTrees) is not analyzed alongside the report. This ships as part of the v2.0 analyze-schema changes.Changes
TypeIdRegistry, insert it into the sharedtypestable (INSERT OR IGNORE, so an authoritative TypeTree-derived name already present wins). Thebuild_report_packed_asset_info.typecolumn still stores the numeric id.build_report_packed_asset_contents_view:typenow shows the type name viaCOALESCE(types.name, CAST(type AS TEXT))— the name when known, the numeric id as text otherwise.TryGetTypeNameso callers can tell whether a real name exists (unlikeGetTypeName, which falls back to the id).ConflictClauseseam and set thetypesinsert toINSERT OR IGNORE. This prevents a UNIQUE-constraint crash when a report and its build output are analyzed together — the writer's in-memory type-set doesn't know about ids the handler inserted. Names for known ids are identical between the registry and TypeTrees, so this is lossless.PRAGMA user_versionto 4 and reframed its comment as a general schema tracker (find-refs is just the only command that reads an existing DB and checks it).find-refs' minimum required version is unchanged.Documentation/buildreport.md(type-names limitation and column-naming notes).Testing
dotnet test— full suite green (Analyzer.Tests 62, UnityFileSystem.Tests 425, UnityDataTool.Tests 238).Analyze_BuildReport_AssetBundle_ContainsPackedAssetsDatato asserttype = 'Texture2D'and added an assertion on the returned type name.analyzeon the sampleAssetBundle.buildreport; the view now reports string types (Texture2D,AssetBundle,Sprite,Material,Shader, …).