Skip to content

Add NoOpOnboardingTelemetryRecorder null-object for IOnboardingTelemetryRecorder, Fixes AB#3647678#3185

Open
wzhipan wants to merge 1 commit into
copilot/finalizeblob-on-interface-3647677from
copilot/noop-onboarding-recorder-3647678
Open

Add NoOpOnboardingTelemetryRecorder null-object for IOnboardingTelemetryRecorder, Fixes AB#3647678#3185
wzhipan wants to merge 1 commit into
copilot/finalizeblob-on-interface-3647677from
copilot/noop-onboarding-recorder-3647678

Conversation

@wzhipan

@wzhipan wzhipan commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds NoOpOnboardingTelemetryRecorder, a stateless Null-Object implementation of IOnboardingTelemetryRecorder in common4j:

Exposed as a Kotlin object → Java-visible NoOpOnboardingTelemetryRecorder.INSTANCE singleton, so broker code can hold mOnboardingRecorder as @NonNull and drop the scattered if (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."

⚠️ Stacked on #3180 — review that first

This PR is stacked on top of #3180 (AB#3647677, which promotes finalizeBlob() onto the interface) and targets its branch copilot/finalizeblob-on-interface-3647677, so the diff here shows only the NoOp change. GitHub will auto-retarget this PR to dev once #3180 merges. Please review/merge #3180 first.

Cross-repo

Paired with the broker PR in identity-authnz-teams/ad-accounts-for-android that converts mOnboardingRecorder to @NonNull and consumes NoOpOnboardingTelemetryRecorder.INSTANCE. The broker's common submodule bump to a released Common version is deferred to release (matching #3180's pattern).

Testing

  • New NoOpOnboardingTelemetryRecorderTest (4 tests): finalizeBlob() returns "", addStep/addBlockingError are no-ops, INSTANCE is a stable stateless singleton.
  • ./gradlew :common4j:test green locally (JDK 17).
  • [MINOR] changelog entry added under vNext.

AB#3647678

…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>
@wzhipan
wzhipan requested review from a team as code owners July 15, 2026 07:33
@github-actions

Copy link
Copy Markdown

✅ Work item link check complete. Description contains link AB#3647677 to an Azure Boards work item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant