Skip to content

feat(AC0033): make the rule opt-in (Info, disabled by default) - #585

Merged
Arthurvdv merged 2 commits into
mainfrom
feat/ac0033-opt-in
Oct 17, 2026
Merged

Arthurvdv merged 2 commits into
mainfrom
feat/ac0033-opt-in

Conversation

@Arthurvdv

@Arthurvdv Arthurvdv commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Summary

AC0033 (RestClientRequiresHttpClientHandler) becomes an opt-in rule: default severity Info, isEnabledByDefault: false.

Intent: enable AC0033 when every app must send its HTTP calls from its own extension, regardless of its dependencies. In a non-production environment the runtime blocks an extension's HTTP requests unless Allow HttpClient Requests is turned on for that extension on the Extension Settings page, and after a production environment is copied to a sandbox the setting has to be turned on per extension. Without an "Http Client Handler" implementation in the app, the System Application's default handler (or a handler in a dependency app) sends the request, so the app's own setting does not govern the call.

A shared base layer that sends the HTTP calls for its dependent apps is a valid design, and AC0033 does not see handlers in dependencies. So the rule is off by default instead of reporting every dependent app.

Changes

  • DiagnosticDescriptors.cs: AC0033 is Info and disabled by default. AC0034 is unchanged (Warning, enabled).
  • ALCops.ApplicationCopAnalyzers.resx: AC0033 Title, MessageFormat and Description rewritten around the intent.
  • Tests: RestClientRequiresHttpClientHandler.ruleset.json enables AC0033; the test fixture passes it through RuleSetPath. No analyzer logic change.
  • .claude/rules/diagnostics/ac0033-ac0034-required-interface-implementation.md: purpose, severity/default decisions and test notes updated.

Verification

  • dotnet build ALCops.sln: 0 errors; dotnet format ALCops.sln --verify-no-changes: clean.
  • dotnet test filtered to RestClientRequiresHttpClientHandler + TelemetryRequiresTelemetryLogger: 46/46 passed.
  • Sanity check: without the ruleset, all 17 AC0033 HasDiagnostic cases fail (rule disabled by default); reverted.
  • Full dotnet test ALCops.sln: all green.
  • Release build for netstandard2.1, net8.0, net10.0: 0 warnings, 0 errors.
  • Validate-Rules.ps1: OK.

Docs: ALCops/alcops.dev#206

🤖 Generated with Claude Code

AC0033 now targets teams that want every app to send its HTTP calls
from its own extension, so the Allow HttpClient Requests setting governs
each app's calls in non-production environments. A shared base layer
that sends HTTP calls for its dependent apps is a valid design, so the
rule is Info and disabled by default. The resx text is rewritten around
that intent and the tests enable the rule through a ruleset.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Arthurvdv
Arthurvdv merged commit bf0a575 into main Oct 17, 2026
47 checks passed
@Arthurvdv
Arthurvdv deleted the feat/ac0033-opt-in branch October 17, 2026 08:39
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