Fix Null Reference to HostContext in GlibcCompatibilityInfoProvider #5472
+15
−19
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.
Context
Resolve null reference issue in GlibcCompatibilityInfoProvider. The issue occurs when
HostContextis not properly initialized during dependency injection, causing potential failures in glibc compatibility checks.AB#2353979
Description
Improved initialization of
GlibcCompatibilityInfoProviderby properly implementing AgentService initialize method and correcting constructor flow.Key Changes:
base.Initialize(hostContext)HostContextproperty from AgentService base classRisk Assessment (Low / Medium / High)
Assess the risk level and justify your assessment. For example: code path sensitivity, usage scope, or backward compatibility concerns.
Unit Tests Added or Updated (Yes / No)
Yes, updated test constructors as base class constructors is updated.
Additional Testing Performed
Tested with pipeline run for this scenario as well
https://dev.azure.com/surajitshil/Node-24-upgrade/_build/results?buildId=812
https://dev.azure.com/rishabhmalikOrg/Test%20Project/_build/results?buildId=2370&view=logs&j=12f1170f-54f2-53f3-20dd-22fc7dff55f9&t=944b7e9c-00d2-5ab3-4f94-8de8fe321ef4
Change Behind Feature Flag (Yes / No)
This is behind exsiting feature falg currently.
Tech Design / Approach
Documentation Changes Required (Yes/No)
Indicate whether related documentation needs to be updated.
Logging Added/Updated (Yes/No)
Telemetry Added/Updated (Yes/No)
Rollback Scenario and Process (Yes/No)
Dependency Impact Assessed and Regression Tested (Yes/No)