Repository navigation
feat(AC0034): make the rule opt-in (Info, disabled by default) - #586
Merged
Merged
Conversation
The Telemetry and Feature Telemetry codeunits look up the Telemetry Logger registered for the calling app's publisher on every call. Any installed app from the same publisher can register it, the first registration wins (since BC 25.0 a duplicate is ignored silently), and the logger app's own connection string receives the event. Microsoft documents one logger per publisher, so a logger supplied by a sibling app is a valid design that the analyzer cannot see from the compiling module. AC0034 now targets teams that want every app to carry its own logger. It is Info and disabled by default, the resx text is rewritten around that intent, and the tests enable the rule through a ruleset. The AC0033 ruleset enables both rules so the two-rule object keeps reporting both. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2 tasks done
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d snapshots The description and the rule doc said every app "carries its own" logger, which reads as per-app routing. The benefit of the opt-in rule is that an app's telemetry does not depend on which other apps from the publisher are installed; the lookup stays per publisher and the first registration wins. The Platform facts now name the BC code-history snapshots they were read from, including the two snapshots whose diff shows the 25.0 change. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Lowers AC0034 (
TelemetryRequiresTelemetryLogger) to Info and disables it by default, mirroring the AC0033 change. The check, its reach (the compiling module only) and the analyzer logic are unchanged. The resx text is rewritten around the opt-in intent: every app ships its own Telemetry Logger, so its telemetry does not depend on which other apps from the publisher are installed.Why opt-in (runtime facts)
From the System Application
Telemetry/src/Logging/sources:Telemetry.LogMessageandFeature Telemetryuse the calling app's publisher;Telemetry Impl.LogMessageInternalraises"Telemetry Loggers".OnRegisterTelemetryLoggerand then looks the logger up by publisher.Registerkeys the logger by the registering app's publisher, requires that publisher on the call stack, and keeps the first registration per publisher. The event fires on every telemetry call.Session.LogMessageruns in that app, so its connection string receives the event.0000G7K. The duplicate-registration warning0000G7Jexisted until BC 24; since 25.0 a duplicate is ignored silently, so a logger in every app is safe.Changes
DiagnosticDescriptors.cs: Info,isEnabledByDefault: false.TelemetryRequiresTelemetryLogger.ruleset.jsonwired throughSetup; the AC0033 ruleset enables both rules soBothRulesOneObjectReportsBothkeeps seeing AC0034; newDisabledWithoutRuleSet.Test plan
HasDiagnosticcases fail (10NoDiagnosticpass); with the ruleset wired all passTelemetryRequiresTelemetryLoggertests: 20 passed;RestClientRequiresHttpClientHandlertests: 29 passeddotnet build ALCops.sln,dotnet format ALCops.sln --verify-no-changes, ApplicationCop Release CI build (ContinuousIntegrationBuild=true, no-incremental),Validate-Rules.ps1Docs PR: ALCops/alcops.dev#207
Review notes
Automated review (3 rounds). Justified and not changed:
AC0034.mdandAC0033.mdin../alcops.devstill show Warning: separate docs PR, per house workflow.BothRulesOneObjectReportsBoth; documented in the rule doc test notes..vscode/Copy-BinToALAnalyzers.ps1is a pre-existing unrelated local change, not staged.🤖 Generated with Claude Code