Add NoOpOnboardingTelemetryRecorder null-object for IOnboardingTelemetryRecorder, Fixes AB#3647678#3185
Open
wzhipan wants to merge 1 commit into
Conversation
…tryRecorder Stateless NoOpOnboardingTelemetryRecorder (Kotlin object -> Java-visible INSTANCE) implementing IOnboardingTelemetryRecorder: addStep/addBlockingError are no-ops and finalizeBlob() returns an empty string, honoring the @nonnull contract added in AB#3647677. Lets broker callers hold the recorder as @nonnull and drop null guards. Adds unit tests and a [MINOR] changelog entry. Builds on AB#3647677 (finalizeBlob() promoted onto the interface). AB#3647678 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
✅ Work item link check complete. Description contains link AB#3647677 to an Azure Boards work item. |
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
Adds
NoOpOnboardingTelemetryRecorder, a stateless Null-Object implementation ofIOnboardingTelemetryRecorderincommon4j:addStep(...)/addBlockingError(...)are no-opsfinalizeBlob()returns""— honoring the@NonNullcontract added by Promote finalizeBlob() onto IOnboardingTelemetryRecorder interface, Fixes AB#3647677 #3180 (an empty blob means "nothing worth emitting", exactly what the concreteOnboardingTelemetryRecorderreturns when there is no joinable session-correlation id)Exposed as a Kotlin
object→ Java-visibleNoOpOnboardingTelemetryRecorder.INSTANCEsingleton, so broker code can holdmOnboardingRecorderas@NonNulland drop the scatteredif (recorder != null)guards (see the companion broker PR).Why
Follow-up from PR-A review feedback (ad-accounts-for-android#178). The recorder is a textbook Null-Object fit — "when absent, everything stays a no-op."
This PR is stacked on top of #3180 (AB#3647677, which promotes
finalizeBlob()onto the interface) and targets its branchcopilot/finalizeblob-on-interface-3647677, so the diff here shows only the NoOp change. GitHub will auto-retarget this PR todevonce #3180 merges. Please review/merge #3180 first.Cross-repo
Paired with the broker PR in
identity-authnz-teams/ad-accounts-for-androidthat convertsmOnboardingRecorderto@NonNulland consumesNoOpOnboardingTelemetryRecorder.INSTANCE. The broker'scommonsubmodule bump to a released Common version is deferred to release (matching #3180's pattern).Testing
NoOpOnboardingTelemetryRecorderTest(4 tests):finalizeBlob()returns"",addStep/addBlockingErrorare no-ops,INSTANCEis a stable stateless singleton../gradlew :common4j:testgreen locally (JDK 17).[MINOR]changelog entry added under vNext.AB#3647678