[6.2 🍒][Dependency Scanning] Miscellaneous fixes to import statement info serialization #81254
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.
Cherry-pick of #80723
Explanation: This change is an overall code improvement to handling of
import
statement information as it gets serialized into the dependency scanner incremental build state.import
statement data technically isn't crucially important to get serialized, as up-to-date modules will have their imports already resolved, and non-up-to-date modules will have their imports re-scanned, but the code change still cleans up overall handling to ensure serialized state is consistent.currentModuleImports
,currentOptionalModuleImports
) from serialized import strings, instead of the now in-use import infos.Risk: Low, serialization of
import
statements is now more sound than it was before. Though they should not get used often much.Testing: Added tests to test suite
Original PRs: #80723
Reviewers: @cachemeifyoucan