Skip to content

refactor: migrate OTel rules out of core analyzers#127

Merged
4 commits merged into
mainfrom
migrate/move-otel-rules-to-OTSC
May 8, 2026
Merged

refactor: migrate OTel rules out of core analyzers#127
4 commits merged into
mainfrom
migrate/move-otel-rules-to-OTSC

Conversation

@ANcpLua
Copy link
Copy Markdown
Owner

@ANcpLua ANcpLua commented May 8, 2026

Summary

Removes 37 telemetry/observability/instrumentation analyzer rules from this pack. They are re-imported into the donation-track repo ANcpLua.OpenTelemetry.SemanticConventions.Analyzers in PR migrate/import-otel-rules-from-AL (paired with this one).

Scope

  • 37 analyzer files deleted from src/ANcpLua.Analyzers/Analyzers/ (AL0013, 0061, 0063, 0064, 0065, 0066, 0067, 0068, 0069, 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, 0078, 0079, 0083, 0085, 0086, 0088, 0089, 0090, 0091, 0092, 0093, 0096, 0107, 0108, 0109, 0110, 0113, 0131, 0135).
  • AL0128, AL0129, and AL0130 stay in ANcpLua.Analyzers because they enforce Loom tool-governance metadata, not OTel semantic-convention validation.
  • 9 codefix files deleted from src/ANcpLua.Analyzers.CodeFixes/CodeFixes/ (for AL0071, 0072, 0073, 0074, 0107, 0108, 0109, 0110, 0124).
  • 31 test files deleted from tests/ANcpLua.Analyzers.Tests/.
  • 2 shared semconv helpers deleted (src/ANcpLua.Analyzers/Semconv/OpenTelemetryDeprecatedSemconvCatalog.cs, src/ANcpLua.Analyzers/Semconv/OpenTelemetryGenAiSemconvFacts.cs).
  • AnalyzerReleases.Unshipped.md, README, changelog, and package description are aligned with the retained core rule set.

Consumer impact

This is a breaking change for anyone that has <NoWarn> / EditorConfig / .globalconfig overrides on the removed rule IDs. The replacement path is to add a PackageReference to ANcpLua.OpenTelemetry.SemanticConventions.Analyzers once that package ships.

Validation

  • dotnet clean ANcpLua.Analyzers.slnx
  • dotnet test --solution ANcpLua.Analyzers.slnx (692 passed)

Summary by CodeRabbit

  • New Features

    • Added multiple automatic code fixes and a new config-quality rule for AOT/EventSource support (AL0096).
  • Removed

    • Dropped several analyzers and their tests (metrics, certain OTLP/resource/GenAI checks, and related rules).
  • Improvements

    • Enhanced code-fix behaviors for modifier/attribute scenarios and refined semantic-convention validation.
  • Tests

    • Added tests for missing telemetry schema URL; reorganized and removed various analyzer test suites.
  • Documentation

    • Updated analyzer release listing and package description counts.

Copilot AI review requested due to automatic review settings May 8, 2026 00:02
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

@coderabbitai autofix

@ghost ghost enabled auto-merge (squash) May 8, 2026 00:02
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

📝 Walkthrough

Walkthrough

The PR reworks the analyzer suite: the package diagnostics count is updated from 106→88 and code fixes from 42→36. Multiple analyzers and their tests were removed (including AL0061, AL0067, AL0070, AL0075, AL0076, AL0086, AL0093, AL0096 tests removed then analyzer added, AL0113, and several AL01xx rules), test files were deleted or added, and the internal GenAI semconv facts type was removed. Several code-fix providers and new/updated tests were added or modified. No public API signatures for remaining analyzers were changed in the diff.

🚥 Pre-merge checks | ✅ 9
✅ Passed checks (9 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No Datetime.Now/Utcnow In Analyzer Code ✅ Passed No DateTime.Now/UtcNow usage in analyzer or code-fix code. All matches found in XML doc comments only (AL0026 describing code fix behavior). PR removes files rather than adds new code.
No .Result/.Wait() Blocking Async ✅ Passed No blocking async calls (.Result, .Wait(), GetAwaiter().GetResult()) detected in added/modified files. PR consists primarily of deletions; only .csproj was modified (XML only).
No Isourcegenerator ✅ Passed No ISourceGenerator implementations or [Generator] attributes found in added C# code. PR removes 40+ analyzers; no new generators. AL0120 enforcer intact.
No Null-Forgiving Operator Without Justification ✅ Passed PR removes 40 analyzers. No new C# files with null-forgiving operators were added. The 4 existing instances found (AL0117, AL0054, AL0053) are pre-existing and not modified.
No Isymbol Stored In Incremental Models ✅ Passed PR is purely removal-based (deleting 82+ files, no additions). No new incremental generator code with ISymbol/SyntaxNode/Compilation storage introduced.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title follows conventional commits format (refactor prefix), is under 72 characters (50 chars), contains no trailing period, and accurately describes the main changeset objective: systematic removal and relocation of OpenTelemetry analyzer rules.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53c754a578

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

@coderabbitai autofix

@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@ANcpLua ANcpLua changed the title remove: 40 telemetry/observability rules (moved to ANcpLua.OpenTelemetry.SemanticConventions.Analyzers) refactor: move OTel rules to OTSC analyzers May 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@ANcpLua ANcpLua changed the title refactor: move OTel rules to OTSC analyzers refactor: migrate OTel rules out of core analyzers May 8, 2026
ANcpLua and others added 4 commits May 8, 2026 02:11
…y.SemanticConventions.Analyzers

Pair to ANcpLua/ANcpLua.OpenTelemetry.SemanticConventions.Analyzers
PR migrate/import-otel-rules-from-AL. Rules listed below are deleted
from this pack and re-imported under the donation-track repo's
Imports/ subtree. NuGet consumers picking up the next minor of
ANcpLua.Analyzers should reference
ANcpLua.OpenTelemetry.SemanticConventions.Analyzers for equivalent
rule behaviour. ID renumbering AL00xx -> OTSC00xx happens in the
OTSC repo's follow-up PR; this commit only removes the source / test
/ codefix files from this pack.

Removed analyzers (40):
  OpenTelemetry: AL0013, 0061, 0063, 0073, 0076, 0077, 0078, 0079, 0085,
                 0086, 0088, 0089, 0090, 0091, 0092, 0093, 0107, 0108,
                 0109, 0110, 0113, 0135
  GenAI:         AL0064, 0065, 0066, 0074, 0124, 0128, 0129, 0130, 0131
  Metrics:       AL0067, 0068, 0071, 0072, 0075
  Configuration: AL0069, 0070, 0083, 0096

Removed codefixes (9): for AL0071, 0072, 0073, 0074, 0107, 0108, 0109,
                       0110, 0124.

Removed tests (31): one or two test files per rule (some rules had no
                    standalone test file in this repo).

Removed shared semconv helpers:
  src/.../Semconv/OpenTelemetryDeprecatedSemconvCatalog.cs
  src/.../Semconv/OpenTelemetryGenAiSemconvFacts.cs
  (only consumed by the moved OTel rules; the Semconv directory is
   left empty by this commit and will be pruned by Git automatically.)

Resources.resx entries for the removed AL00<id>AnalyzerTitle /
MessageFormat / Description keys remain in place for now (dead but
harmless). They get pruned in a follow-up alongside CodeFixResources.resx
parity cleanup. AnalyzerReleases tracking files are intentionally not
edited in this commit per maintainer no-md-writes rule; the removed
rules were all Unshipped, so their entries are simply deleted by the
next regeneration of the file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ANcpLua ANcpLua force-pushed the migrate/move-otel-rules-to-OTSC branch from 13864fc to 38a14bd Compare May 8, 2026 00:11
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

@coderabbitai autofix

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 8, 2026

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

@claude
Copy link
Copy Markdown

claude Bot commented May 8, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@ghost ghost merged commit 8ee61ce into main May 8, 2026
17 checks passed
@ghost ghost deleted the migrate/move-otel-rules-to-OTSC branch May 8, 2026 00:14
@ANcpLua ANcpLua review requested due to automatic review settings May 8, 2026 00:26
This pull request was closed.
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